Package org.apache.hadoop.hdfs.server.datanode

Examples of org.apache.hadoop.hdfs.server.datanode.FSDatasetInterface$MetaDataInputStream


      assertNotNull(b);
      assertEquals(blockIdToLen(b.getBlockId()), b.getNumBytes());
    }
  }
  public void testInjectionEmpty() throws IOException {
    FSDatasetInterface fsdataset = new SimulatedFSDataset(conf);
    Block[] blockReport = fsdataset.getBlockReport(0);
    assertEquals(0, blockReport.length);
    int bytesAdded = addSomeBlocks(fsdataset);
    blockReport = fsdataset.getBlockReport(0);
    assertEquals(NUMBLOCKS, blockReport.length);
    for (Block b: blockReport) {
      assertNotNull(b);
      assertEquals(blockIdToLen(b.getBlockId()), b.getNumBytes());
    }
View Full Code Here


    assertEquals(bytesAdded, sfsdataset.getDfsUsed());
    assertEquals(sfsdataset.getCapacity()-bytesAdded, sfsdataset.getRemaining());
  }

  public void testInjectionNonEmpty() throws IOException {
    FSDatasetInterface fsdataset = new SimulatedFSDataset(conf);
   
    Block[] blockReport = fsdataset.getBlockReport(0);
    assertEquals(0, blockReport.length);
    int bytesAdded = addSomeBlocks(fsdataset);
    blockReport = fsdataset.getBlockReport(0);
    assertEquals(NUMBLOCKS, blockReport.length);
    for (Block b: blockReport) {
      assertNotNull(b);
      assertEquals(blockIdToLen(b.getBlockId()), b.getNumBytes());
    }
View Full Code Here

    }

  }

  public void checkInvalidBlock(Block b) throws IOException {
    FSDatasetInterface fsdataset = new SimulatedFSDataset(conf);
    assertFalse(fsdataset.isValidBlock(0, b, false));
    try {
      fsdataset.getFinalizedBlockLength(0,b);
      assertTrue("Expected an IO exception", false);
    } catch (IOException e) {
      // ok - as expected
    }
   
    try {
      ReplicaToRead replica = fsdataset.getReplicaToRead(0, b);
      if (replica != null) {
        InputStream input = replica.getBlockInputStream(null, 0);
        assertTrue("Expected an IO exception", false);
      }
    } catch (IOException e) {
      // ok - as expected
    }
   
    try {
      fsdataset.finalizeBlock(0,b);
      assertTrue("Expected an IO exception", false);
    } catch (IOException e) {
      // ok - as expected
    }
   
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hdfs.server.datanode.FSDatasetInterface$MetaDataInputStream

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.