[HOTFIX] fix build spark and R interpreters

This commit is contained in:
tinkoff-dwh 2017-10-24 18:30:58 +05:00
parent c45128e79f
commit 0c9828bb9b
7 changed files with 46 additions and 44 deletions

View file

@ -34,12 +34,12 @@ import java.util.Properties;
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() {
@ -47,38 +47,39 @@ public class KnitR extends Interpreter implements WrappedInterpreter {
}
@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;
}
@ -94,14 +95,14 @@ public class KnitR extends Interpreter implements WrappedInterpreter {
}
@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

View file

@ -34,12 +34,12 @@ import java.util.Properties;
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() {
@ -47,38 +47,39 @@ public class RRepl extends Interpreter implements WrappedInterpreter {
}
@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;
}
@ -94,14 +95,14 @@ public class RRepl extends Interpreter implements WrappedInterpreter {
}
@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

View file

@ -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 = {

View file

@ -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")

View file

@ -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 = {

View file

@ -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")
}

View file

@ -932,7 +932,7 @@ public class SparkInterpreter extends Interpreter {
return sparkUrl;
}
String sparkUrlProp = property.getProperty("zeppelin.spark.uiWebUrl", "");
String sparkUrlProp = getProperty("zeppelin.spark.uiWebUrl", "");
if (!StringUtils.isBlank(sparkUrlProp)) {
return sparkUrlProp;
}