Interface S3AInputStreamStatistics

All Superinterfaces:
AutoCloseable, org.apache.hadoop.fs.statistics.DurationTrackerFactory, org.apache.hadoop.fs.statistics.IOStatisticsSource, org.apache.hadoop.fs.impl.prefetch.PrefetchingStatistics, S3AStatisticInterface

public interface S3AInputStreamStatistics extends AutoCloseable, S3AStatisticInterface, org.apache.hadoop.fs.impl.prefetch.PrefetchingStatistics
Statistics updated by a S3AInputStream during its use. It also contains getters for tests.
  • Method Details

    • seekBackwards

      void seekBackwards(long negativeOffset)
      Seek backwards, incrementing the seek and backward seek counters.
      Parameters:
      negativeOffset - how far was the seek? This is expected to be negative.
    • seekForwards

      void seekForwards(long skipped, long bytesReadInSeek)
      Record a forward seek, adding a seek operation, a forward seek operation, and any bytes skipped.
      Parameters:
      skipped - bytes moved forward in stream
      bytesReadInSeek - number of bytes skipped by reading from the stream. If the seek was implemented by a close + reopen, set this to zero.
    • streamOpened

      long streamOpened()
      The inner stream was opened. The return value is used in the input stream to decide whether it is the initial vs later count.
      Returns:
      the previous count or zero if this is the first opening.
    • streamOpened

      long streamOpened(InputStreamType type)
      A stream of the given type was opened.
      Parameters:
      type - type of input stream
      Returns:
      the previous count or zero if this is the first opening.
    • streamClose

      void streamClose(boolean abortedConnection, long remainingInCurrentRequest)
      The inner stream was closed.
      Parameters:
      abortedConnection - flag to indicate the stream was aborted, rather than closed cleanly
      remainingInCurrentRequest - the number of bytes remaining in the current request.
    • readException

      void readException()
      An ignored stream read exception was received.
    • bytesRead

      void bytesRead(long bytes)
      Increment the bytes read counter by the number of bytes; no-op if the argument is negative.
      Parameters:
      bytes - number of bytes read
    • readOperationStarted

      void readOperationStarted(long pos, long len)
      A read(byte[] buf, int off, int len) operation has started.
      Parameters:
      pos - starting position of the read
      len - length of bytes to read
    • readFullyOperationStarted

      void readFullyOperationStarted(long pos, long len)
      A PositionedRead.read(position, buffer, offset, length) operation has just started.
      Parameters:
      pos - starting position of the read
      len - length of bytes to read
    • readOperationCompleted

      void readOperationCompleted(int requested, int actual)
      A read operation has completed.
      Parameters:
      requested - number of requested bytes
      actual - the actual number of bytes
    • readVectoredOperationStarted

      void readVectoredOperationStarted(int numIncomingRanges, int numCombinedRanges)
      A vectored read operation has started..
      Parameters:
      numIncomingRanges - number of input ranges.
      numCombinedRanges - number of combined ranges.
    • readVectoredBytesDiscarded

      void readVectoredBytesDiscarded(int discarded)
      Number of bytes discarded during vectored read.
      Parameters:
      discarded - discarded bytes during vectored read.
    • getRequestInitiated

      void getRequestInitiated()
      Number of S3 GET requests initiated by the stream.
    • headRequestInitiated

      void headRequestInitiated()
      Number of S3 HEAD requests initiated by the stream.
    • bytesPrefetched

      void bytesPrefetched(long size)
      Number of bytes prefetched.
      Parameters:
      size - number of bytes prefetched.
    • footerParsingFailed

      void footerParsingFailed()
      Number of failures in footer parsing.
    • streamReadCacheHit

      void streamReadCacheHit()
      If the request data is already in the data cache.
    • close

      void close()
      Specified by:
      close in interface AutoCloseable
    • inputPolicySet

      void inputPolicySet(int updatedPolicy)
      The input policy has been switched.
      Parameters:
      updatedPolicy - enum value of new policy.
    • getChangeTrackerStatistics

      ChangeTrackerStatistics getChangeTrackerStatistics()
      Get a reference to the change tracker statistics for this stream.
      Returns:
      a reference to the change tracker statistics
    • unbuffered

      void unbuffered()
      A stream unbuffer() call has been made.
    • getCloseOperations

      long getCloseOperations()
    • getClosed

      long getClosed()
    • getAborted

      long getAborted()
    • getForwardSeekOperations

      long getForwardSeekOperations()
    • getBackwardSeekOperations

      long getBackwardSeekOperations()
    • getBytesRead

      long getBytesRead()
      The bytes read in read() operations.
      Returns:
      the number of bytes returned to the caller.
    • getTotalBytesRead

      long getTotalBytesRead()
      The total number of bytes read, including all read and discarded when closing streams or skipped during seek calls.
      Returns:
      the total number of bytes read from S3.
    • getBytesSkippedOnSeek

      long getBytesSkippedOnSeek()
    • getBytesBackwardsOnSeek

      long getBytesBackwardsOnSeek()
    • getBytesReadInClose

      long getBytesReadInClose()
    • getBytesDiscardedInAbort

      long getBytesDiscardedInAbort()
    • getOpenOperations

      long getOpenOperations()
    • getSeekOperations

      long getSeekOperations()
    • getReadExceptions

      long getReadExceptions()
    • getReadOperations

      long getReadOperations()
    • getReadFullyOperations

      long getReadFullyOperations()
    • getReadsIncomplete

      long getReadsIncomplete()
    • getPolicySetCount

      long getPolicySetCount()
    • getVersionMismatches

      long getVersionMismatches()
    • getInputPolicy

      long getInputPolicy()
    • lookupCounterValue

      Long lookupCounterValue(String name)
      Get the value of a counter.
      Parameters:
      name - counter name
      Returns:
      the value or null if no matching counter was found.
    • lookupGaugeValue

      Long lookupGaugeValue(String name)
      Get the value of a gauge.
      Parameters:
      name - gauge name
      Returns:
      the value or null if no matching gauge was found.
    • initiateGetRequest

      org.apache.hadoop.fs.statistics.DurationTracker initiateGetRequest()
      Initiate a GET request.
      Returns:
      duration tracker;
    • initiateInnerStreamClose

      org.apache.hadoop.fs.statistics.DurationTracker initiateInnerStreamClose(boolean abort)
      Initiate a stream close/abort.
      Parameters:
      abort - was the stream aborted?
      Returns:
      duration tracker;
    • streamLeaked

      default void streamLeaked()
      Stream was leaked.