Search in sources :

Example 1 with GrpcService

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;
}
Also used : GrpcService(alluxio.grpc.GrpcService) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) ServiceType(alluxio.grpc.ServiceType) ClientIpAddressInjector(alluxio.security.authentication.ClientIpAddressInjector)

Example 2 with GrpcService

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();
}
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 3 with GrpcService

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;
}
Also used : GrpcService(alluxio.grpc.GrpcService) HashMap(java.util.HashMap) ServiceType(alluxio.grpc.ServiceType)

Example 4 with GrpcService

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

Example 5 with GrpcService

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;
}
Also used : GrpcService(alluxio.grpc.GrpcService) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) ServiceType(alluxio.grpc.ServiceType)

Aggregations

GrpcService (alluxio.grpc.GrpcService)10 ServiceType (alluxio.grpc.ServiceType)7 HashMap (java.util.HashMap)6 GrpcServerBuilder (alluxio.grpc.GrpcServerBuilder)3 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)3 DefaultJournalMaster (alluxio.master.journal.DefaultJournalMaster)2 JournalMasterClientServiceHandler (alluxio.master.journal.JournalMasterClientServiceHandler)2 ClientIpAddressInjector (alluxio.security.authentication.ClientIpAddressInjector)1 ServiceType (alluxio.util.network.NetworkAddressUtils.ServiceType)1 IOException (java.io.IOException)1 Map (java.util.Map)1