Example #1
0
  /**
   * Notify the worker to checkpoint the file asynchronously.
   *
   * @param fileId The id of the file
   * @return true if succeed, false otherwise
   * @throws IOException
   * @throws TException
   */
  public boolean asyncCheckpoint(int fileId) throws IOException, TException {
    ClientFileInfo fileInfo = mMasterClient.getClientFileInfoById(fileId);

    if (fileInfo.getDependencyId() != -1) {
      synchronized (mDependencyLock) {
        mUncheckpointFiles.add(fileId);
        if (!mDepIdToFiles.containsKey(fileInfo.getDependencyId())) {
          mDepIdToFiles.put(fileInfo.getDependencyId(), new HashSet<Integer>());
        }
        mDepIdToFiles.get(fileInfo.getDependencyId()).add(fileId);
      }
      return true;
    }

    return false;
  }
Example #2
0
 public UiFileInfo(ClientFileInfo fileInfo) {
   mId = fileInfo.getId();
   mDependencyId = fileInfo.getDependencyId();
   mName = fileInfo.getName();
   mAbsolutePath = fileInfo.getPath();
   mCheckpointPath = fileInfo.getUfsPath();
   mBlockSizeBytes = fileInfo.getBlockSizeByte();
   mSize = fileInfo.getLength();
   mCreationTimeMs = fileInfo.getCreationTimeMs();
   mLastModificationTimeMs = fileInfo.getLastModificationTimeMs();
   mInMemory = (100 == fileInfo.inMemoryPercentage);
   mInMemoryPercent = fileInfo.getInMemoryPercentage();
   mIsDirectory = fileInfo.isFolder;
   mIsPinned = fileInfo.isPinned;
   mFileLocations = new ArrayList<String>();
 }