@Override protected LineageMasterClient createNewResource() { return new LineageMasterClient(mMasterAddress, ClientContext.getConf()); } }
/** * Initializes the internal buffer based on the user's specified size. Any reads above half * this size will not be buffered. * * @return a heap buffer of user configured size */ private ByteBuffer allocateBuffer() { TachyonConf conf = ClientContext.getConf(); return ByteBuffer.allocate( (int) conf.getBytes(Constants.USER_BLOCK_REMOTE_READ_BUFFER_SIZE_BYTES)); }
@Override protected FileSystemMasterClient createNewResource() { return new FileSystemMasterClient(mMasterAddress, ClientContext.getConf()); } }
/** * @return a newly allocated byte buffer of the user defined default size */ private ByteBuffer allocateBuffer() { TachyonConf conf = ClientContext.getConf(); return ByteBuffer.allocate((int) conf.getBytes(Constants.USER_FILE_BUFFER_BYTES)); } }
/** * Creates a new file stream master client pool. * * @param masterAddress the master address */ public FileSystemMasterClientPool(InetSocketAddress masterAddress) { super(ClientContext.getConf().getInt(Constants.USER_FILE_MASTER_CLIENT_THREADS)); mMasterAddress = masterAddress; }
/** * Creates a <code>TachyonFS</code> handler for the given path. * * @param tachyonPath a Tachyon path contains master address. e.g., tachyon://localhost:19998, * tachyon://localhost:19998/ab/c.txt * @return the corresponding TachyonFS handler * @see #get(tachyon.TachyonURI, tachyon.conf.TachyonConf) */ @Deprecated public static synchronized TachyonFS get(String tachyonPath) { return get(new TachyonURI(tachyonPath), ClientContext.getConf()); }
/** * @return the default {@code LoadMetadataOptions} */ public static LoadMetadataOptions defaults() { return new Builder(ClientContext.getConf()).build(); }
/** * @return the default {@code InStreamOptions} */ public static InStreamOptions defaults() { return new Builder(ClientContext.getConf()).build(); }
/** * @return the default options */ public static GetLineageInfoListOptions defaults() { return new Builder(ClientContext.getConf()).build(); }
/** * @return the default {@code ListStatusOptions} */ public static ListStatusOptions defaults() { return new Builder(ClientContext.getConf()).build(); }
/** * @return the default {@code MkdirOptions} */ public static MkdirOptions defaults() { return new Builder(ClientContext.getConf()).build(); }
/** * @return the default {@code SetStateOptions} */ public static SetStateOptions defaults() { return new Builder(ClientContext.getConf()).build(); }
/** * @return the default {@code MountOptions} */ public static MountOptions defaults() { return new Builder(ClientContext.getConf()).build(); }
private void setUnderStoreStream(long pos) throws IOException { if (mUnderStoreStream != null) { mUnderStoreStream.close(); } UnderFileSystem ufs = UnderFileSystem.get(mUfsPath, ClientContext.getConf()); mUnderStoreStream = ufs.open(mUfsPath); mPos = 0; if (pos != skip(pos)) { throw new IOException("Failed to skip: " + pos); } } }
/** * @return the default {@code FreeOptions} */ public static FreeOptions defaults() { return new Builder(ClientContext.getConf()).build(); }
/** * @return the default {@code GetInfoOptions} */ public static GetInfoOptions defaults() { return new Builder(ClientContext.getConf()).build(); }
/** * Converts an OutStreamOptions object to an InStreamOptions object with a matching Tachyon * storage type. * * @param op an OutStreamOptions object * @return an InStreamOptions object with a matching Tachyon storage type */ public static InStreamOptions toInStreamOptions(OutStreamOptions op) { return new InStreamOptions.Builder(ClientContext.getConf()) .setTachyonStorageType(op.getTachyonStorageType()).build(); }
@Override public Boolean call() throws Exception { TachyonConf tachyonConf = ClientContext.getConf(); tachyonConf.set(Constants.MASTER_HOSTNAME, mMasterLocation.getHost()); tachyonConf.set(Constants.MASTER_PORT, Integer.toString(mMasterLocation.getPort())); ClientContext.reset(tachyonConf); TachyonFileSystem tFS = TachyonFileSystem.TachyonFileSystemFactory.get(); write(tFS, mFilePath, mWriteType, mDeleteIfExists, mLength); return read(tFS, mFilePath, mReadType); }
@Override public Boolean call() throws Exception { TachyonConf tachyonConf = ClientContext.getConf(); tachyonConf.set(Constants.MASTER_HOSTNAME, mMasterLocation.getHost()); tachyonConf.set(Constants.MASTER_PORT, Integer.toString(mMasterLocation.getPort())); ClientContext.reset(tachyonConf); TachyonFileSystem tFS = TachyonFileSystem.TachyonFileSystemFactory.get(); long fileId = createFile(tFS); writeFile(fileId); return readFile(tFS, fileId); }
private static OutStreamOptions updateOutStreamOptions(OutStreamOptions options) { // change the under storage type to async OutStreamOptions.Builder builder = new OutStreamOptions.Builder(ClientContext.getConf()); builder.setBlockSizeBytes(options.getBlockSizeBytes()); builder.setHostname(options.getHostname()); builder.setTachyonStorageType(options.getTachyonStorageType()); builder.setTTL(options.getTTL()); builder.setUnderStorageType(UnderStorageType.ASYNC_PERSIST); return builder.build(); }