Tests if the block is marked to move out of its current dir in this view.

@param blockId the id of the block
@return boolean, true if the block is marked to move out
544232
public boolean isBlockMarked(long blockId) {
    for (StorageTierView tierView : mTierViews) {
      for (StorageDirView dirView : tierView.getDirViews()) {
        if (dirView.isMarkedToMoveOut(blockId)) {
          return true;
        }
      }
    }
    return false;
  }
653677
function(changeIndex) {
			var count = 0;
			var blockIndex = 0;
			
			if (0 <= changeIndex) {
				// iterate through blocks looking for the one that contains 
				// the change with the specified changeIndex
				while (blockIndex < this._root.children.length) {
					var numChangesInCurrentBlock = this._root.children[blockIndex].children.length;
					if (((count + numChangesInCurrentBlock) - 1) < changeIndex) {
						count += numChangesInCurrentBlock; //keep going
					} else {
						// found block, go to change in block
						var changeIndexInBlock = changeIndex - count;
						return this.gotoBlock(blockIndex, changeIndexInBlock);
					}
					blockIndex++;
				}
			}
		}
286728
private boolean isBlockFinalizedWithLock(int namespaceId, Block b) {
    lock.readLock().lock();
    try {
      return isBlockFinalizedInternal(namespaceId, b, true);
    } finally {
      lock.readLock().unlock();
    }
  }
234007
private void releaseBlockLockIfUnused(long blockId) {
    synchronized (mSharedMapsLock) {
      ClientRWLock lock = mLocks.get(blockId);
      if (lock == null) {
        // Someone else probably released the block lock already.
        return;
      }
      // If we were the last worker with a reference to the lock, clean it up.
      if (lock.dropReference() == 0) {
        mLocks.remove(blockId);
        mLockPool.release(lock);
      }
    }
  }
1315304
private boolean removeUnreachable(Block block) {
    List<Statement> stmts = block.getStatements();
    for (int i = 0; i < stmts.size(); i++) {
      Statement stmt = stmts.get(i);
      if (stmt instanceof ReturnStatement
          || (stmt instanceof Block && removeUnreachable((Block) stmt))) {
        stmts.subList(i + 1, stmts.size()).clear();
        return true;
      }
    }
    return false;
  }
812232
public boolean unlockBlock(long sessionId, long blockId) {
    synchronized (mSharedMapsLock) {
      Set<Long> sessionLockIds = mSessionIdToLockIdsMap.get(sessionId);
      if (sessionLockIds == null) {
        return false;
      }
      for (long lockId : sessionLockIds) {
        LockRecord record = mLockIdToRecordMap.get(lockId);
        if (record == null) {
          // TODO(peis): Should this be a check failure?
          return false;
        }
        if (blockId == record.getBlockId()) {
          mLockIdToRecordMap.remove(lockId);
          sessionLockIds.remove(lockId);
          if (sessionLockIds.isEmpty()) {
            mSessionIdToLockIdsMap.remove(sessionId);
          }
          Lock lock = record.getLock();
          unlock(lock, blockId);
          return true;
        }
      }
      return false;
    }
  }
478128
void moveBlockToHead(BlockInfo b) {
    blockList = b.listRemove(blockList, this);
    blockList = b.listInsert(blockList, this, -1);
  }
872085
public boolean hasNodeWithId(int nodeId) {
        Node node = nodesById.get(nodeId);
        if(node == null) {
            return false;
        }
        return true;
    }
1033574
private boolean checkBlockSize(Block block, INodeFile inode) {
    if (block.getNumBytes() < 0) {
      return false;
    }
    BlockInfo[] blocks = inode.getBlocks();
    if (blocks.length == 0) {
      return false;
    }
    return block.getNumBytes() <= inode.getPreferredBlockSize();
  }
1014800
void assignToBlock(BlockId blk) {
		internalLock.writeLock().lock();
		try {
			flush();
			this.blk = blk;
			contents.read(blk);
			pins = 0;
			lastLsn = LogSeqNum.readFromPage(contents, LAST_LSN_OFFSET);
		} finally {
			internalLock.writeLock().unlock();
		}
	}
186050
private boolean discardDone(INodeFileUnderConstruction pendingFile,
                              String src) throws IOException {
    Block[] blocks = pendingFile.getBlocks();
    if (blocks == null || blocks.length == 0) {
      return false;
    }
    Block last = blocks[blocks.length-1];
    if (last.getNumBytes() == 0) {
      dir.removeBlock(src, pendingFile, last);
      finalizeINodeFileUnderConstruction(src, pendingFile);
      NameNode.stateChangeLog.warn("BLOCK*" +
          " internalReleaseLease: discarded last block " + last +
          " , lease removed for " +  src);
      return true;
    }
    return false;
  }
