Search in sources :

Example 1 with DefaultJournalMaster

use of alluxio.master.journal.DefaultJournalMaster 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();
}
Also used : GrpcServerBuilder(alluxio.grpc.GrpcServerBuilder) DefaultJournalMaster(alluxio.master.journal.DefaultJournalMaster) DefaultJournalMaster(alluxio.master.journal.DefaultJournalMaster) GrpcService(alluxio.grpc.GrpcService) JournalMasterClientServiceHandler(alluxio.master.journal.JournalMasterClientServiceHandler)

Example 2 with DefaultJournalMaster

use of alluxio.master.journal.DefaultJournalMaster 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();
}
Also used : GrpcServerBuilder(alluxio.grpc.GrpcServerBuilder) DefaultJournalMaster(alluxio.master.journal.DefaultJournalMaster) GrpcService(alluxio.grpc.GrpcService) JournalMasterClientServiceHandler(alluxio.master.journal.JournalMasterClientServiceHandler)

Aggregations

GrpcServerBuilder (alluxio.grpc.GrpcServerBuilder)2 GrpcService (alluxio.grpc.GrpcService)2 DefaultJournalMaster (alluxio.master.journal.DefaultJournalMaster)2 JournalMasterClientServiceHandler (alluxio.master.journal.JournalMasterClientServiceHandler)2