use of alluxio.master.journal.JournalMasterClientServiceHandler 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.master.journal.JournalMasterClientServiceHandler 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();
}
Aggregations