Package org.apache.hadoop.hdfs.server.protocol

Examples of org.apache.hadoop.hdfs.server.protocol.ReceivedBlockInfo


      if (block == null ) {
        throw new IllegalArgumentException("Block is null");
      }

      if (delHint != null && !delHint.isEmpty()) {
        block = new ReceivedBlockInfo(block, delHint);
      }

      synchronized (receivedAndDeletedBlockList) {
        receivedAndDeletedBlockList.add(block);
        pendingReceivedRequests++;
View Full Code Here


  void notifyNamenodeReceivedBlock(Block block, String delHint) {
    if (block==null) {
      throw new IllegalArgumentException("Block is null");
    }
    if (delHint != null && !delHint.isEmpty()) {
      block = new ReceivedBlockInfo(block, delHint);
    }
    synchronized (receivedAndDeletedBlockList) {
      receivedAndDeletedBlockList.add(block);
      pendingReceivedRequests++;
      if (!shouldBackoff) {
View Full Code Here

   * Remove blocks from blockReceived queues
   */
  void removeReceivedBlocks(Block[] removeList) {
    long start = AvatarDataNode.now();
    synchronized(receivedAndDeletedBlockList) {
      ReceivedBlockInfo block = new ReceivedBlockInfo();
      block.setDelHints(ReceivedBlockInfo.WILDCARD_HINT);
      for (Block bi : removeList) {
        block.set(bi.getBlockId(), bi.getNumBytes(), bi.getGenerationStamp());
        while (receivedAndDeletedBlockList.remove(block)) {
          LOG.info("Block deletion command deleted from receivedDeletedBlockList " +
                   bi);
        }
      }
View Full Code Here

      if (block == null ) {
        throw new IllegalArgumentException("Block is null");
      }

      if (delHint != null && !delHint.isEmpty()) {
        block = new ReceivedBlockInfo(block, delHint);
      }

      synchronized (receivedAndDeletedBlockList) {
        receivedAndDeletedBlockList.add(block);
        pendingReceivedRequests++;
View Full Code Here

  void notifyNamenodeReceivedBlock(Block block, String delHint) {
    if (block==null) {
      throw new IllegalArgumentException("Block is null");
    }
    if (delHint != null && !delHint.isEmpty()) {
      block = new ReceivedBlockInfo(block, delHint);
    }
    synchronized (receivedAndDeletedBlockList) {
      receivedAndDeletedBlockList.add(block);
      pendingReceivedRequests++;
      if (!shouldBackoff) {
View Full Code Here

   * Remove blocks from blockReceived queues
   */
  void removeReceivedBlocks(Block[] removeList) {
    long start = AvatarDataNode.now();
    synchronized(receivedAndDeletedBlockList) {
      ReceivedBlockInfo block = new ReceivedBlockInfo();
      block.setDelHints(ReceivedBlockInfo.WILDCARD_HINT);
      for (Block bi : removeList) {
        block.set(bi.getBlockId(), bi.getNumBytes(), bi.getGenerationStamp());
        while (receivedAndDeletedBlockList.remove(block)) {
          LOG.info("Block deletion command deleted from receivedDeletedBlockList " +
                   bi);
        }
      }
View Full Code Here

    for (int i = 0; i < NUM; i++) {
      if (!rand.nextBoolean()) {
        blocks[i] = new Block(rand.nextLong(), rand.nextLong(), rand.nextLong());
        isBlockReceived[i] = false;
      } else {
        ReceivedBlockInfo bri = new ReceivedBlockInfo(new Block(
            rand.nextLong(), rand.nextLong(), rand.nextLong()), "delHints" + i);
        blocks[i] = bri;
        isBlockReceived[i] = true;
        numReceived++;
      }
View Full Code Here

    while (ibrSource.hasNext()) {
      delHint = ibrSource.getNext(blk);
      // check if received/deleted
      if (isBlockReceived[i]) {
        ReceivedBlockInfo source = (ReceivedBlockInfo) blocks[i];
        // check if delHints match
        assertEquals(source.getDelHints(), delHint);
      }
      // check if id/size/genstamp match
      // discard delHint (checked above)
      assertEquals(new Block(blocks[i]), blk);
      i++;
View Full Code Here

      if (block == null ) {
        throw new IllegalArgumentException("Block is null");
      }

      if (delHint != null && !delHint.isEmpty()) {
        block = new ReceivedBlockInfo(block, delHint);
      }

      synchronized (receivedAndDeletedBlockList) {
        receivedAndDeletedBlockList.add(block);
        pendingReceivedRequests++;
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hdfs.server.protocol.ReceivedBlockInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.