Search in sources :

Example 11 with InterpreterRPCException

use of org.apache.zeppelin.interpreter.thrift.InterpreterRPCException in project zeppelin by apache.

the class RemoteInterpreterServer method init.

@Override
public void init(Map<String, String> properties) throws InterpreterRPCException, TException {
    this.zConf = ZeppelinConfiguration.create();
    for (Map.Entry<String, String> entry : properties.entrySet()) {
        this.zConf.setProperty(entry.getKey(), entry.getValue());
    }
    if (zConf.isClusterMode()) {
        clusterManagerClient = ClusterManagerClient.getInstance(zConf);
        clusterManagerClient.start(interpreterGroupId);
        // Cluster mode, discovering interpreter processes through metadata registration
        // TODO (Xun): Unified use of cluster metadata for process discovery of all operating modes
        // 1. Can optimize the startup logic of the process
        // 2. Can solve the problem that running the interpreter's IP in docker may be a virtual IP
        putClusterMeta();
    }
    try {
        lifecycleManager = createLifecycleManager();
        lifecycleManager.onInterpreterProcessStarted(interpreterGroupId);
    } catch (Exception e) {
        throw new InterpreterRPCException("Fail to create LifecycleManager, cause: " + e.toString());
    }
    if (!isTest) {
        int connectionPoolSize = this.zConf.getInt(ZeppelinConfiguration.ConfVars.ZEPPELIN_INTERPRETER_CONNECTION_POOL_SIZE);
        LOGGER.info("Creating RemoteInterpreterEventClient with connection pool size: {}", connectionPoolSize);
        intpEventClient = new RemoteInterpreterEventClient(intpEventServerHost, intpEventServerPort, connectionPoolSize);
    }
}
Also used : InterpreterRPCException(org.apache.zeppelin.interpreter.thrift.InterpreterRPCException) Map(java.util.Map) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) ConcurrentMap(java.util.concurrent.ConcurrentMap) TTransportException(org.apache.thrift.transport.TTransportException) InterpreterRPCException(org.apache.zeppelin.interpreter.thrift.InterpreterRPCException) InterpreterException(org.apache.zeppelin.interpreter.InterpreterException) ApplicationException(org.apache.zeppelin.helium.ApplicationException) TException(org.apache.thrift.TException) IOException(java.io.IOException)

Aggregations

InterpreterRPCException (org.apache.zeppelin.interpreter.thrift.InterpreterRPCException)11 IOException (java.io.IOException)9 InterpreterException (org.apache.zeppelin.interpreter.InterpreterException)9 TException (org.apache.thrift.TException)7 TTransportException (org.apache.thrift.transport.TTransportException)7 ApplicationException (org.apache.zeppelin.helium.ApplicationException)7 AngularObject (org.apache.zeppelin.display.AngularObject)5 AngularObjectRegistry (org.apache.zeppelin.display.AngularObjectRegistry)4 HeliumAppAngularObjectRegistry (org.apache.zeppelin.helium.HeliumAppAngularObjectRegistry)4 Interpreter (org.apache.zeppelin.interpreter.Interpreter)4 LazyOpenInterpreter (org.apache.zeppelin.interpreter.LazyOpenInterpreter)4 HashMap (java.util.HashMap)3 Map (java.util.Map)3 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)3 ConcurrentMap (java.util.concurrent.ConcurrentMap)3 InterpreterContext (org.apache.zeppelin.interpreter.InterpreterContext)2 RemoteAngularObject (org.apache.zeppelin.interpreter.remote.RemoteAngularObject)2 RemoteInterpreterContext (org.apache.zeppelin.interpreter.thrift.RemoteInterpreterContext)2 DistributedResourcePool (org.apache.zeppelin.resource.DistributedResourcePool)2 ByteBuffer (java.nio.ByteBuffer)1