Examples of reportBadBlocks()


Examples of org.apache.hadoop.hdfs.protocol.ClientProtocol.reportBadBlocks()

               NUM_DATANODES, true, dfsCluster); // delete last (partial) block
      LocatedBlock[] toReport = new LocatedBlock[3];
      toReport[0] = locations.get(0);
      toReport[1] = locations.get(4);
      toReport[2] = locations.get(6);
      namenode.reportBadBlocks(toReport);

      corruptFiles = DFSUtil.getCorruptFiles(dfs);
      assertEquals(corruptFiles.length, 1);
      assertEquals(corruptFiles[0], file1.toString());
View Full Code Here

Examples of org.apache.hadoop.hdfs.protocol.ClientProtocol.reportBadBlocks()

              blockFile.delete();
            }
          }
        }
        LocatedBlock[] toReport = { block };
        namenode.reportBadBlocks(toReport);
      }

      // fetch bad file list from namenode. There should be 2.
      badFiles = DFSUtil.getCorruptFiles(dfs);
      assertTrue("Namenode has " + badFiles.length + " bad files. Expecting 2.",
View Full Code Here

Examples of org.apache.hadoop.hdfs.protocol.ClientProtocol.reportBadBlocks()

              blockFile.delete();
            }
          }
        }
        LocatedBlock[] toReport = { block };
        namenode.reportBadBlocks(toReport);
      }

      // fetch bad file list from namenode. There should be 2.
      badFiles = DFSUtil.getCorruptFiles(dfs);
      assertTrue("Namenode has " + badFiles.length + " bad files. Expecting 2.",
View Full Code Here

Examples of org.apache.hadoop.hdfs.protocol.ClientProtocol.reportBadBlocks()

               NUM_DATANODES, true, dfsCluster); // delete last (partial) block
      LocatedBlock[] toReport = new LocatedBlock[3];
      toReport[0] = locations.get(0);
      toReport[1] = locations.get(4);
      toReport[2] = locations.get(6);
      namenode.reportBadBlocks(toReport);

      corruptFiles = DFSUtil.getCorruptFiles(dfs);
      assertEquals(corruptFiles.length, 1);
      assertEquals(corruptFiles[0], file1.toString());
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol.reportBadBlocks()

    // Check if NN recorded length matches on-disk length
    long onDiskLength = data.getFinalizedBlockLength(namespaceId, block);
    if (block.getNumBytes() > onDiskLength) {
      // Shorter on-disk len indicates corruption so report NN the corrupt block
      nn.reportBadBlocks(new LocatedBlock[] { new LocatedBlock(block,
          new DatanodeInfo[] { new DatanodeInfo(nsReg) }) });
      LOG.info("Can't replicate block " + block + " because on-disk length "
          + onDiskLength + " is shorter than NameNode recorded length "
          + block.getNumBytes());
      return;
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol.reportBadBlocks()

    // Check if NN recorded length matches on-disk length
    long onDiskLength = data.getLength(block);
    if (block.getNumBytes() > onDiskLength) {
      // Shorter on-disk len indicates corruption so report NN the corrupt block
      nn.reportBadBlocks(new LocatedBlock[]{
          new LocatedBlock(block, new DatanodeInfo[] {
              new DatanodeInfo(bpReg)})});
      LOG.warn("Can't replicate block " + block
          + " because on-disk length " + onDiskLength
          + " is shorter than NameNode recorded length " + block.getNumBytes());
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol.reportBadBlocks()

          try {
            LOG.info("report corrupt block " + block + " from datanode " +
                      srcDataNode + " to namenode");
            LocatedBlock lb = new LocatedBlock(block,
                                            new DatanodeInfo[] {srcDataNode});
            nn.reportBadBlocks(new LocatedBlock[] {lb});
          } catch (IOException e) {
            LOG.warn("Failed to report bad block " + block +
                      " from datanode " + srcDataNode + " to namenode");
          }
        }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol.reportBadBlocks()

    // Check if NN recorded length matches on-disk length
    long onDiskLength = data.getLength(block);
    if (block.getNumBytes() > onDiskLength) {
      // Shorter on-disk len indicates corruption so report NN the corrupt block
      nn.reportBadBlocks(new LocatedBlock[]{
          new LocatedBlock(block, new DatanodeInfo[] {
              new DatanodeInfo(bpReg)})});
      LOG.warn("Can't replicate block " + block
          + " because on-disk length " + onDiskLength
          + " is shorter than NameNode recorded length " + block.getNumBytes());
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol.reportBadBlocks()

    // Check if NN recorded length matches on-disk length
    long onDiskLength = data.getLength(block);
    if (block.getNumBytes() > onDiskLength) {
      // Shorter on-disk len indicates corruption so report NN the corrupt block
      nn.reportBadBlocks(new LocatedBlock[]{
          new LocatedBlock(block, new DatanodeInfo[] {
              new DatanodeInfo(bpReg)})});
      LOG.warn("Can't replicate block " + block
          + " because on-disk length " + onDiskLength
          + " is shorter than NameNode recorded length " + block.getNumBytes());
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol.reportBadBlocks()

          try {
            LOG.info("report corrupt block " + block + " from datanode " +
                      srcDataNode + " to namenode");
            LocatedBlock lb = new LocatedBlock(block,
                                            new DatanodeInfo[] {srcDataNode});
            nn.reportBadBlocks(new LocatedBlock[] {lb});
          } catch (IOException e) {
            LOG.warn("Failed to report bad block " + block +
                      " from datanode " + srcDataNode + " to namenode");
          }
        }
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.