/** * @return an instance of {@link MasterClientContext} */ public MasterClientContext build() { if (mMasterInquireClient == null) { mMasterInquireClient = MasterInquireClient.Factory.create(mContext.getConf()); } return new MasterClientContext(mContext, mMasterInquireClient); } }
/** * Creates a new master client base. * * @param clientConf master client configuration * @param address address to connect to * @param retryPolicySupplier retry policy to use */ public AbstractMasterClient(MasterClientContext clientConf, InetSocketAddress address, Supplier<RetryPolicy> retryPolicySupplier) { super(clientConf, address, retryPolicySupplier); mMasterInquireClient = clientConf.getMasterInquireClient(); }
/** * 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 block master client pool. */ public BlockMasterClientPool() { super(ServerConfiguration.getInt(PropertyKey.WORKER_BLOCK_MASTER_CLIENT_POOL_SIZE)); mClientList = new ConcurrentLinkedQueue<>(); mMasterContext = MasterClientContext .newBuilder(ClientContext.create(ServerConfiguration.global())).build(); }
/** * Constructs an instance of {@link WorkerUfsManager}. */ public WorkerUfsManager() { mMasterClient = mCloser.register(new FileSystemMasterClient(MasterClientContext .newBuilder(ClientContext.create(ServerConfiguration.global())).build())); }
/** * Creates a new master client base. * * @param clientConf master client configuration */ public AbstractMasterClient(MasterClientContext clientConf) { super(clientConf, null); mMasterInquireClient = clientConf.getMasterInquireClient(); }
/** * Constructs an instance of {@link JobUfsManager}. */ public JobUfsManager() { mMasterClient = mCloser.register(new FileSystemMasterClient(MasterClientContext .newBuilder(ClientContext.create(ServerConfiguration.global())).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(); }
ClientContext ctx = ClientContext.create(sConf); try (final BlockMasterClient client = BlockMasterClient.Factory.create(MasterClientContext.newBuilder(ctx).build())) { CommonUtils.waitFor("Alluxio worker to register with master", () -> { try {
/** * Implements get configuration. * * @param ctx Alluxio client configuration * @param args list of arguments * @return 0 on success, 1 on failures */ public static int getConf(ClientContext ctx, String... args) { return getConfImpl( () -> new RetryHandlingMetaMasterConfigClient(MasterClientContext.newBuilder(ctx).build()), ctx.getConf(), args); }
/** * @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()); }
@Override protected Map<String, Command> loadCommands() { ClientContext ctx = ClientContext.create(mConfiguration); MasterClientContext masterConfig = MasterClientContext.newBuilder(ctx).build(); Context context = new Context( new RetryHandlingFileSystemMasterClient(masterConfig), new RetryHandlingBlockMasterClient(masterConfig), new RetryHandlingMetaMasterClient(masterConfig), System.out ); return CommandUtils.loadCommands(FileSystemAdminShell.class.getPackage().getName(), new Class[] {Context.class, AlluxioConfiguration.class}, new Object[] {context, mConfiguration}); } }
/** * Creates a new DefaultFileSystemWorker. * * @param blockWorker the block worker handle * @param ufsManager the ufs manager */ DefaultFileSystemWorker(BlockWorker blockWorker, UfsManager ufsManager) { super(Executors.newFixedThreadPool(3, ThreadFactoryUtils.build("file-system-worker-heartbeat-%d", true))); mWorkerId = blockWorker.getWorkerId(); mUfsManager = ufsManager; mFileDataManager = new FileDataManager(Preconditions.checkNotNull(blockWorker, "blockWorker"), RateLimiter.create(ServerConfiguration .getBytes(PropertyKey.WORKER_FILE_PERSIST_RATE_LIMIT)), mUfsManager); // Setup AbstractMasterClient mFileSystemMasterWorkerClient = new FileSystemMasterClient(MasterClientContext .newBuilder(ClientContext.create(ServerConfiguration.global())).build()); }
/** * Constructs a default block worker. * * @param ufsManager ufs manager */ DefaultBlockWorker(UfsManager ufsManager) { this(new BlockMasterClientPool(), new FileSystemMasterClient(MasterClientContext .newBuilder(ClientContext.create(ServerConfiguration.global())).build()), new Sessions(), new TieredBlockStore(), ufsManager); }
.newBuilder(mClientContext) .setMasterInquireClient(mMasterInquireClient) .build());
/** * @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)); }
.newBuilder(ClientContext.create(ServerConfiguration.global())).build()); getExecutorService().submit(new HeartbeatThread(HeartbeatContext.META_MASTER_SYNC, new MetaMasterSync(mMasterAddress, metaMasterClient),