public synchronized String getDataFolder() throws TException { if (mRootFolder == null) { mRootFolder = CLIENT.getDataFolder(); } return mRootFolder; }
/** * Get the user temporary folder in the under file system of the specified user. * * @return The user temporary folder in the under file system * @throws IOException */ public synchronized String getUserUfsTempFolder() throws IOException { mustConnect(); try { return mClient.getUserUfsTempFolder(mMasterClient.getUserId()); } catch (TException e) { mConnected = false; throw new IOException(e); } }
/** * Notify worker that the block has been cancelled * * @param blockId The Id of the block to be cancelled * @throws IOException */ public synchronized void cancelBlock(long blockId) throws IOException { mustConnect(); try { mClient.cancelBlock(mMasterClient.getUserId(), blockId); } catch (TException e) { mConnected = false; throw new IOException(e); } }
/** * Users' heartbeat to the Worker. * * @param userId The id of the user * @throws IOException */ public synchronized void userHeartbeat(long userId) throws IOException { mustConnect(); try { mClient.userHeartbeat(userId, mClientMetrics.getHeartbeatData()); } catch (TException e) { mConnected = false; throw new IOException(e); } }
/** * Promote block back to the top StorageTier * * @param blockId The id of the block that will be promoted * @return true if succeed, false otherwise * @throws IOException */ public synchronized boolean promoteBlock(long blockId) throws IOException { mustConnect(); try { return mClient.promoteBlock(blockId); } catch (TException e) { mConnected = false; throw new IOException(e); } }
/** * Unlock the block * * @param blockId The id of the block * @return true if success, false otherwise * @throws IOException */ public synchronized boolean unlockBlock(long blockId) throws IOException { mustConnect(); try { return mClient.unlockBlock(blockId, mMasterClient.getUserId()); } catch (TException e) { mConnected = false; throw new IOException(e); } }
/** * Update the latest block access time on the worker. * * @param blockId The id of the block * @throws IOException */ public synchronized void accessBlock(long blockId) throws IOException { mustConnect(); try { mClient.accessBlock(blockId); } catch (TException e) { LOG.error("TachyonClient accessLocalBlock(" + blockId + ") failed"); mConnected = false; throw new IOException(e); } }
/** * Lock the block, therefore, the worker will not evict the block from the memory until it is * unlocked. * * @param blockId The id of the block * @return the path of the block file locked * @throws IOException */ public synchronized String lockBlock(long blockId) throws IOException { mustConnect(); try { return mClient.lockBlock(blockId, mMasterClient.getUserId()); } catch (FileDoesNotExistException e) { return null; } catch (TException e) { mConnected = false; throw new IOException(e); } }
/** * Notify the worker to checkpoint the file asynchronously. * * @param fileId The id of the file * @return true if success, false otherwise * @throws IOException */ public synchronized boolean asyncCheckpoint(int fileId) throws IOException { mustConnect(); try { return mClient.asyncCheckpoint(fileId); } catch (TachyonException e) { throw new IOException(e); } catch (TException e) { mConnected = false; throw new IOException(e); } }
/** * Notify the worker the block is cached. * * @param blockId The id of the block * @throws IOException */ public synchronized void cacheBlock(long blockId) throws IOException { mustConnect(); try { mClient.cacheBlock(mMasterClient.getUserId(), blockId); } catch (FileDoesNotExistException e) { throw new IOException(e); } catch (BlockInfoException e) { throw new IOException(e); } catch (TException e) { mConnected = false; throw new IOException(e); } }
/** * Request space for some block from worker * * @param blockId The id of the block * @param requestBytes The requested space size, in bytes * @return true if success, false otherwise * @throws IOException */ public synchronized boolean requestSpace(long blockId, long requestBytes) throws IOException { mustConnect(); try { return mClient.requestSpace(mMasterClient.getUserId(), blockId, requestBytes); } catch (OutOfSpaceException e) { return false; } catch (FileDoesNotExistException e) { throw new IOException(e); } catch (TException e) { mConnected = false; throw new IOException(e); } }
/** * Get temporary path for the block from the worker * * @param blockId The id of the block * @param initialBytes The initial size bytes allocated for the block * @return the temporary path of the block * @throws IOException */ public synchronized String requestBlockLocation(long blockId, long initialBytes) throws IOException { mustConnect(); try { return mClient.requestBlockLocation(mMasterClient.getUserId(), blockId, initialBytes); } catch (OutOfSpaceException e) { throw new IOException(e); } catch (FileAlreadyExistException e) { throw new IOException(e); } catch (TException e) { mConnected = false; throw new IOException(e); } }
/** * Notify the worker that the checkpoint file of the file has been added. * * @param fileId The id of the checkpointed file * @throws IOException */ public synchronized void addCheckpoint(int fileId) throws IOException { mustConnect(); try { mClient.addCheckpoint(mMasterClient.getUserId(), fileId); } catch (FileDoesNotExistException e) { throw new IOException(e); } catch (SuspectedFileSizeException e) { throw new IOException(e); } catch (FailedToCheckpointException e) { throw new IOException(e); } catch (BlockInfoException e) { throw new IOException(e); } catch (TException e) { mConnected = false; throw new IOException(e); } }
public synchronized void lockFile(int fileId, long userId) throws TException { CLIENT.lockFile(fileId, userId); }
public synchronized String getUserUnderfsTempFolder(long userId) throws TException { return CLIENT.getUserUnderfsTempFolder(userId); }
public synchronized void cacheFile(long userId, int fileId) throws FileDoesNotExistException, SuspectedFileSizeException, TException { CLIENT.cacheFile(userId, fileId); }
public synchronized void addCheckpoint(long userId, int fileId) throws FileDoesNotExistException, SuspectedFileSizeException, FailedToCheckpointException, TException { CLIENT.addCheckpoint(userId, fileId); }
public synchronized void accessFile(int fileId) throws TException { CLIENT.accessFile(fileId); }
public synchronized void userHeartbeat(long userId) throws TException { CLIENT.userHeartbeat(userId); }
public synchronized void returnSpace(long userId, long returnSpaceBytes) throws TException { CLIENT.returnSpace(userId, returnSpaceBytes); }
public synchronized boolean requestSpace(long userId, long requestBytes) throws TException { return CLIENT.requestSpace(userId, requestBytes); }