/** * Factory method for {@link JournalFormatter}. * * @return the created formatter */ public static JournalFormatter create() { return CommonUtils.createNewClassInstance( Configuration.<JournalFormatter>getClass(PropertyKey.MASTER_JOURNAL_FORMATTER_CLASS), null, null); } }
/** * Creates a new instance of {@link AsyncPersistHandler}. * * @param view {@link FileSystemMasterView} to pass to {@link AsyncPersistHandler} * @return the generated {@link AsyncPersistHandler} */ public static AsyncPersistHandler create(FileSystemMasterView view) { return CommonUtils.createNewClassInstance( Configuration .<AsyncPersistHandler>getClass(PropertyKey.MASTER_FILE_ASYNC_PERSIST_HANDLER), new Class[] {FileSystemMasterView.class}, new Object[] {view}); } }
/** * @param lineageStoreView a view of the lineage store * @param fileSystemMasterView a view of the file system master * @return the generated planner */ public static CheckpointPlanner create(LineageStoreView lineageStoreView, FileSystemMasterView fileSystemMasterView) { return CommonUtils.createNewClassInstance( Configuration.<CheckpointPlanner>getClass(PropertyKey.MASTER_LINEAGE_CHECKPOINT_CLASS), new Class[] {LineageStoreView.class, FileSystemMasterView.class}, new Object[] {lineageStoreView, fileSystemMasterView}); } }
/** * Factory for {@link RemoteBlockWriter}. * * @param conf Alluxio configuration * @return a new instance of {@link RemoteBlockWriter} */ public static RemoteBlockWriter create(Configuration conf) { try { return CommonUtils.createNewClassInstance( conf.<RemoteBlockWriter>getClass(Constants.USER_BLOCK_REMOTE_WRITER), null, null); } catch (Exception e) { throw Throwables.propagate(e); } } }
/** * Factory for {@link RemoteBlockReader}. * * @param conf Alluxio configuration * @return a new instance of {@link RemoteBlockReader} */ public static RemoteBlockReader create(Configuration conf) { try { return CommonUtils.createNewClassInstance( conf.<RemoteBlockReader>getClass(Constants.USER_BLOCK_REMOTE_READER), null, null); } catch (Exception e) { throw Throwables.propagate(e); } } }
/** * Gets the cached groups mapping service being used to map user-to-groups. * * @return the groups mapping service being used to map user-to-groups */ public static GroupMappingService get() { if (sCachedGroupMapping == null) { synchronized (Factory.class) { if (sCachedGroupMapping == null) { LOG.debug("Creating new Groups object"); GroupMappingService groupMappingService = CommonUtils.createNewClassInstance(Configuration.<GroupMappingService>getClass( PropertyKey.SECURITY_GROUP_MAPPING_CLASS), null, null); sCachedGroupMapping = new CachedGroupMapping(groupMappingService); } } } return sCachedGroupMapping; }
private InStreamOptions() { mReadType = ClientContext.getConf().getEnum(Constants.USER_FILE_READ_TYPE_DEFAULT, ReadType.class); try { mLocationPolicy = CommonUtils.createNewClassInstance(ClientContext.getConf() .<FileWriteLocationPolicy>getClass(Constants.USER_FILE_WRITE_LOCATION_POLICY), new Class[]{}, new Object[]{}); } catch (Exception e) { throw Throwables.propagate(e); } }
/** * Creates a new instance with defaults based on the configuration. */ private OpenFileOptions() { mReadType = ClientContext.getConf().getEnum(Constants.USER_FILE_READ_TYPE_DEFAULT, ReadType.class); try { mLocationPolicy = CommonUtils.createNewClassInstance(ClientContext.getConf() .<FileWriteLocationPolicy>getClass(Constants.USER_FILE_WRITE_LOCATION_POLICY), new Class[]{}, new Object[]{}); } catch (Exception e) { throw Throwables.propagate(e); } }
/** * Creates a new instance with defaults from the configuration. */ private CreateFileOptions() { Configuration conf = ClientContext.getConf(); mRecursive = true; mBlockSizeBytes = conf.getBytes(Constants.USER_BLOCK_SIZE_BYTES_DEFAULT); try { mLocationPolicy = CommonUtils.createNewClassInstance( conf.<FileWriteLocationPolicy>getClass(Constants.USER_FILE_WRITE_LOCATION_POLICY), new Class[]{}, new Object[]{}); } catch (Exception e) { throw Throwables.propagate(e); } mWriteType = conf.getEnum(Constants.USER_FILE_WRITE_TYPE_DEFAULT, WriteType.class); mTtl = Constants.NO_TTL; }
private OutStreamOptions() { Configuration conf = ClientContext.getConf(); mBlockSizeBytes = conf.getBytes(Constants.USER_BLOCK_SIZE_BYTES_DEFAULT); mTtl = Constants.NO_TTL; try { mLocationPolicy = CommonUtils.createNewClassInstance(ClientContext.getConf() .<FileWriteLocationPolicy>getClass(Constants.USER_FILE_WRITE_LOCATION_POLICY), new Class[] {}, new Object[] {}); } catch (Exception e) { throw Throwables.propagate(e); } mWriteType = conf.getEnum(Constants.USER_FILE_WRITE_TYPE_DEFAULT, WriteType.class); }