Package org.apache.hadoop.fs.statistics
Interface IOStatisticsContext
- All Superinterfaces:
IOStatisticsSource
- All Known Implementing Classes:
IOStatisticsContextImpl
An interface defined to capture thread-level IOStatistics by using per
thread context.
The aggregator should be collected in their constructor by statistics-generating classes to obtain the aggregator to update across all threads.
The snapshot() call creates a snapshot of the statistics;
The reset() call resets the statistics in the context so
that later snapshots will get the incremental data.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanenabled()Static probe to check if the thread-level IO statistics enabled.Get the IOStatisticsAggregator for the context.static IOStatisticsContextGet the context's IOStatisticsContext.longgetID()Get a unique ID for this context, for logging purposes.voidreset()Reset the context's IOStatistics.static voidsetThreadIOStatisticsContext(IOStatisticsContext statisticsContext) Set the IOStatisticsContext for the current thread.snapshot()Capture the snapshot of the context's IOStatistics.Methods inherited from interface org.apache.hadoop.fs.statistics.IOStatisticsSource
getIOStatistics
-
Method Details
-
getAggregator
IOStatisticsAggregator getAggregator()Get the IOStatisticsAggregator for the context.- Returns:
- return the aggregator for the context.
-
snapshot
IOStatisticsSnapshot snapshot()Capture the snapshot of the context's IOStatistics.- Returns:
- IOStatisticsSnapshot for the context.
-
getID
long getID()Get a unique ID for this context, for logging purposes.- Returns:
- an ID unique for all contexts in this process.
-
reset
void reset()Reset the context's IOStatistics. -
getCurrentIOStatisticsContext
Get the context's IOStatisticsContext.- Returns:
- instance of IOStatisticsContext for the context.
-
setThreadIOStatisticsContext
Set the IOStatisticsContext for the current thread.- Parameters:
statisticsContext- IOStatistics context instance for the current thread. If null, the context is reset.
-
enabled
static boolean enabled()Static probe to check if the thread-level IO statistics enabled.- Returns:
- if the thread-level IO statistics enabled.
-