Class AbstractOperationAuditor
java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.fs.s3a.audit.impl.AbstractOperationAuditor
- All Implemented Interfaces:
Closeable,AutoCloseable,OperationAuditor,org.apache.hadoop.fs.statistics.IOStatisticsSource,org.apache.hadoop.fs.store.audit.AuditSpanSource<AuditSpanS3A>,org.apache.hadoop.service.Service
- Direct Known Subclasses:
LoggingAuditor,NoopAuditor
public abstract class AbstractOperationAuditor
extends org.apache.hadoop.service.AbstractService
implements OperationAuditor
This is a long-lived service which is created in S3A FS initialize
(make it fast!) which provides context for tracking operations made to S3.
An IOStatisticsStore is passed in -in production this is expected to
be the S3AFileSystem instrumentation, which will have the
AUDIT_SPAN_START statistic configured for counting durations.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidauditorFlagsChanged(EnumSet<AuditorFlags> flags) Notification that the auditor flags have been updated.protected final StringCreate a span ID.Get the current set of auditor flags.Get the Auditor ID.org.apache.hadoop.fs.statistics.impl.IOStatisticsStoreGet the IOStatistics Store.protected OperationAuditorOptionsGet the options this auditor was initialized with.voidinit(OperationAuditorOptions opts) Sets the IOStats and then calls init().protected booleanShould out of scope ops be rejected?protected voidserviceInit(org.apache.hadoop.conf.Configuration conf) voidsetAuditFlags(EnumSet<AuditorFlags> flags) Update Auditor flags.protected voidsetRejectOutOfSpan(boolean rejectOutOfSpan) Enable/disable out of span rejection.Methods inherited from class org.apache.hadoop.service.AbstractService
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, serviceStart, serviceStop, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hadoop.fs.store.audit.AuditSpanSource
createSpanMethods inherited from interface org.apache.hadoop.fs.s3a.audit.OperationAuditor
checkAccess, getUnbondedSpan, noteSpanReferenceLostMethods inherited from interface org.apache.hadoop.service.Service
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, registerServiceListener, start, stop, unregisterServiceListener, waitForServiceToStop
-
Field Details
-
BASE
Base of IDs is a UUID.
-
-
Constructor Details
-
AbstractOperationAuditor
Construct.- Parameters:
name- name
-
-
Method Details
-
init
Sets the IOStats and then calls init().- Specified by:
initin interfaceOperationAuditor- Parameters:
opts- options to initialize with.
-
serviceInit
- Overrides:
serviceInitin classorg.apache.hadoop.service.AbstractService- Throws:
Exception
-
getAuditorId
Description copied from interface:OperationAuditorGet the Auditor ID.- Specified by:
getAuditorIdin interfaceOperationAuditor- Returns:
- ID
-
getIOStatistics
public org.apache.hadoop.fs.statistics.impl.IOStatisticsStore getIOStatistics()Get the IOStatistics Store.- Specified by:
getIOStatisticsin interfaceorg.apache.hadoop.fs.statistics.IOStatisticsSource- Returns:
- the IOStatistics store updated with statistics.
-
getOptions
Get the options this auditor was initialized with.- Returns:
- options.
-
createSpanID
Create a span ID.- Returns:
- a unique span ID.
-
isRejectOutOfSpan
protected boolean isRejectOutOfSpan()Should out of scope ops be rejected?- Returns:
- true if out of span calls should be rejected.
-
setRejectOutOfSpan
protected void setRejectOutOfSpan(boolean rejectOutOfSpan) Enable/disable out of span rejection.- Parameters:
rejectOutOfSpan- new value.
-
setAuditFlags
Update Auditor flags. CallsauditorFlagsChanged(EnumSet)after the update.- Specified by:
setAuditFlagsin interfaceOperationAuditor- Parameters:
flags- audit flags.
-
getAuditorFlags
Get the current set of auditor flags.- Returns:
- the current set of auditor flags.
-
auditorFlagsChanged
Notification that the auditor flags have been updated.- Parameters:
flags- audit flags.
-