Пример #1
0
 /** Decrement the number of blocks scheduled. */
 void decrementBlocksScheduled(StorageType t) {
   if (prevApproxBlocksScheduled.get(t) > 0) {
     prevApproxBlocksScheduled.subtract(t, 1);
   } else if (currApproxBlocksScheduled.get(t) > 0) {
     currApproxBlocksScheduled.subtract(t, 1);
   }
   // its ok if both counters are zero.
 }
Пример #2
0
 /**
  * @return Approximate number of blocks currently scheduled to be written to the given storage
  *     type of this datanode.
  */
 public int getBlocksScheduled(StorageType t) {
   return (int) (currApproxBlocksScheduled.get(t) + prevApproxBlocksScheduled.get(t));
 }