Search in sources :

Example 1 with DetectPrestoRequest

use of alluxio.hub.proto.DetectPrestoRequest in project alluxio by Alluxio.

the class ManagerProcessContext method startDetectPrestoListener.

/**
 * Starts a request stream observer for {@link HostedManagerServiceGrpc} DetectPresto RPC calls.
 */
public void startDetectPrestoListener() {
    HostedManagerServiceGrpc.HostedManagerServiceStub asyncStub = getHostedAsyncStub();
    RequestStreamObserver requestObserver = new RequestStreamObserver<DetectPrestoRequest, DetectPrestoResponse>() {

        @Override
        public DetectPrestoResponse exec(DetectPrestoRequest req) {
            return DetectPrestoResponse.newBuilder().setHubMetadata(mHubMetadata).setPayload(detectPresto(req)).build();
        }

        @Override
        public void restart() {
            startDetectPrestoListener();
        }

        @Override
        public void handleError(String message, Throwable t) {
            handleStatusRuntimeException(message, t);
        }
    };
    StreamObserver<DetectPrestoResponse> responseObserver = asyncStub.detectPresto(requestObserver);
    requestObserver.start(responseObserver, DetectPrestoResponse.newBuilder().setHubMetadata(mHubMetadata).build());
    LOG.info("Started DetectPresto async listener", asyncStub);
}
Also used : DetectPrestoRequest(alluxio.hub.proto.DetectPrestoRequest) AgentDetectPrestoRequest(alluxio.hub.proto.AgentDetectPrestoRequest) RequestStreamObserver(alluxio.hub.manager.rpc.observer.RequestStreamObserver) DetectPrestoResponse(alluxio.hub.proto.DetectPrestoResponse) AgentDetectPrestoResponse(alluxio.hub.proto.AgentDetectPrestoResponse) HostedManagerServiceGrpc(alluxio.hub.proto.HostedManagerServiceGrpc) ByteString(com.google.protobuf.ByteString)

Example 2 with DetectPrestoRequest

use of alluxio.hub.proto.DetectPrestoRequest in project alluxio by Alluxio.

the class ManagerProcessContext method detectPresto.

