Class InstrumentedTSocket

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public final class InstrumentedTSocket
    extends org.apache.thrift.transport.TSocket
    A simple wrapping implementation of TSocket which on all reads/writes, marks the number of bytes read/written in counters. This extends TSocket because TSocket has simple read methods rather than needing to override methods in e.g. InputStream or OutputStream. It ignores the 'buffer' related methods because the superclasses do not set it and it's optional functionality.
    • Field Summary

      • Fields inherited from class org.apache.thrift.transport.TIOStreamTransport

        inputStream_, outputStream_
      • Fields inherited from class org.apache.thrift.transport.TEndpointTransport

        knownMessageSize, remainingMessageSize
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int read​(byte[] buf, int off, int len)  
      int readAll​(byte[] buf, int off, int len)  
      void write​(byte[] buf)  
      void write​(byte[] buf, int off, int len)  
      • Methods inherited from class org.apache.thrift.transport.TSocket

        close, getSocket, isOpen, open, setConnectTimeout, setSocketTimeout, setTimeout
      • Methods inherited from class org.apache.thrift.transport.TIOStreamTransport

        flush
      • Methods inherited from class org.apache.thrift.transport.TEndpointTransport

        checkReadBytesAvailable, countConsumedMessageBytes, getConfiguration, getMaxFrameSize, getMaxMessageSize, resetConsumedMessageSize, setMaxFrameSize, updateKnownMessageSize
      • Methods inherited from class org.apache.thrift.transport.TTransport

        consumeBuffer, getBuffer, getBufferPosition, getBytesRemainingInBuffer, peek, read, write
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • read

        public int read​(byte[] buf,
                        int off,
                        int len)
                 throws org.apache.thrift.transport.TTransportException
        Overrides:
        read in class org.apache.thrift.transport.TIOStreamTransport
        Throws:
        org.apache.thrift.transport.TTransportException
      • readAll

        public int readAll​(byte[] buf,
                           int off,
                           int len)
                    throws org.apache.thrift.transport.TTransportException
        Overrides:
        readAll in class org.apache.thrift.transport.TTransport
        Throws:
        org.apache.thrift.transport.TTransportException
      • write

        public void write​(byte[] buf,
                          int off,
                          int len)
                   throws org.apache.thrift.transport.TTransportException
        Overrides:
        write in class org.apache.thrift.transport.TIOStreamTransport
        Throws:
        org.apache.thrift.transport.TTransportException
      • write

        public void write​(byte[] buf)
                   throws org.apache.thrift.transport.TTransportException
        Overrides:
        write in class org.apache.thrift.transport.TTransport
        Throws:
        org.apache.thrift.transport.TTransportException