773340
@Override
	public boolean next() {
		while (true) {
			if (rp.next())
				return true;
			if (current == endBlkNum)
				return false;
			moveToBlock(current + 1);
		}
	}
880396
private void updateOnRemoveBlock(long blockId) {
    synchronized (mBlockIdToLastUpdateTime) {
      mLogicTimeCount.incrementAndGet();
      mBlockIdToCRFValue.remove(blockId);
      mBlockIdToLastUpdateTime.remove(blockId);
    }
  }
330871
boolean deleteInternal(String src, INode[] inodes, boolean recursive,
                         boolean enforcePermission) throws IOException {
    ArrayList<BlockInfo> collectedBlocks = new ArrayList<BlockInfo>();
    INode targetNode = null;

    byte[][] components = inodes == null ?
      INodeDirectory.getPathComponents(src) : null;

    writeLock();
    try {
      if (NameNode.stateChangeLog.isDebugEnabled()) {
        NameNode.stateChangeLog.debug("DIR* NameSystem.delete: " + src);
      }
      if (isInSafeMode()) {
        throw new SafeModeException("Cannot delete " + src, safeMode);
      }
      if (inodes == null) {
        inodes = new INode[components.length];
        dir.rootDir.getExistingPathINodes(components, inodes);
      }
      if (enforcePermission && isPermissionEnabled
          && isPermissionCheckingEnabled(inodes)) {
        checkPermission(src, inodes, false, null, FsAction.WRITE, null, FsAction.ALL);
      }
      if (neverDeletePaths.contains(src)) {
        NameNode.stateChangeLog.warn("DIR* NameSystem.delete: " +
          " Trying to delete a whitelisted path " + src +
          " by user " + getCurrentUGI() +
          " from server " + Server.getRemoteIp());
        throw new IOException("Deleting a whitelisted directory is not allowed. " + src);
      }

      if ((!recursive) && (!dir.isDirEmpty(inodes[inodes.length-1]))) {
        throw new IOException(src + " is non empty");
      }

      targetNode = dir.delete(src, inodes, collectedBlocks,
          BLOCK_DELETION_INCREMENT);
      if (targetNode == null) {
        return false;
      }
    } finally {
      writeUnlock();
    }
    List<INode> removedINodes = new ArrayList<INode>();
    while (targetNode.name != null) {
      // Interatively Remove blocks
      collectedBlocks.clear();
      // sleep to make sure that the lock can be grabbed by another thread
      try {
        Thread.sleep(1);
      } catch (InterruptedException e) {
        throw new InterruptedIOException(e.getMessage());
      }
      writeLock();
      try {
        int filesRemoved = targetNode.collectSubtreeBlocksAndClear(
            collectedBlocks, BLOCK_DELETION_INCREMENT, removedINodes);
        incrDeletedFileCount(this, filesRemoved);
        removeBlocks(collectedBlocks);
        // remove from inodeMap
        dir.removeFromInodeMap(removedINodes);
      } finally {
        writeUnlock();
      }   
    }
       
    collectedBlocks.clear();
    removedINodes.clear();
    
    return true;
  }
1322101
public boolean removeLastBlockVariableMap() {
		boolean success = false;

		if (testing) {
			success = true;
		} else {
			if (working.size() > 0) {
				if (working.remove(working.size() - 1) != null)
					success = true;
			}
		}
		return success;
	}
557462
private boolean skipToInitialBlock()
    {
        int offsetInBlock = (int) (initialOffset % BLOCK_SIZE);
        long blockStartLocation = initialOffset - offsetInBlock;

        // Don't search a block if we'd be in the trailer
        if (offsetInBlock > BLOCK_SIZE - 6) {
            blockStartLocation += BLOCK_SIZE;
        }

        endOfBufferOffset = blockStartLocation;

        // Skip to start of first block that can contain the initial record
        if (blockStartLocation > 0) {
            try {
                fileChannel.position(blockStartLocation);
            }
            catch (IOException e) {
                reportDrop(blockStartLocation, e);
                return false;
            }
        }

        return true;
    }
189240
protected function isContainerBlock($id)
    {
        return $this->typeHelper->isInstanceOf(
            $this->rawLayout->getProperty($id, RawLayout::BLOCK_TYPE, true),
            ContainerType::NAME
        );
    }