use of org.apache.hyracks.ipc.impl.JavaSerializationBasedPayloadSerializerDeserializer in project asterixdb by apache.
the class ClusterControllerService method start.
@Override
public void start() throws Exception {
LOGGER.log(Level.INFO, "Starting ClusterControllerService: " + this);
serverCtx = new ServerContext(ServerContext.ServerType.CLUSTER_CONTROLLER, new File(ccConfig.getRootDir()));
IIPCI ccIPCI = new ClusterControllerIPCI(this);
clusterIPC = new IPCSystem(new InetSocketAddress(ccConfig.getClusterListenPort()), ccIPCI, new CCNCFunctions.SerializerDeserializer());
IIPCI ciIPCI = new ClientInterfaceIPCI(this);
clientIPC = new IPCSystem(new InetSocketAddress(ccConfig.getClientListenAddress(), ccConfig.getClientListenPort()), ciIPCI, new JavaSerializationBasedPayloadSerializerDeserializer());
webServer = new WebServer(this, ccConfig.getConsoleListenPort());
clusterIPC.start();
clientIPC.start();
webServer.start();
info = new ClusterControllerInfo(ccConfig.getClientListenAddress(), ccConfig.getClientListenPort(), webServer.getListeningPort());
timer.schedule(sweeper, 0, ccConfig.getHeartbeatPeriod());
jobLog.open();
startApplication();
datasetDirectoryService.init(executor);
workQueue.start();
connectNCs();
LOGGER.log(Level.INFO, "Started ClusterControllerService");
notifyApplication();
}
use of org.apache.hyracks.ipc.impl.JavaSerializationBasedPayloadSerializerDeserializer in project asterixdb by apache.
the class IPCTest method createServerIPCSystem.
private IPCSystem createServerIPCSystem() throws IOException {
final Executor executor = Executors.newCachedThreadPool();
IIPCI ipci = new IIPCI() {
@Override
public void deliverIncomingMessage(final IIPCHandle handle, final long mid, long rmid, final Object payload, Exception exception) {
executor.execute(new Runnable() {
@Override
public void run() {
Object result = null;
Exception exception = null;
try {
Integer i = (Integer) payload;
result = i.intValue() * 2;
} catch (Exception e) {
exception = e;
}
try {
handle.send(mid, result, exception);
} catch (IPCException e) {
e.printStackTrace();
}
}
});
}
};
return new IPCSystem(new InetSocketAddress("127.0.0.1", 0), ipci, new JavaSerializationBasedPayloadSerializerDeserializer());
}
Aggregations