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
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ protected String createTempSetting(String tempName)
.add(tempName,
"newGroup",
new LinkedList<Dependency>(),
new InterpreterOption(false),
new InterpreterOption(),
new Properties());
return setting.id();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public InterpreterFactory(ZeppelinConfiguration conf,
RemoteInterpreterProcessListener remoteInterpreterProcessListener,
DependencyResolver depResolver)
throws InterpreterException, IOException, RepositoryException {
this(conf, new InterpreterOption(true), angularObjectRegistryListener,
this(conf, new InterpreterOption(), angularObjectRegistryListener,
remoteInterpreterProcessListener, depResolver);
}

Expand Down Expand Up @@ -312,7 +312,6 @@ private void loadFromFile() throws IOException {
// While we decided to turn this feature on always (without providing
// enable/disable option on GUI).
// previously created setting should turn this feature on here.
setting.getOption().setRemote(true);

InterpreterSetting intpSetting = new InterpreterSetting(
setting.id(),
Expand Down Expand Up @@ -499,19 +498,11 @@ public InterpreterGroup createInterpreterGroup(String id, InterpreterOption opti
AngularObjectRegistry angularObjectRegistry;

InterpreterGroup interpreterGroup = new InterpreterGroup(id);
if (option.isRemote()) {
angularObjectRegistry = new RemoteAngularObjectRegistry(
id,
angularObjectRegistryListener,
interpreterGroup
);
} else {
angularObjectRegistry = new AngularObjectRegistry(
id,
angularObjectRegistryListener);

// TODO(moon) : create distributed resource pool for local interpreters and set
}
angularObjectRegistry = new RemoteAngularObjectRegistry(
id,
angularObjectRegistryListener,
interpreterGroup
);

interpreterGroup.setAngularObjectRegistry(angularObjectRegistry);
return interpreterGroup;
Expand Down Expand Up @@ -581,17 +572,11 @@ public void createInterpretersForNote(
&& info.getGroup().equals(groupName)) {
Interpreter intp;

if (option.isRemote()) {
intp = createRemoteRepl(info.getPath(),
key,
info.getClassName(),
properties,
interpreterSetting.id());
} else {
intp = createRepl(info.getPath(),
info.getClassName(),
properties);
}
intp = createRemoteRepl(info.getPath(),
key,
info.getClassName(),
properties,
interpreterSetting.id());

synchronized (interpreterGroup) {
List<Interpreter> interpreters = interpreterGroup.get(key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
*/
public class InterpreterOption {
boolean remote;
boolean remote = true;
boolean perNoteSession;
boolean perNoteProcess;

Expand Down Expand Up @@ -58,18 +58,12 @@ public void setHost(String host) {
}


public InterpreterOption() {
remote = false;
}

public InterpreterOption(boolean remote) {
this.remote = remote;
}

@Deprecated
public boolean isRemote() {
return remote;
}

@Deprecated
public void setRemote(boolean remote) {
this.remote = remote;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void setUp() throws Exception {
System.setProperty(ConfVars.ZEPPELIN_INTERPRETERS.getVarName(), "org.apache.zeppelin.interpreter.mock.MockInterpreter1,org.apache.zeppelin.interpreter.mock.MockInterpreter2");
conf = new ZeppelinConfiguration();
depResolver = new DependencyResolver(tmpDir.getAbsolutePath() + "/local-repo");
factory = new InterpreterFactory(conf, new InterpreterOption(false), null, null, depResolver);
factory = new InterpreterFactory(conf, new InterpreterOption(), null, null, depResolver);
context = new InterpreterContext("note", "id", "title", "text", null, null, null, null, null, null, null);

}
Expand Down Expand Up @@ -115,7 +115,7 @@ public void testExceptions() throws InterpreterException, IOException, Repositor
assertEquals("Test null option" , e.getMessage(),new NullArgumentException("option").getMessage());
}
try {
factory.add("a mock", "mock2", new LinkedList<Dependency>(), new InterpreterOption(false), null);
factory.add("a mock", "mock2", new LinkedList<Dependency>(), new InterpreterOption(), null);
} catch (NullArgumentException e){
assertEquals("Test null properties" , e.getMessage(),new NullArgumentException("properties").getMessage());
}
Expand All @@ -130,7 +130,7 @@ public void testSaveLoad() throws IOException, RepositoryException {
// check if file saved
assertTrue(new File(conf.getInterpreterSettingPath()).exists());

factory.add("newsetting", "mock1", new LinkedList<Dependency>(), new InterpreterOption(false), new Properties());
factory.add("newsetting", "mock1", new LinkedList<Dependency>(), new InterpreterOption(), new Properties());
assertEquals(3, factory.get().size());

InterpreterFactory factory2 = new InterpreterFactory(conf, null, null, null, depResolver);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void setUp() throws Exception {
MockInterpreter2.register("mock2", "group2", "org.apache.zeppelin.interpreter.mock.MockInterpreter2");

depResolver = new DependencyResolver(tmpDir.getAbsolutePath() + "/local-repo");
factory = new InterpreterFactory(conf, new InterpreterOption(false), null, null, depResolver);
factory = new InterpreterFactory(conf, new InterpreterOption(), null, null, depResolver);
}

@After
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void setUp() throws Exception {
MockInterpreter2.register("mock2", "org.apache.zeppelin.interpreter.mock.MockInterpreter2");

depResolver = new DependencyResolver(tmpDir.getAbsolutePath() + "/local-repo");
factory = new InterpreterFactory(conf, new InterpreterOption(false), null, null, depResolver);
factory = new InterpreterFactory(conf, new InterpreterOption(), null, null, depResolver);

SearchService search = mock(SearchService.class);
notebookRepo = new VFSNotebookRepo(conf);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void setUp() throws Exception {
MockInterpreter2.register("mock2", "org.apache.zeppelin.interpreter.mock.MockInterpreter2");

depResolver = new DependencyResolver(mainZepDir.getAbsolutePath() + "/local-repo");
factory = new InterpreterFactory(conf, new InterpreterOption(false), null, null, depResolver);
factory = new InterpreterFactory(conf, new InterpreterOption(), null, null, depResolver);

search = mock(SearchService.class);
notebookRepoSync = new NotebookRepoSync(conf);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void setUp() throws Exception {

this.schedulerFactory = new SchedulerFactory();
depResolver = new DependencyResolver(mainZepDir.getAbsolutePath() + "/local-repo");
factory = new InterpreterFactory(conf, new InterpreterOption(false), null, null, depResolver);
factory = new InterpreterFactory(conf, new InterpreterOption(), null, null, depResolver);

SearchService search = mock(SearchService.class);
notebookRepo = new VFSNotebookRepo(conf);
Expand Down