Package org.apache.hadoop.hdfs.protocol

Examples of org.apache.hadoop.hdfs.protocol.WriteBlockHeader.writeVersionAndOpCode()


        WriteBlockHeader header = new WriteBlockHeader(
            DataTransferProtocol.DATA_TRANSFER_VERSION, dstNamespaceId,
            destinationBlock.getBlockId(),
            destinationBlock.getGenerationStamp(), 0, false, true, srcNode,
            targets.length - 1, targets, "");
        header.writeVersionAndOpCode(out);
        header.write(out);

        // send data & checksum
        blockSender.sendBlock(out, baseStream, null);
View Full Code Here


          WriteBlockHeader headerToSend = new WriteBlockHeader(
              DataTransferProtocol.DATA_TRANSFER_VERSION, namespaceid,
              block.getBlockId(), block.getGenerationStamp(), pipelineSize,
              isRecovery, hasSrcDataNode, srcDataNode, targets.length - 1, targets,
              client);
          headerToSend.writeVersionAndOpCode(mirrorOut);
          headerToSend.write(mirrorOut);
          blockReceiver.writeChecksumHeader(mirrorOut);
          mirrorOut.flush();

          // read connect ack (only for clients, not for replication req)
View Full Code Here

        int version = dfsClient.getDataTransferProtocolVersion();
        WriteBlockHeader header = new WriteBlockHeader(version,
            namespaceId, block.getBlockId(), block.getGenerationStamp(),
            pipelineDepth, recoveryFlag, false, null, pipelineDepth - 1,
            nodes, client);
        header.writeVersionAndOpCode(out);
        header.write(out);
        checksum.writeHeader(out);
        out.flush();

        // receive ack for connect
View Full Code Here

          WriteBlockHeader headerToSend = new WriteBlockHeader(
              DataTransferProtocol.DATA_TRANSFER_VERSION, namespaceid,
              block.getBlockId(), block.getGenerationStamp(), pipelineSize,
              isRecovery, hasSrcDataNode, srcDataNode, targets.length - 1, targets,
              client);
          headerToSend.writeVersionAndOpCode(mirrorOut);
          headerToSend.write(mirrorOut);
          blockReceiver.writeChecksumHeader(mirrorOut);
          mirrorOut.flush();

          // read connect ack (only for clients, not for replication req)
View Full Code Here

        WriteBlockHeader header = new WriteBlockHeader(
            DataTransferProtocol.DATA_TRANSFER_VERSION, dstNamespaceId,
            destinationBlock.getBlockId(),
            destinationBlock.getGenerationStamp(), 0, false, true, srcNode,
            targets.length - 1, targets, "");
        header.writeVersionAndOpCode(out);
        header.write(out);

        // send data & checksum
        blockSender.sendBlock(out, baseStream, null);
View Full Code Here

          int version = getDataTransferProtocolVersion();
          WriteBlockHeader header = new WriteBlockHeader(version,
              namespaceId, block.getBlockId(), block.getGenerationStamp(),
              pipelineDepth, recoveryFlag, false, null, pipelineDepth - 1,
              nodes, client);
          header.writeVersionAndOpCode(out);
          header.write(out);
          checksum.writeHeader(out);
          out.flush();

          // receive ack for connect
View Full Code Here

      WriteBlockHeader header = new WriteBlockHeader(new VersionAndOpcode(
          dataTransferVersion, DataTransferProtocol.OP_WRITE_BLOCK));
      header.set(namespaceId, block.getBlockId(), block.getGenerationStamp(),
          0, false, true, new DatanodeInfo(), 0, null, "");
      header.writeVersionAndOpCode(out);
      header.write(out);
      blockSender.sendBlock(out, baseStream, null, progress);

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

              versionAndOpcode.getDataTransferVersion(), namespaceid,
              block.getBlockId(), block.getGenerationStamp(), pipelineSize,
              isRecovery, hasSrcDataNode, srcDataNode, targets.length - 1, targets,
              client);
          headerToSend.getWritePipelineInfo().setWriteOptions(options);
          headerToSend.writeVersionAndOpCode(mirrorOut);
          headerToSend.write(mirrorOut);
          blockReceiver.writeChecksumHeader(mirrorOut);
          mirrorOut.flush();

          // read connect ack (only for clients, not for replication req)
View Full Code Here

        WriteBlockHeader header = new WriteBlockHeader(
            dataTransferVersion, dstNamespaceId,
            destinationBlock.getBlockId(),
            destinationBlock.getGenerationStamp(), 0, false, true, srcNode,
            targets.length - 1, targets, "");
        header.writeVersionAndOpCode(out);
        header.write(out);

        // send data & checksum
        DataTransferThrottler trottler = null;
        if (dataTransferMaxRate > 0) {
View Full Code Here

              pipelineDepth, recoveryFlag, false, null, pipelineDepth - 1,
              nodes, client);
          header.getWritePipelineInfo().setWriteOptions(options);
          header.getWritePipelineInfo().getWriteOptions()
              .setIfProfileEnabled(profileData != null);
          header.writeVersionAndOpCode(out);
          header.write(out);
        } else {
          AppendBlockHeader header = new AppendBlockHeader(version,
              dfsClient.namespaceId, block.getBlockId(), block.getNumBytes(),
              block.getGenerationStamp(),
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.