Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions r/src/main/java/org/apache/zeppelin/rinterpreter/KnitR.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,51 +34,52 @@
public class KnitR extends Interpreter implements WrappedInterpreter {
KnitRInterpreter intp;

public KnitR(Properties property, Boolean startSpark) {
super(property);
intp = new KnitRInterpreter(property, startSpark);
public KnitR(Properties properties, Boolean startSpark) {
super(properties);
intp = new KnitRInterpreter(properties, startSpark);
}
public KnitR(Properties property) {
this(property, true);
public KnitR(Properties properties) {
this(properties, true);
}

public KnitR() {
this(new Properties());
}

@Override
public void open() {
public void open() throws InterpreterException {
intp.open();
}

@Override
public void close() {
public void close() throws InterpreterException {
intp.close();
}

@Override
public InterpreterResult interpret(String s, InterpreterContext interpreterContext) {
public InterpreterResult interpret(String s, InterpreterContext interpreterContext)
throws InterpreterException {
return intp.interpret(s, interpreterContext);
}

@Override
public void cancel(InterpreterContext interpreterContext) {
public void cancel(InterpreterContext interpreterContext) throws InterpreterException {
intp.cancel(interpreterContext);
}

@Override
public FormType getFormType() {
public FormType getFormType() throws InterpreterException {
return intp.getFormType();
}

@Override
public int getProgress(InterpreterContext interpreterContext) {
public int getProgress(InterpreterContext interpreterContext) throws InterpreterException {
return intp.getProgress(interpreterContext);
}

@Override
public List<InterpreterCompletion> completion(String s, int i,
InterpreterContext interpreterContext) {
InterpreterContext interpreterContext) throws InterpreterException {
List completion = intp.completion(s, i, interpreterContext);
return completion;
}
Expand All @@ -94,14 +95,14 @@ public Scheduler getScheduler() {
}

@Override
public void setProperty(Properties property) {
super.setProperty(property);
intp.setProperty(property);
public void setProperties(Properties properties) {
super.setProperties(properties);
intp.setProperties(properties);
}

@Override
public Properties getProperty() {
return intp.getProperty();
public Properties getProperties() {
return intp.getProperties();
}

@Override
Expand Down
35 changes: 18 additions & 17 deletions r/src/main/java/org/apache/zeppelin/rinterpreter/RRepl.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,51 +34,52 @@
public class RRepl extends Interpreter implements WrappedInterpreter {
RReplInterpreter intp;

public RRepl(Properties property, Boolean startSpark) {
super(property);
intp = new RReplInterpreter(property, startSpark);
public RRepl(Properties properties, Boolean startSpark) {
super(properties);
intp = new RReplInterpreter(properties, startSpark);
}
public RRepl(Properties property) {
this(property, true);
public RRepl(Properties properties) {
this(properties, true);
}

public RRepl() {
this(new Properties());
}

@Override
public void open() {
public void open() throws InterpreterException {
intp.open();
}

@Override
public void close() {
public void close() throws InterpreterException {
intp.close();
}

@Override
public InterpreterResult interpret(String s, InterpreterContext interpreterContext) {
public InterpreterResult interpret(String s, InterpreterContext interpreterContext)
throws InterpreterException {
return intp.interpret(s, interpreterContext);
}

@Override
public void cancel(InterpreterContext interpreterContext) {
public void cancel(InterpreterContext interpreterContext) throws InterpreterException {
intp.cancel(interpreterContext);
}

@Override
public FormType getFormType() {
public FormType getFormType() throws InterpreterException {
return intp.getFormType();
}

@Override
public int getProgress(InterpreterContext interpreterContext) {
public int getProgress(InterpreterContext interpreterContext) throws InterpreterException {
return intp.getProgress(interpreterContext);
}

@Override
public List<InterpreterCompletion> completion(String s, int i,
InterpreterContext interpreterContext) {
InterpreterContext interpreterContext) throws InterpreterException {
List completion = intp.completion(s, i, interpreterContext);
return completion;
}
Expand All @@ -94,14 +95,14 @@ public Scheduler getScheduler() {
}

@Override
public void setProperty(Properties property) {
super.setProperty(property);
intp.setProperty(property);
public void setProperties(Properties properties) {
super.setProperties(properties);
intp.setProperties(properties);
}

@Override
public Properties getProperty() {
return intp.getProperty();
public Properties getProperties() {
return intp.getProperties();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import org.apache.zeppelin.interpreter.InterpreterResult
import org.apache.zeppelin.rinterpreter.rscala.RException


class KnitRInterpreter(property: Properties, startSpark : Boolean = true) extends RInterpreter(property, startSpark) {
def this(property : Properties) = {
this(property, true)
class KnitRInterpreter(properties: Properties, startSpark : Boolean = true) extends RInterpreter(properties, startSpark) {
def this(properties : Properties) = {
this(properties, true)
}

override def open: Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ abstract class RInterpreter(properties : Properties, startSpark : Boolean = true

def getrContext: RContext = rContext

protected lazy val rContext : RContext = synchronized{ RContext(property, this.getInterpreterGroup().getId()) }
protected lazy val rContext : RContext = synchronized{ RContext(properties, this.getInterpreterGroup().getId()) }

def open: Unit = rContext.synchronized {
logger.trace("RInterpreter opening")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ import org.apache.zeppelin.interpreter.InterpreterContext
import org.apache.zeppelin.interpreter.InterpreterResult
import org.apache.zeppelin.rinterpreter.rscala.RException

class RReplInterpreter(property: Properties, startSpark : Boolean = true) extends RInterpreter(property, startSpark) {
class RReplInterpreter(properties: Properties, startSpark : Boolean = true) extends RInterpreter(properties, startSpark) {

// protected val rContext : RContext = RContext(property)
// protected val rContext : RContext = RContext(properties)

def this(property : Properties) = {
this(property, true)
def this(properties : Properties) = {
this(properties, true)
}
private var firstCell : Boolean = true
def interpret(st: String, context: InterpreterContext): InterpreterResult = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class RInterpreterTest extends FlatSpec {
it should "have persistent properties" in {
val props = new Properties()
props.setProperty("hello", "world")
rint.setProperty(props)
rint.setProperties(props)
assertResult("world") {
rint.getProperty("hello")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ public String getSparkUIUrl() {
return sparkUrl;
}

String sparkUrlProp = property.getProperty("zeppelin.spark.uiWebUrl", "");
String sparkUrlProp = getProperty("zeppelin.spark.uiWebUrl", "");
if (!StringUtils.isBlank(sparkUrlProp)) {
return sparkUrlProp;
}
Expand Down