Examples of IncrementalBlockReport


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

    // process received + deleted
    // if exception is thrown, add all blocks to the retry list
    if (receivedAndDeletedBlockArray != null) {           
      long[] failed = null;
      try {
        IncrementalBlockReport ibr = new IncrementalBlockReport(receivedAndDeletedBlockArray);

        long rpcStartTime = 0;
        if (LOG.isDebugEnabled()) {
          rpcStartTime = System.nanoTime();
          LOG.debug("sending blockReceivedAndDeletedNew "
View Full Code Here

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

    // process received + deleted
    // if exception is thrown, add all blocks to the retry list
    if (receivedAndDeletedBlockArray != null) {           
      long[] failed = null;
      try {
        IncrementalBlockReport ibr = new IncrementalBlockReport(receivedAndDeletedBlockArray);

        long rpcStartTime = 0;
        if (LOG.isDebugEnabled()) {
          rpcStartTime = System.nanoTime();
          LOG.debug("sending blockReceivedAndDeletedNew "
View Full Code Here

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

  }

  public void testEmpty() {
    LOG.info("Test empty");

    IncrementalBlockReport ibrSource = new IncrementalBlockReport(new Block[0]);
    long[] sourceBlocks = ibrSource.getBlockReportInLongs();
    long[] sourceHintsMap = ibrSource.getHintsMap();
    String[] sourceHints = ibrSource.getHints();

    assertEquals(0, sourceBlocks.length);
    assertEquals(0, sourceHintsMap.length);
    assertEquals(0, sourceHints.length);

    // initialize the block report on the NN side

    assertFalse(ibrSource.hasNext());

    LOG.info("Test empty -- DONE");
  }
View Full Code Here

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

  }

  public void testReport() {
    LOG.info("Test multi basic");

    IncrementalBlockReport ibrSource = new IncrementalBlockReport(blocks);
    long[] sourceBlocks = ibrSource.getBlockReportInLongs();
    long[] sourceHintsMap = ibrSource.getHintsMap();
    String[] sourceHints = ibrSource.getHints();

    // check if the arrays are of correct length
    assertEquals(NUM * BlockListAsLongs.LONGS_PER_BLOCK, sourceBlocks.length);
    assertEquals(LightWeightBitSet.getBitArraySize(NUM), sourceHintsMap.length);
    assertEquals(numReceived, LightWeightBitSet.cardinality(sourceHintsMap));
    assertEquals(numReceived, sourceHints.length);

    // check the contents
    int i = 0;
    String delHint = null;
    Block blk = new Block();

    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++;
    }
   
    //check the length function
    assertEquals(i, ibrSource.getLength());

    // check if we've got all the blocks
    assertEquals(NUM, i);

    LOG.info("Test multi - DONE");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.