code: BlockCommand getInvalidateBlocks(int maxblocks) {
      Block[] deleteList = null;
      synchronized (invalidateBlocks) {
        deleteList = invalidateBlocks.pollToArray(new Block[Math.min(
            invalidateBlocks.size(), maxblocks)]);
      }
      return (deleteList == null || deleteList.length == 0) ? 
          null: new BlockCommand(DatanodeProtocol.DNA_INVALIDATE, deleteList);
    }
docs: Remove the specified number of blocks to be invalidated