/** * @param writeType the write type to use * @return the builder */ public Builder setWriteType(WriteType writeType) { mUnderStorageType = writeType.getUnderStorageType(); return this; }
/** * @param writeType the write type to use * @return the builder */ public Builder setWriteType(WriteType writeType) { mUnderStorageType = writeType.getUnderStorageType(); return this; }
/** * @param writeType the {@link tachyon.client.WriteType} to use for this operation. This will * override both the TachyonStorageType and UnderStorageType. * @return the builder */ public Builder setWriteType(WriteType writeType) { mTachyonStorageType = writeType.getTachyonStorageType(); mUnderStorageType = writeType.getUnderStorageType(); return this; }
/** * 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 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; }
/** * @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()); }