/** * This method is provided for testing, use the {@link FileSystemContext#create} methods. The * returned context object will not be cached automatically. * * @param subject the parent subject, set to null if not present * @param masterInquireClient the client to use for determining the master; note that if the * context is reset, this client will be replaced with a new masterInquireClient based on * the original configuration. * @param alluxioConf Alluxio configuration * @return the context */ @VisibleForTesting public static FileSystemContext create(Subject subject, MasterInquireClient masterInquireClient, AlluxioConfiguration alluxioConf) { FileSystemContext context = new FileSystemContext(subject, alluxioConf); context.init(masterInquireClient); return context; }
/** * @param clientContext the {@link alluxio.ClientContext} containing the subject and configuration * @return the {@link alluxio.client.file.FileSystemContext} */ public static FileSystemContext create(ClientContext clientContext) { Preconditions.checkNotNull(clientContext); FileSystemContext ctx = new FileSystemContext(clientContext); ctx.init(MasterInquireClient.Factory.create(clientContext.getConf())); return ctx; }
/** * @param subject the parent subject, set to null if not present * @param alluxioConf Alluxio configuration * @return a context */ public static FileSystemContext create(Subject subject, AlluxioConfiguration alluxioConf) { FileSystemContext context = new FileSystemContext(subject, alluxioConf); context.init(MasterInquireClient.Factory.create(context.mClientContext.getConf())); return context; }