use of alluxio.grpc.GrpcService in project alluxio by Alluxio.
the class DefaultFileSystemMaster method getServices.
@Override
public Map<ServiceType, GrpcService> getServices() {
Map<ServiceType, GrpcService> services = new HashMap<>();
services.put(ServiceType.FILE_SYSTEM_MASTER_CLIENT_SERVICE, new GrpcService(ServerInterceptors.intercept(new FileSystemMasterClientServiceHandler(this), new ClientIpAddressInjector())));
services.put(ServiceType.FILE_SYSTEM_MASTER_JOB_SERVICE, new GrpcService(new FileSystemMasterJobServiceHandler(this)));
services.put(ServiceType.FILE_SYSTEM_MASTER_WORKER_SERVICE, new GrpcService(new FileSystemMasterWorkerServiceHandler(this)));
return services;
}
use of alluxio.grpc.GrpcService in project alluxio by Alluxio.
the class AlluxioMasterProcess method createRPCServer.
private GrpcServer createRPCServer() {
// Create an executor for Master RPC server.
mRPCExecutor = ExecutorServiceBuilder.buildExecutorService(ExecutorServiceBuilder.RpcExecutorHost.MASTER);
MetricsSystem.registerGaugeIfAbsent(MetricKey.MASTER_RPC_QUEUE_LENGTH.getName(), mRPCExecutor::getRpcQueueLength);
// Create underlying gRPC server.
GrpcServerBuilder builder = GrpcServerBuilder.forAddress(GrpcServerAddress.create(mRpcConnectAddress.getHostName(), mRpcBindAddress), ServerConfiguration.global(), ServerUserState.global()).executor(mRPCExecutor).flowControlWindow((int) ServerConfiguration.getBytes(PropertyKey.MASTER_NETWORK_FLOWCONTROL_WINDOW)).keepAliveTime(ServerConfiguration.getMs(PropertyKey.MASTER_NETWORK_KEEPALIVE_TIME_MS), TimeUnit.MILLISECONDS).keepAliveTimeout(ServerConfiguration.getMs(PropertyKey.MASTER_NETWORK_KEEPALIVE_TIMEOUT_MS), TimeUnit.MILLISECONDS).permitKeepAlive(ServerConfiguration.getMs(PropertyKey.MASTER_NETWORK_PERMIT_KEEPALIVE_TIME_MS), TimeUnit.MILLISECONDS).maxInboundMessageSize((int) ServerConfiguration.getBytes(PropertyKey.MASTER_NETWORK_MAX_INBOUND_MESSAGE_SIZE));
// Bind manifests of each Alluxio master to RPC server.
for (Master master : mRegistry.getServers()) {
registerServices(builder, master.getServices());
}
// Bind manifest of Alluxio JournalMaster service.
// TODO(ggezer) Merge this with registerServices() logic.
builder.addService(alluxio.grpc.ServiceType.JOURNAL_MASTER_CLIENT_SERVICE, new GrpcService(new JournalMasterClientServiceHandler(new DefaultJournalMaster(JournalDomain.MASTER, mJournalSystem))));
// Builds a server that is not started yet.
return builder.build();
}
use of alluxio.grpc.GrpcService in project alluxio by Alluxio.
the class DefaultMetricsMaster method getServices.
@Override
public Map<ServiceType, GrpcService> getServices() {
Map<ServiceType, GrpcService> services = new HashMap<>();
services.put(ServiceType.METRICS_MASTER_CLIENT_SERVICE, new GrpcService(getMasterServiceHandler()));
return services;
}
use of alluxio.grpc.GrpcService in project alluxio by Alluxio.
the class AlluxioJobMasterProcess method createRPCServer.
private GrpcServer createRPCServer() {
// Create underlying gRPC server.
GrpcServerBuilder builder = GrpcServerBuilder.forAddress(GrpcServerAddress.create(mRpcConnectAddress.getHostName(), mRpcBindAddress), ServerConfiguration.global(), ServerUserState.global()).flowControlWindow((int) ServerConfiguration.getBytes(PropertyKey.JOB_MASTER_NETWORK_FLOWCONTROL_WINDOW)).keepAliveTime(ServerConfiguration.getMs(PropertyKey.JOB_MASTER_NETWORK_KEEPALIVE_TIME_MS), TimeUnit.MILLISECONDS).keepAliveTimeout(ServerConfiguration.getMs(PropertyKey.JOB_MASTER_NETWORK_KEEPALIVE_TIMEOUT_MS), TimeUnit.MILLISECONDS).permitKeepAlive(ServerConfiguration.getMs(PropertyKey.JOB_MASTER_NETWORK_PERMIT_KEEPALIVE_TIME_MS), TimeUnit.MILLISECONDS).maxInboundMessageSize((int) ServerConfiguration.getBytes(PropertyKey.JOB_MASTER_NETWORK_MAX_INBOUND_MESSAGE_SIZE));
// Register job-master services.
registerServices(builder, mJobMaster.getServices());
// Bind manifest of Alluxio JournalMaster service.
// TODO(ggezer) Merge this with registerServices() logic.
builder.addService(alluxio.grpc.ServiceType.JOURNAL_MASTER_CLIENT_SERVICE, new GrpcService(new JournalMasterClientServiceHandler(new DefaultJournalMaster(JournalDomain.JOB_MASTER, mJournalSystem))));
// Builds a server that is not started yet.
return builder.build();
}
use of alluxio.grpc.GrpcService in project alluxio by Alluxio.
the class RaftJournalSystem method getJournalServices.
@Override
public synchronized Map<ServiceType, GrpcService> getJournalServices() {
Map<ServiceType, GrpcService> services = new HashMap<>();
services.put(ServiceType.RAFT_JOURNAL_SERVICE, new GrpcService(new RaftJournalServiceHandler(mStateMachine.getSnapshotReplicationManager())));
return services;
}
Aggregations