/** * @param fileId the file id * @return the file info for the given file id * @throws IOException if an I/O error occurs */ // TODO(jiri): Factor this method out to a common client. public synchronized FileInfo getFileInfo(long fileId) throws IOException { int retry = 0; while (!mClosed && (retry ++) <= RPC_MAX_NUM_RETRY) { connect(); try { return mClient.getFileInfo(fileId); } catch (TachyonTException e) { throw new IOException(e); } catch (TException e) { LOG.error(e.getMessage(), e); mConnected = false; } } throw new IOException("Failed after " + retry + " retries."); }
/** * Gets the file information. * * @param fileId the file id * @return the file info * @throws IOException if an I/O error occurs */ public FileInfo getFileInfo(long fileId) throws IOException { return mFileSystemMasterClient.getFileInfo(fileId); } }
if (!ufs.exists(tmpPath)) { FileInfo fileInfo = mFileSystemMasterClient.getFileInfo(fileId); ufsPath = fileInfo.getUfsPath(); tmpPath = PathUtils.temporaryFileName(fileId, nonce, ufsPath); throw new FailedToCheckpointException("Failed to getFileSize " + ufsPath); mFileSystemMasterClient.persistFile(fileId, fileSize);
Set<Long> pinList = mMasterClient.getPinList(); mBlockDataManager.updatePinList(pinList); lastSyncMs = System.currentTimeMillis();
mSpaceReserver.stop(); mFileSystemMasterClient.close(); mSyncExecutorService.shutdown(); mWorkerMetricsSystem.stop();
NetworkAddressUtils.getConnectAddress(ServiceType.MASTER_RPC, mTachyonConf), mTachyonConf); mFileSystemMasterClient = new WorkerFileSystemMasterClient( NetworkAddressUtils.getConnectAddress(ServiceType.MASTER_RPC, mTachyonConf), mTachyonConf);
/** * @return the set of pinned file ids * @throws IOException if an I/O error occurs */ public synchronized Set<Long> getPinList() throws IOException { int retry = 0; while (!mClosed && (retry ++) <= RPC_MAX_NUM_RETRY) { connect(); try { return mClient.workerGetPinIdList(); } catch (TachyonTException e) { throw new IOException(e); } catch (TException e) { LOG.error(e.getMessage(), e); mConnected = false; } } throw new IOException("Failed after " + retry + " retries."); } }
/** * Persists a file. * * @param fileId the file id * @param length the checkpoint length * @return whether operation succeeded or not * @throws IOException if an I/O error occurs */ public synchronized boolean persistFile(long fileId, long length) throws IOException { int retry = 0; while (!mClosed && (retry ++) <= RPC_MAX_NUM_RETRY) { connect(); try { return mClient.persistFile(fileId, length); } catch (TachyonTException e) { throw new IOException(e); } catch (TException e) { LOG.error(e.getMessage(), e); mConnected = false; } } throw new IOException("Failed after " + retry + " retries."); }