Search in sources :

Example 6 with GrpcService

use of alluxio.grpc.GrpcService in project alluxio by Alluxio.

the class DefaultBlockMaster method getServices.

@Override
public Map<ServiceType, GrpcService> getServices() {
    Map<ServiceType, GrpcService> services = new HashMap<>();
    services.put(ServiceType.BLOCK_MASTER_CLIENT_SERVICE, new GrpcService(new BlockMasterClientServiceHandler(this)));
    services.put(ServiceType.BLOCK_MASTER_WORKER_SERVICE, new GrpcService(new BlockMasterWorkerServiceHandler(this)));
    return services;
}
Also used : GrpcService(alluxio.grpc.GrpcService) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) ServiceType(alluxio.grpc.ServiceType)

Example 7 with GrpcService

use of alluxio.grpc.GrpcService in project alluxio by Alluxio.

the class DefaultMetaMaster method getServices.

@Override
public Map<ServiceType, GrpcService> getServices() {
    Map<ServiceType, GrpcService> services = new HashMap<>();
    services.put(ServiceType.META_MASTER_CONFIG_SERVICE, new GrpcService(new MetaMasterConfigurationServiceHandler(this)).disableAuthentication());
    services.put(ServiceType.META_MASTER_CLIENT_SERVICE, new GrpcService(new MetaMasterClientServiceHandler(this)));
    services.put(ServiceType.META_MASTER_MASTER_SERVICE, new GrpcService(new MetaMasterMasterServiceHandler(this)));
    // Add backup role services.
    services.putAll(mBackupRole.getRoleServices());
    services.putAll(mJournalSystem.getJournalServices());
    return services;
}
Also used : GrpcService(alluxio.grpc.GrpcService) HashMap(java.util.HashMap) ServiceType(alluxio.grpc.ServiceType)

Example 8 with GrpcService

use of alluxio.grpc.GrpcService in project alluxio by Alluxio.

the class DefaultTableMaster method getServices.

@Override
public Map<ServiceType, GrpcService> getServices() {
    Map<ServiceType, GrpcService> services = new HashMap<>();
    services.put(ServiceType.TABLE_MASTER_CLIENT_SERVICE, new GrpcService(new TableMasterClientServiceHandler(this)));
    return services;
}
Also used : GrpcService(alluxio.grpc.GrpcService) HashMap(java.util.HashMap) ServiceType(alluxio.grpc.ServiceType)

Example 9 with GrpcService

use of alluxio.grpc.GrpcService in project alluxio by Alluxio.

the class AlluxioJobWorkerProcess method startServingRPCServer.

private void startServingRPCServer() {
    try {
        if (mBindSocket != null) {
            // Socket opened for auto bind.
            // Close it.
            mBindSocket.close();
        }
        LOG.info("Starting gRPC server on address {}", mRpcConnectAddress);
        GrpcServerBuilder serverBuilder = GrpcServerBuilder.forAddress(GrpcServerAddress.create(mRpcConnectAddress.getHostName(), mRpcBindAddress), ServerConfiguration.global(), ServerUserState.global());
        for (Map.Entry<alluxio.grpc.ServiceType, GrpcService> serviceEntry : mJobWorker.getServices().entrySet()) {
            LOG.info("Registered service:{}", serviceEntry.getKey().name());
            serverBuilder.addService(serviceEntry.getValue());
        }
        mGrpcServer = serverBuilder.build().start();
        LOG.info("Started gRPC server on address {}", mRpcConnectAddress);
        // Wait until the server is shut down.
        mGrpcServer.awaitTermination();
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
Also used : GrpcServerBuilder(alluxio.grpc.GrpcServerBuilder) GrpcService(alluxio.grpc.GrpcService) ServiceType(alluxio.util.network.NetworkAddressUtils.ServiceType) IOException(java.io.IOException) Map(java.util.Map)

Example 10 with GrpcService

use of alluxio.grpc.GrpcService in project alluxio by Alluxio.

the class JobMaster method getServices.

@Override
public Map<ServiceType, GrpcService> getServices() {
    Map<ServiceType, GrpcService> services = Maps.newHashMap();
    services.put(ServiceType.JOB_MASTER_CLIENT_SERVICE, new GrpcService(new JobMasterClientServiceHandler(this)));
    services.put(ServiceType.JOB_MASTER_WORKER_SERVICE, new GrpcService(new JobMasterWorkerServiceHandler(this)));
    return services;
}
Also used : GrpcService(alluxio.grpc.GrpcService) 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