Search in sources :

Example 6 with ServiceType

use of alluxio.grpc.ServiceType 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 7 with ServiceType

use of alluxio.grpc.ServiceType 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 8 with ServiceType

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

the class PollingMasterInquireClient method pingMetaService.

private void pingMetaService(InetSocketAddress address) throws AlluxioStatusException {
    // disable authentication in the channel since version service does not require authentication
    GrpcChannel channel = GrpcChannelBuilder.newBuilder(GrpcServerAddress.create(address), mConfiguration).setSubject(mUserState.getSubject()).setClientType("MasterInquireClient").disableAuthentication().build();
    ServiceVersionClientServiceGrpc.ServiceVersionClientServiceBlockingStub versionClient = ServiceVersionClientServiceGrpc.newBlockingStub(channel).withDeadlineAfter(mConfiguration.getMs(PropertyKey.USER_MASTER_POLLING_TIMEOUT), TimeUnit.MILLISECONDS);
    List<InetSocketAddress> addresses = ConfigurationUtils.getJobMasterRpcAddresses(mConfiguration);
    ServiceType serviceType = addresses.contains(address) ? ServiceType.JOB_MASTER_CLIENT_SERVICE : ServiceType.META_MASTER_CLIENT_SERVICE;
    try {
        versionClient.getServiceVersion(GetServiceVersionPRequest.newBuilder().setServiceType(serviceType).build());
    } catch (StatusRuntimeException e) {
        throw AlluxioStatusException.fromThrowable(e);
    } finally {
        channel.shutdown();
    }
}
Also used : ServiceVersionClientServiceGrpc(alluxio.grpc.ServiceVersionClientServiceGrpc) InetSocketAddress(java.net.InetSocketAddress) ServiceType(alluxio.grpc.ServiceType) StatusRuntimeException(io.grpc.StatusRuntimeException) GrpcChannel(alluxio.grpc.GrpcChannel)

Example 9 with ServiceType

use of alluxio.grpc.ServiceType 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

ServiceType (alluxio.grpc.ServiceType)9 GrpcService (alluxio.grpc.GrpcService)7 HashMap (java.util.HashMap)6 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)3 InetSocketAddress (java.net.InetSocketAddress)2 GrpcChannel (alluxio.grpc.GrpcChannel)1 ServiceVersionClientServiceGrpc (alluxio.grpc.ServiceVersionClientServiceGrpc)1 ClientIpAddressInjector (alluxio.security.authentication.ClientIpAddressInjector)1 StatusRuntimeException (io.grpc.StatusRuntimeException)1