private DetectPrestoResponse.Payload detectPresto(DetectPrestoRequest request) {
    AgentDetectPrestoRequest detectRequest = AgentDetectPrestoRequest.newBuilder().setConfDir(request.getPayload().getConfDir()).build();
    boolean workers = execOnHub(client -> client.detectPresto(detectRequest), AlluxioNodeType.WORKER).values().stream().map(AgentDetectPrestoResponse::getDetected).reduce(Boolean::logicalAnd).orElse(false);
    boolean result = workers && execOnHub(client -> client.detectPresto(detectRequest), AlluxioNodeType.MASTER).values().stream().map(AgentDetectPrestoResponse::getDetected).reduce(Boolean::logicalAnd).orElse(false);
    return DetectPrestoResponse.Payload.newBuilder().setDetected(result).build();
}
Also used : AgentDetectPrestoRequest(alluxio.hub.proto.AgentDetectPrestoRequest) RemoveFile(alluxio.hub.proto.RemoveFile) PropertyKey(alluxio.conf.PropertyKey) UploadFile(alluxio.hub.proto.UploadFile) IOTaskSummary(alluxio.stress.worker.IOTaskSummary) FileSystem(alluxio.client.file.FileSystem) SpeedTestRequest(alluxio.hub.proto.SpeedTestRequest) AgentFileUploadResponse(alluxio.hub.proto.AgentFileUploadResponse) Duration(java.time.Duration) Map(java.util.Map) Status(io.grpc.Status) CLUSTER_DEFAULT(alluxio.conf.Source.CLUSTER_DEFAULT) AgentWriteConfigurationSetRequest(alluxio.hub.proto.AgentWriteConfigurationSetRequest) ValidationUtils(alluxio.cli.ValidationUtils) AgentProcessStatusChangeResponse(alluxio.hub.proto.AgentProcessStatusChangeResponse) RpcClient(alluxio.hub.common.RpcClient) Set(java.util.Set) AlluxioException(alluxio.exception.AlluxioException) AgentHeartbeatRequest(alluxio.hub.proto.AgentHeartbeatRequest) ThreadSafe(javax.annotation.concurrent.ThreadSafe) GetPrestoConfDirResponse(alluxio.hub.proto.GetPrestoConfDirResponse) AlluxioProperties(alluxio.conf.AlluxioProperties) StandardCharsets(java.nio.charset.StandardCharsets) Executors(java.util.concurrent.Executors) AgentGetConfigurationSetRequest(alluxio.hub.proto.AgentGetConfigurationSetRequest) Config(io.fabric8.kubernetes.client.Config) Source(alluxio.conf.Source) InstancedConfiguration(alluxio.conf.InstancedConfiguration) AgentFileUploadRequest(alluxio.hub.proto.AgentFileUploadRequest) RuntimeConstants(alluxio.RuntimeConstants) AgentShutdownRequest(alluxio.hub.proto.AgentShutdownRequest) DetectPrestoResponse(alluxio.hub.proto.DetectPrestoResponse) RemoveFileRequest(alluxio.hub.proto.RemoveFileRequest) ProcessStatusChangeResponse(alluxio.hub.proto.ProcessStatusChangeResponse) ArrayList(java.util.ArrayList) UfsIOBench(alluxio.stress.cli.UfsIOBench) AlluxioClusterHeartbeatResponse(alluxio.hub.proto.AlluxioClusterHeartbeatResponse) AlluxioURI(alluxio.AlluxioURI) HubNodeAddress(alluxio.hub.proto.HubNodeAddress) ListMountPointResponse(alluxio.hub.proto.ListMountPointResponse) RequestStreamObserver(alluxio.hub.manager.rpc.observer.RequestStreamObserver) UfsIOParameters(alluxio.stress.worker.UfsIOParameters) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) AlluxioConfiguration(alluxio.conf.AlluxioConfiguration) MountPOptions(alluxio.grpc.MountPOptions) HubAuthenticationInterceptor(alluxio.hub.manager.rpc.interceptor.HubAuthenticationInterceptor) RetryPolicy(alluxio.retry.RetryPolicy) Nullable(javax.annotation.Nullable) ListFile(alluxio.hub.proto.ListFile) Properties(java.util.Properties) AgentDetectPrestoResponse(alluxio.hub.proto.AgentDetectPrestoResponse) PingManagerRequest(alluxio.hub.proto.PingManagerRequest) IOException(java.io.IOException) AgentWriteConfigurationSetResponse(alluxio.hub.proto.AgentWriteConfigurationSetResponse) DeleteMountPointResponse(alluxio.hub.proto.DeleteMountPointResponse) AlluxioClusterHeartbeatRequest(alluxio.hub.proto.AlluxioClusterHeartbeatRequest) ConfigMap(io.fabric8.kubernetes.api.model.ConfigMap) ConfigMapBuilder(io.fabric8.kubernetes.api.model.ConfigMapBuilder) ApplyMountPointResponse(alluxio.hub.proto.ApplyMountPointResponse) Lock(java.util.concurrent.locks.Lock) HubAuthentication(alluxio.hub.proto.HubAuthentication) AgentSetPrestoConfRequest(alluxio.hub.proto.AgentSetPrestoConfRequest) PingManagerResponse(alluxio.hub.proto.PingManagerResponse) Preconditions(com.google.common.base.Preconditions) UploadFileResponse(alluxio.hub.proto.UploadFileResponse) AgentListFileRequest(alluxio.hub.proto.AgentListFileRequest) HubUtil(alluxio.hub.common.HubUtil) DetectPrestoRequest(alluxio.hub.proto.DetectPrestoRequest) AgentSetPrestoConfResponse(alluxio.hub.proto.AgentSetPrestoConfResponse) AlluxioCluster(alluxio.hub.manager.util.AlluxioCluster) AgentShutdownResponse(alluxio.hub.proto.AgentShutdownResponse) ListCatalogRequest(alluxio.hub.proto.ListCatalogRequest) JsonSerializable(alluxio.util.JsonSerializable) AlluxioConfigurationSet(alluxio.hub.proto.AlluxioConfigurationSet) LoggerFactory(org.slf4j.LoggerFactory) SpeedTestResponse(alluxio.hub.proto.SpeedTestResponse) Channel(io.grpc.Channel) GetConfigurationSetResponse(alluxio.hub.proto.GetConfigurationSetResponse) RegisterManagerResponse(alluxio.hub.proto.RegisterManagerResponse) LogUtils(alluxio.util.LogUtils) AgentRemoveFileResponse(alluxio.hub.proto.AgentRemoveFileResponse) HostedManagerServiceGrpc(alluxio.hub.proto.HostedManagerServiceGrpc) InvalidPathException(alluxio.exception.InvalidPathException) StreamObserver(io.grpc.stub.StreamObserver) DeleteMountPointRequest(alluxio.hub.proto.DeleteMountPointRequest) ByteArrayInputStream(java.io.ByteArrayInputStream) GrpcChannel(alluxio.grpc.GrpcChannel) AgentDetectPrestoRequest(alluxio.hub.proto.AgentDetectPrestoRequest) DefaultKubernetesClient(io.fabric8.kubernetes.client.DefaultKubernetesClient) RegisterManagerRequest(alluxio.hub.proto.RegisterManagerRequest) HubCluster(alluxio.hub.manager.util.HubCluster) ServerConfiguration(alluxio.conf.ServerConfiguration) ImmutableMap(com.google.common.collect.ImmutableMap) ExponentialTimeBoundedRetry(alluxio.retry.ExponentialTimeBoundedRetry) ScheduledThreadPoolExecutor(java.util.concurrent.ScheduledThreadPoolExecutor) InetSocketAddress(java.net.InetSocketAddress) Collectors(java.util.stream.Collectors) GetConfigurationSetRequest(alluxio.hub.proto.GetConfigurationSetRequest) SetPrestoConfDirRequest(alluxio.hub.proto.SetPrestoConfDirRequest) ByteString(com.google.protobuf.ByteString) Base64(java.util.Base64) List(java.util.List) SetPrestoConfDirResponse(alluxio.hub.proto.SetPrestoConfDirResponse) HubMetadata(alluxio.hub.proto.HubMetadata) FileDoesNotExistException(alluxio.exception.FileDoesNotExistException) ListCatalogResponse(alluxio.hub.proto.ListCatalogResponse) RemoveFileResponse(alluxio.hub.proto.RemoveFileResponse) Pattern(java.util.regex.Pattern) AgentListCatalogRequest(alluxio.hub.proto.AgentListCatalogRequest) ExponentialBackoffRetry(alluxio.retry.ExponentialBackoffRetry) MountPointInfo(alluxio.wire.MountPointInfo) HashMap(java.util.HashMap) NetworkAddressUtils(alluxio.util.network.NetworkAddressUtils) AgentManagerServiceGrpc(alluxio.hub.proto.AgentManagerServiceGrpc) ListFileResponse(alluxio.hub.proto.ListFileResponse) Function(java.util.function.Function) SpeedStat(alluxio.hub.proto.SpeedStat) WriteConfigurationSetResponse(alluxio.hub.proto.WriteConfigurationSetResponse) ExecutionType(alluxio.hub.proto.ExecutionType) AlluxioNodeType(alluxio.hub.proto.AlluxioNodeType) PrestoCatalogListingResult(alluxio.hub.proto.PrestoCatalogListingResult) PathUtils(alluxio.util.io.PathUtils) ImmutableList(com.google.common.collect.ImmutableList) HDFSMountPointInfo(alluxio.hub.proto.HDFSMountPointInfo) AlluxioStatusException(alluxio.exception.status.AlluxioStatusException) AlluxioEdition(alluxio.hub.proto.AlluxioEdition) ExecutorService(java.util.concurrent.ExecutorService) RegisterAgentRequest(alluxio.hub.proto.RegisterAgentRequest) Logger(org.slf4j.Logger) Iterator(java.util.Iterator) ReentrantLock(java.util.concurrent.locks.ReentrantLock) AgentRemoveFileRequest(alluxio.hub.proto.AgentRemoveFileRequest) ApplyMountPointRequest(alluxio.hub.proto.ApplyMountPointRequest) GetPrestoConfDirRequest(alluxio.hub.proto.GetPrestoConfDirRequest) ThreadFactoryUtils(alluxio.util.ThreadFactoryUtils) Pair(alluxio.collections.Pair) UploadFileRequest(alluxio.hub.proto.UploadFileRequest) HubStatus(alluxio.hub.proto.HubStatus) ConfigurationUtils(alluxio.util.ConfigurationUtils) HubSslContextProvider(alluxio.hub.common.HubSslContextProvider) ProcessStatusChangeRequest(alluxio.hub.proto.ProcessStatusChangeRequest) WriteConfigurationSetRequest(alluxio.hub.proto.WriteConfigurationSetRequest) FileSystemContext(alluxio.client.file.FileSystemContext) ListFileRequest(alluxio.hub.proto.ListFileRequest) KubernetesClient(io.fabric8.kubernetes.client.KubernetesClient) VisibleForTesting(com.google.common.annotations.VisibleForTesting) ConfigBuilder(io.fabric8.kubernetes.client.ConfigBuilder) ListMountPointRequest(alluxio.hub.proto.ListMountPointRequest) Collections(java.util.Collections) SpeedTestParameter(alluxio.hub.proto.SpeedTestParameter) AgentDetectPrestoResponse(alluxio.hub.proto.AgentDetectPrestoResponse)

