Examples of Sender


Examples of net.windwards.dnsfrontend.api.Sender

        Message message = Message.newQuery(Record.newRecord(new Name("foo.example.com."), Type.A, DClass.IN));
        return getQuery(replies, message);
    }

    public static Query getQuery(final List<Message> replies, Message message) throws UnknownHostException {
        Sender sender = new Sender() {
            @Override
            public void send(byte[] data, InetSocketAddress recipient) throws IOException {
                replies.add(new Message(data));
            }
        };
View Full Code Here

Examples of nexj.core.integration.Sender

            if (channel.getSender() == null)
            {
               throw new RPCException("err.rpc.notSender", new Object[]{channel.getName()});
            }

            Sender sender = (Sender)channel.getSender().getInstance(m_context);
            ObjectOutput output = sender.createOutput();

            ((MessageFormatter)message.getFormat().getFormatter().getInstance(m_context)).format((TransferObject)value, message, output);
            TransferObject tobj = new TransferObject(1);
            tobj.setValue(Sender.BODY, output.getObject());
            value = tobj;
View Full Code Here

Examples of org.apache.hadoop.hdfs.protocol.datatransfer.Sender

    // write the header.
    DataOutputStream out = new DataOutputStream(s.getOutputStream());

    DataChecksum checksum = DataChecksum.newDataChecksum(
        DataChecksum.Type.CRC32, 512);
    new Sender(out).writeBlock(block.getBlock(),
        BlockTokenSecretManager.DUMMY_TOKEN, "",
        new DatanodeInfo[0], null,
        BlockConstructionStage.PIPELINE_SETUP_CREATE, 1, 0L, 0L, 0L,
        checksum, CachingStrategy.newDefaultStrategy());
    out.flush();
View Full Code Here

Examples of org.apache.hadoop.hdfs.protocol.datatransfer.Sender

          if (LOG.isDebugEnabled()) {
            LOG.debug("write to " + datanodes[j] + ": "
                + Op.BLOCK_CHECKSUM + ", block=" + block);
          }
          // get block MD5
          new Sender(out).blockChecksum(block, lb.getBlockToken());

          final BlockOpResponseProto reply =
            BlockOpResponseProto.parseFrom(PBHelper.vintPrefixed(in));

          if (reply.getStatus() != Status.SUCCESS) {
View Full Code Here

Examples of org.apache.hadoop.hdfs.protocol.datatransfer.Sender

    try {
      DataOutputStream out = new DataOutputStream(new BufferedOutputStream(pair.out,
          HdfsConstants.SMALL_BUFFER_SIZE));
      DataInputStream in = new DataInputStream(pair.in);
 
      new Sender(out).readBlock(lb.getBlock(), lb.getBlockToken(), clientName, 0, 1, true);
      final BlockOpResponseProto reply =
          BlockOpResponseProto.parseFrom(PBHelper.vintPrefixed(in));
     
      if (reply.getStatus() != Status.SUCCESS) {
        if (reply.getStatus() == Status.ERROR_ACCESS_TOKEN) {
View Full Code Here

Examples of org.apache.hadoop.hdfs.protocol.datatransfer.Sender

        if (isBlockTokenEnabled) {
          accessToken = blockPoolTokenSecretManager.generateToken(b,
              EnumSet.of(BlockTokenSecretManager.AccessMode.WRITE));
        }

        new Sender(out).writeBlock(b, accessToken, clientname, targets, srcNode,
            stage, 0, 0, 0, 0, blockSender.getChecksum());

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

Examples of org.apache.hadoop.hdfs.protocol.datatransfer.Sender

          }
          mirrorOut = new DataOutputStream(new BufferedOutputStream(unbufMirrorOut,
              HdfsConstants.SMALL_BUFFER_SIZE));
          mirrorIn = new DataInputStream(unbufMirrorIn);

          new Sender(mirrorOut).writeBlock(originalBlock, blockToken,
              clientname, targets, srcDataNode, stage, pipelineSize,
              minBytesRcvd, maxBytesRcvd, latestGenerationStamp, requestedChecksum);

          mirrorOut.flush();
View Full Code Here

Examples of org.apache.hadoop.hdfs.protocol.datatransfer.Sender

          HdfsConstants.SMALL_BUFFER_SIZE));
      proxyReply = new DataInputStream(new BufferedInputStream(unbufProxyIn,
          HdfsConstants.IO_FILE_BUFFER_SIZE));

      /* send request to the proxy */
      new Sender(proxyOut).copyBlock(block, blockToken);

      // receive the response from the proxy
     
      BlockOpResponseProto copyResponse = BlockOpResponseProto.parseFrom(
          HdfsProtoUtil.vintPrefixed(proxyReply));
View Full Code Here

Examples of org.apache.hadoop.hdfs.protocol.datatransfer.Sender

        out = new DataOutputStream(new BufferedOutputStream(unbufOut,
            HdfsConstants.SMALL_BUFFER_SIZE));
        in = new DataInputStream(unbufIn);

        //send the TRANSFER_BLOCK request
        new Sender(out).transferBlock(block, blockToken, dfsClient.clientName,
            targets);
        out.flush();

        //ack
        BlockOpResponseProto response =
View Full Code Here

Examples of org.apache.hadoop.hdfs.protocol.datatransfer.Sender

          //
          // Xmit header info to datanode
          //
 
          // send the request
          new Sender(out).writeBlock(block, accessToken, dfsClient.clientName,
              nodes, null, recoveryFlag? stage.getRecoveryStage() : stage,
              nodes.length, block.getNumBytes(), bytesSent, newGS, checksum);
 
          // receive ack for connect
          BlockOpResponseProto resp = BlockOpResponseProto.parseFrom(
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.