Class BondedS3AStatisticsContext
java.lang.Object
org.apache.hadoop.fs.s3a.statistics.impl.BondedS3AStatisticsContext
- All Implemented Interfaces:
CountersAndGauges,S3AStatisticsContext,org.apache.hadoop.fs.statistics.DurationTrackerFactory
An S3A statistics context which is bonded to a
S3AInstrumentation instance -inevitably that of an S3AFileSystem
instance.
An interface is used to bind to the relevant fields, rather than have them passed in the constructor because some production code, specifically, DelegateToFileSystem, patches the protected field after initialization.
All operations are passed through directly to that class.
If an instance of FileSystem.Statistics is passed in, it will be used whenever input stream statistics are created - However, Internally always increments the statistics in the current thread.
As a result, cross-thread IO will under-report.
This is addressed through the stream statistics classes only updating the stats in the close() call. Provided they are closed in the worker thread, all stats collected in helper threads will be included.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThis is the interface which an integration source must implement for the integration. -
Constructor Summary
ConstructorsConstructorDescriptionBondedS3AStatisticsContext(BondedS3AStatisticsContext.S3AFSStatisticsSource statisticsSource) Instantiate. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddValueToQuantiles(Statistic op, long value) Add a value to a quantiles statistic.Creaet a multipart statistics collector.voiddecrementGauge(Statistic op, long count) Decrement a specific gauge.voidincrementCounter(Statistic op, long count) Increment a specific counter.voidincrementGauge(Statistic op, long count) Increment a specific gauge.Create a new instance of the committer statistics.Create a delegation token statistics instance.Create a stream input statistics instance.Create a stream output statistics instance.Create a StatisticsFromAwsSdk instance.voidrecordDuration(Statistic op, boolean success, Duration duration) Record a duration.org.apache.hadoop.fs.statistics.DurationTrackertrackDuration(String key, long count) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.fs.statistics.DurationTrackerFactory
trackDuration
-
Constructor Details
-
BondedS3AStatisticsContext
public BondedS3AStatisticsContext(BondedS3AStatisticsContext.S3AFSStatisticsSource statisticsSource) Instantiate.- Parameters:
statisticsSource- integration binding
-
-
Method Details
-
newInputStreamStatistics
Create a stream input statistics instance. The FileSystem.Statistics instance of thestatisticsSourceis used as the reference to FileSystem statistics to update- Specified by:
newInputStreamStatisticsin interfaceS3AStatisticsContext- Returns:
- the new instance
-
newCommitterStatistics
Create a new instance of the committer statistics.- Specified by:
newCommitterStatisticsin interfaceS3AStatisticsContext- Returns:
- a new committer statistics instance
-
newOutputStreamStatistics
Create a stream output statistics instance.- Specified by:
newOutputStreamStatisticsin interfaceS3AStatisticsContext- Returns:
- the new instance
-
incrementCounter
Increment a specific counter.No-op if not defined.
- Specified by:
incrementCounterin interfaceCountersAndGauges- Parameters:
op- operationcount- increment value
-
incrementGauge
Increment a specific gauge.No-op if not defined.
- Specified by:
incrementGaugein interfaceCountersAndGauges- Parameters:
op- operationcount- increment value- Throws:
ClassCastException- if the metric is of the wrong type
-
decrementGauge
Decrement a specific gauge.No-op if not defined.
- Specified by:
decrementGaugein interfaceCountersAndGauges- Parameters:
op- operationcount- increment value- Throws:
ClassCastException- if the metric is of the wrong type
-
addValueToQuantiles
Add a value to a quantiles statistic. No-op if the quantile isn't found.- Specified by:
addValueToQuantilesin interfaceCountersAndGauges- Parameters:
op- operation to look up.value- value to add.- Throws:
ClassCastException- if the metric is not a Quantiles.
-
recordDuration
Description copied from interface:CountersAndGaugesRecord a duration.- Specified by:
recordDurationin interfaceCountersAndGauges- Parameters:
op- operationsuccess- was the operation a success?duration- how long did it take
-
newDelegationTokenStatistics
Create a delegation token statistics instance.- Specified by:
newDelegationTokenStatisticsin interfaceS3AStatisticsContext- Returns:
- an instance of delegation token statistics
-
newStatisticsFromAwsSdk
Description copied from interface:S3AStatisticsContextCreate a StatisticsFromAwsSdk instance.- Specified by:
newStatisticsFromAwsSdkin interfaceS3AStatisticsContext- Returns:
- an instance of StatisticsFromAwsSdk
-
createMultipartUploaderStatistics
Description copied from interface:S3AStatisticsContextCreaet a multipart statistics collector.- Specified by:
createMultipartUploaderStatisticsin interfaceS3AStatisticsContext- Returns:
- an instance
-
trackDuration
- Specified by:
trackDurationin interfaceorg.apache.hadoop.fs.statistics.DurationTrackerFactory
-