/** * Factory method for {@link FileSystemMasterClient}. * * @param conf master client configuration * @return a new {@link FileSystemMasterClient} instance */ public static FileSystemMasterClient create(MasterClientContext conf) { return new RetryHandlingFileSystemMasterClient(conf); } }
@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}); } }
/** * @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)); }