/** * Creates a new block master client pool. * * @param context the information required for connecting to Alluxio * @param masterInquireClient a client for determining the master address */ public BlockMasterClientPool(ClientContext context, MasterInquireClient masterInquireClient) { super(context.getConf().getInt(PropertyKey.USER_BLOCK_MASTER_CLIENT_THREADS)); mClientList = new ConcurrentLinkedQueue<>(); mMasterContext = MasterClientContext.newBuilder(context).setMasterInquireClient(masterInquireClient).build(); }
/** * Creates a new file system master client pool. * * @param context information for connecting to processes in the cluster * @param masterInquireClient a client for determining the master address */ public FileSystemMasterClientPool(ClientContext context, MasterInquireClient masterInquireClient) { super(context.getConf().getInt(PropertyKey.USER_FILE_MASTER_CLIENT_THREADS)); mClientList = new ConcurrentLinkedQueue<>(); mMasterContext = MasterClientContext.newBuilder(context) .setMasterInquireClient(masterInquireClient).build(); }
/** * @return a meta master client */ public synchronized MetaMasterClient getMetaMasterClient() { Preconditions.checkState(mState == State.STARTED, "must be in the started state to create a meta master client, but state was %s", mState); return new RetryHandlingMetaMasterClient(MasterClientContext .newBuilder(ClientContext.create(ServerConfiguration.global())) .setMasterInquireClient(getMasterInquireClient()) .build()); }
.setMasterInquireClient(mMasterInquireClient) .build()); mClientMasterSync = new ClientMasterSync(mMetricsMasterClient, mAppId);
/** * @return clients for communicating with the cluster */ public synchronized Clients getClients() { Preconditions.checkState(mState == State.STARTED, "must be in the started state to create a meta master client, but state was %s", mState); MasterClientContext config = MasterClientContext .newBuilder(ClientContext.create(ServerConfiguration.global())) .setMasterInquireClient(getMasterInquireClient()).build(); return new Clients(getFileSystemClient(), new RetryHandlingFileSystemMasterClient(config), new RetryHandlingMetaMasterClient(config), new RetryHandlingBlockMasterClient(config)); }