Example #1
0
 /**
  * Removes blocks from workers.
  *
  * @param blockIds a list of block ids to remove from Tachyon space
  */
 public void removeBlocks(List<Long> blockIds) {
   synchronized (mBlocks) {
     synchronized (mWorkers) {
       for (long blockId : blockIds) {
         MasterBlockInfo masterBlockInfo = mBlocks.get(blockId);
         if (masterBlockInfo == null) {
           continue;
         }
         for (long workerId : new ArrayList<Long>(masterBlockInfo.getWorkers())) {
           masterBlockInfo.removeWorker(workerId);
           MasterWorkerInfo worker = mWorkers.getFirstByField(mIdIndex, workerId);
           if (worker != null) {
             worker.updateToRemovedBlock(true, blockId);
           }
         }
         mLostBlocks.remove(blockId);
       }
     }
   }
 }