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 Summary
Modifier and TypeMethodDescriptionvoidbytesPrefetched(long size) Number of bytes prefetched.voidbytesRead(long bytes) Increment the bytes read counter by the number of bytes; no-op if the argument is negative.voidclose()voidNumber of failures in footer parsing.longlonglonglonglongThe bytes read in read() operations.longlongGet a reference to the change tracker statistics for this stream.longlonglonglonglonglonglonglonglonglongvoidNumber of S3 GET requests initiated by the stream.longlongThe total number of bytes read, including all read and discarded when closing streams or skipped during seek calls.longvoidNumber of S3 HEAD requests initiated by the stream.org.apache.hadoop.fs.statistics.DurationTrackerInitiate a GET request.org.apache.hadoop.fs.statistics.DurationTrackerinitiateInnerStreamClose(boolean abort) Initiate a stream close/abort.voidinputPolicySet(int updatedPolicy) The input policy has been switched.lookupCounterValue(String name) Get the value of a counter.lookupGaugeValue(String name) Get the value of a gauge.voidAn ignored stream read exception was received.voidreadFullyOperationStarted(long pos, long len) APositionedRead.read(position, buffer, offset, length)operation has just started.voidreadOperationCompleted(int requested, int actual) A read operation has completed.voidreadOperationStarted(long pos, long len) Aread(byte[] buf, int off, int len)operation has started.voidreadVectoredBytesDiscarded(int discarded) Number of bytes discarded during vectored read.voidreadVectoredOperationStarted(int numIncomingRanges, int numCombinedRanges) A vectored read operation has started..voidseekBackwards(long negativeOffset) Seek backwards, incrementing the seek and backward seek counters.voidseekForwards(long skipped, long bytesReadInSeek) Record a forward seek, adding a seek operation, a forward seek operation, and any bytes skipped.voidstreamClose(boolean abortedConnection, long remainingInCurrentRequest) The inner stream was closed.default voidStream was leaked.longThe inner stream was opened.longstreamOpened(InputStreamType type) A stream of the given type was opened.voidIf the request data is already in the data cache.voidA streamunbuffer()call has been made.Methods inherited from interface org.apache.hadoop.fs.statistics.DurationTrackerFactory
trackDuration, trackDurationMethods inherited from interface org.apache.hadoop.fs.statistics.IOStatisticsSource
getIOStatisticsMethods inherited from interface org.apache.hadoop.fs.impl.prefetch.PrefetchingStatistics
blockAddedToFileCache, blockEvictedFromFileCache, blockRemovedFromFileCache, executorAcquired, memoryAllocated, memoryFreed, prefetchOperationCompleted, prefetchOperationStarted
-
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 streambytesReadInSeek- 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
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 cleanlyremainingInCurrentRequest- 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) Aread(byte[] buf, int off, int len)operation has started.- Parameters:
pos- starting position of the readlen- length of bytes to read
-
readFullyOperationStarted
void readFullyOperationStarted(long pos, long len) APositionedRead.read(position, buffer, offset, length)operation has just started.- Parameters:
pos- starting position of the readlen- length of bytes to read
-
readOperationCompleted
void readOperationCompleted(int requested, int actual) A read operation has completed.- Parameters:
requested- number of requested bytesactual- 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.
-
streamReadCacheHit
void streamReadCacheHit()If the request data is already in the data cache. -
close
void close()- Specified by:
closein interfaceAutoCloseable
-
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 streamunbuffer()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
Get the value of a counter.- Parameters:
name- counter name- Returns:
- the value or null if no matching counter was found.
-
lookupGaugeValue
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.
-