Examples of transferToFully()


Examples of org.apache.hadoop.net.SocketOutputStream.transferToFully()

          SocketOutputStream sockOut = (SocketOutputStream)out;
          //first write the packet
          sockOut.write(buf, 0, dataOff);
          // no need to flush. since we know out is not a buffered stream.

          sockOut.transferToFully(((FileInputStream)blockIn).getChannel(),
                                  blockInPosition, len);

          blockInPosition += len;
        } else {
          // normal transfer
View Full Code Here

Examples of org.apache.hadoop.net.SocketOutputStream.transferToFully()

       
        // no need to flush since we know out is not a buffered stream
        FileChannel fileCh = ((FileInputStream)blockIn).getChannel();
        LongWritable waitTime = new LongWritable();
        LongWritable transferTime = new LongWritable();
        sockOut.transferToFully(fileCh, blockInPosition, dataLen,
            waitTime, transferTime);
        datanode.metrics.addSendDataPacketBlockedOnNetworkNanos(waitTime.get());
        datanode.metrics.addSendDataPacketTransferNanos(transferTime.get());
        blockInPosition += dataLen;
      } else {
View Full Code Here

Examples of org.apache.hadoop.net.SocketOutputStream.transferToFully()

        SocketOutputStream sockOut = (SocketOutputStream)out;
        //first write the packet
        sockOut.write(buf, 0, dataOff);
        // no need to flush. since we know out is not a buffered stream.

        sockOut.transferToFully(((FileInputStream)blockIn).getChannel(),
                                blockInPosition, len);

        blockInPosition += len;
      } else {
        // normal transfer
View Full Code Here

Examples of org.apache.hadoop.net.SocketOutputStream.transferToFully()

      if (transferTo) {
        SocketOutputStream sockOut = (SocketOutputStream)out;
        sockOut.write(buf, 0, dataOff); // First write checksum
       
        // no need to flush. since we know out is not a buffered stream.
        sockOut.transferToFully(((FileInputStream)blockIn).getChannel(),
                                blockInPosition, dataLen);
        blockInPosition += dataLen;
      } else {
        // normal transfer
        out.write(buf, 0, dataOff + dataLen);
View Full Code Here

Examples of org.apache.hadoop.net.SocketOutputStream.transferToFully()

          sockOut.write(buf, 0, dataOff + len);
        } else {
          //first write the packet
          sockOut.write(buf, 0, dataOff);
          // no need to flush. since we know out is not a buffered stream.
          sockOut.transferToFully(fileChannel, blockInPosition, len);
        }

        blockInPosition += len;

      } catch (IOException e) {
View Full Code Here

Examples of org.apache.hadoop.net.SocketOutputStream.transferToFully()

        SocketOutputStream sockOut = (SocketOutputStream)out;
        //first write the packet
        sockOut.write(buf, 0, dataOff);
        // no need to flush. since we know out is not a buffered stream.

        sockOut.transferToFully(((FileInputStream)blockIn).getChannel(),
                                blockInPosition, len);

        blockInPosition += len;
      } else {
        // normal transfer
View Full Code Here

Examples of org.apache.hadoop.net.SocketOutputStream.transferToFully()

       
        // no need to flush since we know out is not a buffered stream
        FileChannel fileCh = ((FileInputStream)blockIn).getChannel();
        LongWritable waitTime = new LongWritable();
        LongWritable transferTime = new LongWritable();
        sockOut.transferToFully(fileCh, blockInPosition, dataLen,
            waitTime, transferTime);
        datanode.metrics.addSendDataPacketBlockedOnNetworkNanos(waitTime.get());
        datanode.metrics.addSendDataPacketTransferNanos(transferTime.get());
        blockInPosition += dataLen;
      } else {
View Full Code Here

Examples of org.apache.hadoop.net.SocketOutputStream.transferToFully()

      if (transferTo) {
        SocketOutputStream sockOut = (SocketOutputStream)out;
        sockOut.write(buf, 0, dataOff); // First write checksum
       
        // no need to flush. since we know out is not a buffered stream.
        sockOut.transferToFully(((FileInputStream)blockIn).getChannel(),
                                blockInPosition, dataLen);
        blockInPosition += dataLen;
      } else {
        // normal transfer
        out.write(buf, 0, dataOff + dataLen);
View Full Code Here

Examples of org.apache.hadoop.net.SocketOutputStream.transferToFully()

          sockOut.write(buf, 0, dataOff + len);
        } else {
          //first write the packet
          sockOut.write(buf, 0, dataOff);
          // no need to flush. since we know out is not a buffered stream.
          sockOut.transferToFully(fileChannel, blockInPosition, len);
        }

        blockInPosition += len;

      } catch (IOException e) {
View Full Code Here

Examples of org.apache.hadoop.net.SocketOutputStream.transferToFully()

      if (transferTo) {
        SocketOutputStream sockOut = (SocketOutputStream)out;
        sockOut.write(buf, 0, dataOff); // First write checksum
       
        // no need to flush. since we know out is not a buffered stream.
        sockOut.transferToFully(((FileInputStream)blockIn).getChannel(),
                                blockInPosition, dataLen);
        blockInPosition += dataLen;
      } else {
        // normal transfer
        out.write(buf, 0, dataOff + dataLen);
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.