Examples of RaidBlockSender


Examples of org.apache.hadoop.hdfs.server.datanode.RaidBlockSender

    try {
      LOG.info("Sending block " + block.getBlock() +
          " from " + sock.getLocalSocketAddress().toString() +
          " to " + sock.getRemoteSocketAddress().toString() +
          " " + blockSize + " bytes");
      RaidBlockSender blockSender = new RaidBlockSender(
          block.getBlock(), blockSize, 0, blockSize,
          corruptChecksumOk, chunkOffsetOK, verifyChecksum, transferToAllowed,
          metadataIn, new RaidBlockSender.InputStreamFactory() {
          @Override
          public InputStream createStream(long offset) throws IOException {
            // we are passing 0 as the offset above, so we can safely ignore
            // the offset passed
            return blockContents;
          }
        });

      DatanodeInfo[] nodes = new DatanodeInfo[]{datanode};
      DataTransferProtocol.Sender.opWriteBlock(
        out, block.getBlock(), 1,
        DataTransferProtocol.BlockConstructionStage.PIPELINE_SETUP_CREATE,
        0, blockSize, 0, "", null, nodes, block.getBlockToken());
      blockSender.sendBlock(out, baseStream);

      LOG.info("Sent block " + block.getBlock() + " to " + datanode.name);
    } finally {
      out.close();
    }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.datanode.RaidBlockSender

      try {
        LOG.info("Sending block " + block.getBlock() +
                 " from " + sock.getLocalSocketAddress().toString() +
                 " to " + sock.getRemoteSocketAddress().toString() +
                 " " + blockSize + " bytes");
        RaidBlockSender blockSender =
          new RaidBlockSender(block.getBlock(), blockSize, 0, blockSize,
                              corruptChecksumOk, chunkOffsetOK, verifyChecksum,
                              transferToAllowed, metadataIn,
                              new RaidBlockSender.InputStreamFactory() {
                                @Override
                                public InputStream
                                  createStream(long offset) throws IOException {
                                  // we are passing 0 as the offset above,
                                  // so we can safely ignore
                                  // the offset passed
                                  return blockContents;
                                }
                              });
       
        DatanodeInfo[] nodes = new DatanodeInfo[]{datanode};
        new Sender(out).writeBlock(block.getBlock(), block.getBlockToken(), "",
            nodes, null, BlockConstructionStage.PIPELINE_SETUP_CREATE,
            1, 0L, blockSize, 0L, DataChecksum.newDataChecksum(metadataIn));
        blockSender.sendBlock(out, baseStream);
       
        LOG.info("Sent block " + block.getBlock() + " to " + datanode.name);
      } finally {
        out.close();
      }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.datanode.RaidBlockSender

      try {
        LOG.info("Sending block " + block.getBlock() +
                 " from " + sock.getLocalSocketAddress().toString() +
                 " to " + sock.getRemoteSocketAddress().toString() +
                 " " + blockSize + " bytes");
        RaidBlockSender blockSender =
          new RaidBlockSender(block.getBlock(), blockSize, 0, blockSize,
                              corruptChecksumOk, chunkOffsetOK, verifyChecksum,
                              transferToAllowed, metadataIn,
                              new RaidBlockSender.InputStreamFactory() {
                                @Override
                                public InputStream
                                  createStream(long offset) throws IOException {
                                  // we are passing 0 as the offset above,
                                  // so we can safely ignore
                                  // the offset passed
                                  return blockContents;
                                }
                              });
       
        DatanodeInfo[] nodes = new DatanodeInfo[]{datanode};
        new Sender(out).writeBlock(block.getBlock(), block.getBlockToken(), "",
            nodes, null, BlockConstructionStage.PIPELINE_SETUP_CREATE,
            1, 0L, blockSize, 0L, DataChecksum.newDataChecksum(metadataIn));
        blockSender.sendBlock(out, baseStream);
       
        LOG.info("Sent block " + block.getBlock() + " to " + datanode.getName());
      } finally {
        out.close();
      }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.datanode.RaidBlockSender

      try {
        LOG.info("Sending block " + block.getBlock() +
                 " from " + sock.getLocalSocketAddress().toString() +
                 " to " + sock.getRemoteSocketAddress().toString() +
                 " " + blockSize + " bytes");
        RaidBlockSender blockSender =
          new RaidBlockSender(block.getBlock(), blockSize, 0, blockSize,
                              corruptChecksumOk, chunkOffsetOK, verifyChecksum,
                              transferToAllowed, metadataIn,
                              new RaidBlockSender.InputStreamFactory() {
                                @Override
                                public InputStream
                                  createStream(long offset) throws IOException {
                                  // we are passing 0 as the offset above,
                                  // so we can safely ignore
                                  // the offset passed
                                  return blockContents;
                                }
                              });
       
        DatanodeInfo[] nodes = new DatanodeInfo[]{datanode};
        new Sender(out).writeBlock(block.getBlock(), block.getBlockToken(), "",
            nodes, null, BlockConstructionStage.PIPELINE_SETUP_CREATE,
            1, 0L, blockSize, 0L, DataChecksum.newDataChecksum(metadataIn));
        blockSender.sendBlock(out, baseStream);
       
        LOG.info("Sent block " + block.getBlock() + " to " + datanode.name);
      } finally {
        out.close();
      }
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.