use of org.apache.ignite.igfs.IgfsIpcEndpointType in project ignite by apache.
the class IgfsServer method createEndpoint.
/**
* Create server IPC endpoint.
*
* @param endpointCfg Endpoint configuration.
* @param mgmt Management flag.
* @return Server endpoint.
* @throws IgniteCheckedException If failed.
*/
private IpcServerEndpoint createEndpoint(IgfsIpcEndpointConfiguration endpointCfg, boolean mgmt) throws IgniteCheckedException {
A.notNull(endpointCfg, "endpointCfg");
IgfsIpcEndpointType typ = endpointCfg.getType();
if (typ == null)
throw new IgniteCheckedException("Failed to create server endpoint (type is not specified)");
switch(typ) {
case SHMEM:
{
IpcSharedMemoryServerEndpoint endpoint = new IpcSharedMemoryServerEndpoint(igfsCtx.kernalContext().config().getWorkDirectory());
endpoint.setPort(endpointCfg.getPort());
endpoint.setSize(endpointCfg.getMemorySize());
endpoint.setTokenDirectoryPath(endpointCfg.getTokenDirectoryPath());
return endpoint;
}
case TCP:
{
IpcServerTcpEndpoint endpoint = new IpcServerTcpEndpoint();
endpoint.setHost(endpointCfg.getHost());
endpoint.setPort(endpointCfg.getPort());
endpoint.setManagement(mgmt);
return endpoint;
}
default:
throw new IgniteCheckedException("Failed to create server endpoint (type is unknown): " + typ);
}
}
Aggregations