public DataServerHandler(final BlockDataManager dataManager, TachyonConf tachyonConf) { mDataManager = Preconditions.checkNotNull(dataManager); mTachyonConf = Preconditions.checkNotNull(tachyonConf); mTransferType = mTachyonConf.getEnum(Constants.WORKER_NETWORK_NETTY_FILE_TRANSFER_TYPE, FileTransferType.class); }
/** * Creates a new builder for {@link MkdirOptions}. * * @param conf a Tachyon configuration */ public Builder(TachyonConf conf) { mRecursive = false; WriteType defaultWriteType = conf.getEnum(Constants.USER_FILE_WRITE_TYPE_DEFAULT, WriteType.class); mUnderStorageType = defaultWriteType.getUnderStorageType(); }
/** * Creates a new builder for {@link InStreamOptions}. * * @param conf a Tachyon configuration */ public Builder(TachyonConf conf) { ReadType defaultReadType = conf.getEnum(Constants.USER_FILE_READ_TYPE_DEFAULT, ReadType.class); mTachyonStorageType = defaultReadType.getTachyonStorageType(); }
private StorageTier(int tierLevel) { mTierLevel = tierLevel; String tierLevelAliasProp = String.format(Constants.WORKER_TIERED_STORE_LEVEL_ALIAS_FORMAT, tierLevel); StorageLevelAlias alias = WorkerContext.getConf() .getEnum(tierLevelAliasProp, StorageLevelAlias.class); mTierAlias = alias.getValue(); }
/** * Creates a new builder for {@link CreateOptions}. * * @param conf a Tachyon configuration */ public Builder(TachyonConf conf) { mBlockSizeBytes = conf.getBytes(Constants.USER_BLOCK_SIZE_BYTES_DEFAULT); mRecursive = false; mTTL = Constants.NO_TTL; WriteType defaultWriteType = conf.getEnum(Constants.USER_FILE_WRITE_TYPE_DEFAULT, WriteType.class); mUnderStorageType = defaultWriteType.getUnderStorageType(); }
/** * Creates a new builder for {@link OutStreamOptions}. * * @param conf a Tachyon configuration */ public Builder(TachyonConf conf) { mBlockSizeBytes = conf.getBytes(Constants.USER_BLOCK_SIZE_BYTES_DEFAULT); mHostname = null; WriteType defaultWriteType = conf.getEnum(Constants.USER_FILE_WRITE_TYPE_DEFAULT, WriteType.class); mTachyonStorageType = defaultWriteType.getTachyonStorageType(); mUnderStorageType = defaultWriteType.getUnderStorageType(); mTTL = Constants.NO_TTL; }
private ServerBootstrap createBootstrap() { final ServerBootstrap boot = createBootstrapOfType(mTachyonConf.getEnum(Constants.WORKER_NETWORK_NETTY_CHANNEL, ChannelType.class));
/** * @return the {@code OutStream} of this file * @throws IOException when an event that prevents the operation from completing is encountered */ public FileOutStream getOutStream() throws IOException { if (isCompleted()) { throw new IOException("Overriding after completion not supported."); } WriteType writeType = mTachyonConf.getEnum(Constants.USER_FILE_WRITE_TYPE_DEFAULT, WriteType.class); FileInfo info = getUnCachedFileStatus(); OutStreamOptions.Builder optionsBuilder = new OutStreamOptions.Builder(mTachyonConf); optionsBuilder.setBlockSizeBytes(info.getBlockSizeBytes()) .setTachyonStorageType(writeType.getTachyonStorageType()) .setUnderStorageType(writeType.getUnderStorageType()); return mTFS.getOutStream(mFileId, optionsBuilder.build()); }