Examples of updateBlockForPipeline()


Examples of org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols.updateBlockForPipeline()

       
        // Allocate a new block ID/gen stamp so we can simulate pipeline
        // recovery.
        String clientName = ((DistributedFileSystem)fs).getClient()
            .getClientName();
        LocatedBlock newLocatedBlock = namenode.updateBlockForPipeline(
            oldBlock, clientName);
        ExtendedBlock newBlock = new ExtendedBlock(oldBlock.getBlockPoolId(),
            oldBlock.getBlockId(), oldBlock.getNumBytes(),
            newLocatedBlock.getBlock().getGenerationStamp());
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols.updateBlockForPipeline()

      // get the first blockid for the file
      ExtendedBlock firstBlock = DFSTestUtil.getFirstBlock(fileSys, file);

      // test getNewStampAndToken on a finalized block
      try {
        namenode.updateBlockForPipeline(firstBlock, "");
        Assert.fail("Can not get a new GS from a finalized block");
      } catch (IOException e) {
        Assert.assertTrue(e.getMessage().contains("is not under Construction"));
      }
     
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols.updateBlockForPipeline()

      // test getNewStampAndToken on a non-existent block
      try {
        long newBlockId = firstBlock.getBlockId() + 1;
        ExtendedBlock newBlock = new ExtendedBlock(firstBlock.getBlockPoolId(),
            newBlockId, 0, firstBlock.getGenerationStamp());
        namenode.updateBlockForPipeline(newBlock, "");
        Assert.fail("Cannot get a new GS from a non-existent block");
      } catch (IOException e) {
        Assert.assertTrue(e.getMessage().contains("does not exist"));
      }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols.updateBlockForPipeline()

        }

        // test non-lease holder
        DFSClient dfs = ((DistributedFileSystem)fileSys).dfs;
        try {
          namenode.updateBlockForPipeline(firstBlock, "test" + dfs.clientName);
          Assert.fail("Cannot get a new GS for a non lease holder");
        } catch (LeaseExpiredException e) {
          Assert.assertTrue(e.getMessage().startsWith("Lease mismatch"));
        }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols.updateBlockForPipeline()

          Assert.assertTrue(e.getMessage().startsWith("Lease mismatch"));
        }

        // test null lease holder
        try {
          namenode.updateBlockForPipeline(firstBlock, null);
          Assert.fail("Cannot get a new GS for a null lease holder");
        } catch (LeaseExpiredException e) {
          Assert.assertTrue(e.getMessage().startsWith("Lease mismatch"));
        }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols.updateBlockForPipeline()

        } catch (LeaseExpiredException e) {
          Assert.assertTrue(e.getMessage().startsWith("Lease mismatch"));
        }

        // test getNewStampAndToken on a rbw block
        namenode.updateBlockForPipeline(firstBlock, dfs.clientName);
      } finally {
        IOUtils.closeStream(out);
      }
    } finally {
      cluster.shutdown();
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols.updateBlockForPipeline()

      // get the first blockid for the file
      ExtendedBlock firstBlock = DFSTestUtil.getFirstBlock(fileSys, file);

      // test getNewStampAndToken on a finalized block
      try {
        namenode.updateBlockForPipeline(firstBlock, "");
        Assert.fail("Can not get a new GS from a finalized block");
      } catch (IOException e) {
        Assert.assertTrue(e.getMessage().contains("is not under Construction"));
      }
     
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols.updateBlockForPipeline()

      // test getNewStampAndToken on a non-existent block
      try {
        long newBlockId = firstBlock.getBlockId() + 1;
        ExtendedBlock newBlock = new ExtendedBlock(firstBlock.getBlockPoolId(),
            newBlockId, 0, firstBlock.getGenerationStamp());
        namenode.updateBlockForPipeline(newBlock, "");
        Assert.fail("Cannot get a new GS from a non-existent block");
      } catch (IOException e) {
        Assert.assertTrue(e.getMessage().contains("does not exist"));
      }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols.updateBlockForPipeline()

        }

        // test non-lease holder
        DFSClient dfs = ((DistributedFileSystem)fileSys).dfs;
        try {
          namenode.updateBlockForPipeline(firstBlock, "test" + dfs.clientName);
          Assert.fail("Cannot get a new GS for a non lease holder");
        } catch (LeaseExpiredException e) {
          Assert.assertTrue(e.getMessage().startsWith("Lease mismatch"));
        }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols.updateBlockForPipeline()

          Assert.assertTrue(e.getMessage().startsWith("Lease mismatch"));
        }

        // test null lease holder
        try {
          namenode.updateBlockForPipeline(firstBlock, null);
          Assert.fail("Cannot get a new GS for a null lease holder");
        } catch (LeaseExpiredException e) {
          Assert.assertTrue(e.getMessage().startsWith("Lease mismatch"));
        }
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.