use of alluxio.grpc.ServiceType 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;
}
use of alluxio.grpc.ServiceType 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;
}
use of alluxio.grpc.ServiceType in project alluxio by Alluxio.
the class MasterHealthCheckClient method isServing.
@Override
public boolean isServing() {
try {
ServiceType rpcService;
InetSocketAddress connectAddr;
switch(mAlluxioMasterType) {
case MASTER:
rpcService = ServiceType.FILE_SYSTEM_MASTER_CLIENT_SERVICE;
connectAddr = NetworkAddressUtils.getConnectAddress(NetworkAddressUtils.ServiceType.MASTER_RPC, mConf);
break;
case JOB_MASTER:
rpcService = ServiceType.JOB_MASTER_CLIENT_SERVICE;
connectAddr = NetworkAddressUtils.getConnectAddress(NetworkAddressUtils.ServiceType.JOB_MASTER_RPC, mConf);
break;
default:
throw new IllegalArgumentException(String.format("Master type %s is invalid", mAlluxioMasterType));
}
MasterServingHealthCheck masterRpcCheck = new MasterServingHealthCheck(connectAddr, rpcService, mPolicySupplier, mConf);
Future<?> masterServingFuture = mExecutorService.submit(masterRpcCheck);
if (mProcessCheck) {
Future<?> processCheckFuture = mExecutorService.submit(new ProcessCheckRunnable(mAlluxioMasterType.getClassName()));
CommonUtils.sleepMs(Constants.SECOND_MS);
// If in HA mode, can't check the RPC service, because the service may not have started
if (!ConfigurationUtils.isHaMode(mConf)) {
while (!masterServingFuture.isDone()) {
if (processCheckFuture.isDone()) {
throw new IllegalStateException("One or more master processes are not running");
}
CommonUtils.sleepMs(Constants.SECOND_MS);
}
}
// Check after a 7 second period if the process is is still alive
CommonUtils.sleepMs(7L * Constants.SECOND_MS);
LOG.debug("Checking the master processes one more time...");
return !processCheckFuture.isDone();
} else {
masterServingFuture.get();
return masterRpcCheck.serving();
}
} catch (Exception e) {
LOG.error("Exception thrown in master health check client", e);
} finally {
mExecutorService.shutdown();
}
return false;
}
use of alluxio.grpc.ServiceType 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;
}
use of alluxio.grpc.ServiceType 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;
}
Aggregations