/** * Gets the info of a list of workers. * * @return A list of worker info returned by master * @throws IOException if an I/O error occurs */ public synchronized List<WorkerInfo> getWorkerInfoList() throws IOException { int retry = 0; while (!mClosed && (retry ++) <= RPC_MAX_NUM_RETRY) { connect(); try { return mClient.getWorkerInfoList(); } catch (TException e) { LOG.error(e.getMessage(), e); mConnected = false; } } throw new IOException("Failed after " + retry + " retries."); }
/** * Gets the total Tachyon capacity in bytes, on all the tiers of all the workers. * * @return total capacity in bytes * @throws IOException if an I/O error occurs */ public synchronized long getCapacityBytes() throws IOException { int retry = 0; while (!mClosed && (retry ++) <= RPC_MAX_NUM_RETRY) { connect(); try { return mClient.getCapacityBytes(); } catch (TException e) { LOG.error(e.getMessage(), e); mConnected = false; } } throw new IOException("Failed after " + retry + " retries."); }
/** * Returns the BlockInfo for a block id. * * @param blockId the block id to get the BlockInfo for * @return the BlockInfo * @throws IOException if an I/O error occurs */ public synchronized BlockInfo getBlockInfo(long blockId) throws IOException { int retry = 0; while (!mClosed && (retry ++) <= RPC_MAX_NUM_RETRY) { connect(); try { return mClient.getBlockInfo(blockId); } catch (TException e) { LOG.error(e.getMessage(), e); mConnected = false; } } throw new IOException("Failed after " + retry + " retries."); }
/** * Gets the total amount of used space in bytes, on all the tiers of all the workers. * * @return amount of used space in bytes * @throws IOException if an I/O error occurs */ public synchronized long getUsedBytes() throws IOException { int retry = 0; while (!mClosed && (retry ++) <= RPC_MAX_NUM_RETRY) { connect(); try { return mClient.getUsedBytes(); } catch (TException e) { LOG.error(e.getMessage(), e); mConnected = false; } } throw new IOException("Failed after " + retry + " retries."); } }