use of alluxio.hub.proto.RegisterManagerResponse in project alluxio by Alluxio.
the class ManagerProcessContext method connectToHub.
private void connectToHub(alluxio.hub.proto.AlluxioCluster cluster) throws Exception {
// initialize manager with Hub before setting up bi-di connections
LOG.info("Connecting to Hub...");
// Max time ~(retry time) in seconds
long retryTimeMs = mConf.getMs(PropertyKey.HUB_MANAGER_REGISTER_RETRY_TIME);
RetryPolicy retry = new ExponentialBackoffRetry(50, 1000, (int) (retryTimeMs / 1000));
while (retry.attempt()) {
try {
RegisterManagerResponse response = mHostedClient.get().registerManager(RegisterManagerRequest.newBuilder().setHubMetadata(mHubMetadata).setPayload(RegisterManagerRequest.Payload.newBuilder().setAlluxioCluster(cluster)).build());
Preconditions.checkArgument(response.getPayload().getStatus().equals(HubStatus.MANAGER_START_CONNECTION), "Missing status in registerManager response");
} catch (Throwable t) {
handleStatusRuntimeException("Failed trying to register manager with Hosted Hub", t);
continue;
}
startPingManagerListener();
startProcessStatusChangeListener();
startGetConfigurationSetListener();
startWriteConfigurationSetListener();
startUploadFileListener();
startListFileListener();
startRemoveFileListener();
startDetectPrestoListener();
startListCatalogListener();
startSetPrestoConfDirListener();
startGetPrestoConfDirListener();
startListMountPointsListener();
startApplyMountPointListener();
startDeleteMountPointListener();
startSpeedTestListener();
LOG.info("Connected to Hub.");
return;
}
throw new Exception(String.format("Failed to connect to Hub after %s attempts", retry.getAttemptCount()));
}
Aggregations