Search in sources :

Example 1 with RemoteInterpreterEventPoller

use of org.apache.zeppelin.interpreter.remote.RemoteInterpreterEventPoller in project zeppelin by apache.

the class DistributedResourcePoolTest method setUp.

@Before
public void setUp() throws Exception {
    env = new HashMap<>();
    env.put("ZEPPELIN_CLASSPATH", new File("./target/test-classes").getAbsolutePath());
    Properties p = new Properties();
    intp1 = new RemoteInterpreter(p, "note", MockInterpreterResourcePool.class.getName(), new File(INTERPRETER_SCRIPT).getAbsolutePath(), "fake", "fakeRepo", env, 10 * 1000, null, null, "anonymous", false);
    intpGroup1 = new InterpreterGroup("intpGroup1");
    intpGroup1.put("note", new LinkedList<Interpreter>());
    intpGroup1.get("note").add(intp1);
    intp1.setInterpreterGroup(intpGroup1);
    intp2 = new RemoteInterpreter(p, "note", MockInterpreterResourcePool.class.getName(), new File(INTERPRETER_SCRIPT).getAbsolutePath(), "fake", "fakeRepo", env, 10 * 1000, null, null, "anonymous", false);
    intpGroup2 = new InterpreterGroup("intpGroup2");
    intpGroup2.put("note", new LinkedList<Interpreter>());
    intpGroup2.get("note").add(intp2);
    intp2.setInterpreterGroup(intpGroup2);
    context = new InterpreterContext("note", "id", null, "title", "text", new AuthenticationInfo(), new HashMap<String, Object>(), new GUI(), null, null, new LinkedList<InterpreterContextRunner>(), null);
    intp1.open();
    intp2.open();
    eventPoller1 = new RemoteInterpreterEventPoller(null, null);
    eventPoller1.setInterpreterGroup(intpGroup1);
    eventPoller1.setInterpreterProcess(intpGroup1.getRemoteInterpreterProcess());
    eventPoller2 = new RemoteInterpreterEventPoller(null, null);
    eventPoller2.setInterpreterGroup(intpGroup2);
    eventPoller2.setInterpreterProcess(intpGroup2.getRemoteInterpreterProcess());
    eventPoller1.start();
    eventPoller2.start();
}
Also used : RemoteInterpreter(org.apache.zeppelin.interpreter.remote.RemoteInterpreter) HashMap(java.util.HashMap) RemoteInterpreterEventPoller(org.apache.zeppelin.interpreter.remote.RemoteInterpreterEventPoller) Properties(java.util.Properties) AuthenticationInfo(org.apache.zeppelin.user.AuthenticationInfo) LinkedList(java.util.LinkedList) RemoteInterpreter(org.apache.zeppelin.interpreter.remote.RemoteInterpreter) GUI(org.apache.zeppelin.display.GUI) File(java.io.File) Before(org.junit.Before)

Aggregations

File (java.io.File)1 HashMap (java.util.HashMap)1 LinkedList (java.util.LinkedList)1 Properties (java.util.Properties)1 GUI (org.apache.zeppelin.display.GUI)1 RemoteInterpreter (org.apache.zeppelin.interpreter.remote.RemoteInterpreter)1 RemoteInterpreterEventPoller (org.apache.zeppelin.interpreter.remote.RemoteInterpreterEventPoller)1 AuthenticationInfo (org.apache.zeppelin.user.AuthenticationInfo)1 Before (org.junit.Before)1