Aggregations

RequestStreamObserver (alluxio.hub.manager.rpc.observer.RequestStreamObserver)2 AgentDetectPrestoRequest (alluxio.hub.proto.AgentDetectPrestoRequest)2 AgentDetectPrestoResponse (alluxio.hub.proto.AgentDetectPrestoResponse)2 DetectPrestoRequest (alluxio.hub.proto.DetectPrestoRequest)2 DetectPrestoResponse (alluxio.hub.proto.DetectPrestoResponse)2 HostedManagerServiceGrpc (alluxio.hub.proto.HostedManagerServiceGrpc)2 ByteString (com.google.protobuf.ByteString)2 AlluxioURI (alluxio.AlluxioURI)1 RuntimeConstants (alluxio.RuntimeConstants)1 ValidationUtils (alluxio.cli.ValidationUtils)1 FileSystem (alluxio.client.file.FileSystem)1 FileSystemContext (alluxio.client.file.FileSystemContext)1 Pair (alluxio.collections.Pair)1 AlluxioConfiguration (alluxio.conf.AlluxioConfiguration)1 AlluxioProperties (alluxio.conf.AlluxioProperties)1 InstancedConfiguration (alluxio.conf.InstancedConfiguration)1 PropertyKey (alluxio.conf.PropertyKey)1 ServerConfiguration (alluxio.conf.ServerConfiguration)1 Source (alluxio.conf.Source)1 CLUSTER_DEFAULT (alluxio.conf.Source.CLUSTER_DEFAULT)1