hadoop/hadoop-common-project
Steve Loughran 088684ec60
HADOOP-18091. S3A auditing leaks memory through ThreadLocal references (#3930)
Adds a new map type WeakReferenceMap, which stores weak
references to values, and a WeakReferenceThreadMap subclass
to more closely resemble a thread local type, as it is a
map of threadId to value.

Construct it with a factory method and optional callback
for notification on loss and regeneration.

 WeakReferenceThreadMap<WrappingAuditSpan> activeSpan =
      new WeakReferenceThreadMap<>(
          (k) -> getUnbondedSpan(),
          this::noteSpanReferenceLost);

This is used in ActiveAuditManagerS3A for span tracking.

Relates to
* HADOOP-17511. Add an Audit plugin point for S3A
* HADOOP-18094. Disable S3A auditing by default.

Contributed by Steve Loughran.

Change-Id: Ibf7bb082fd47298f7ebf46d92f56e80ca9b2aaf8
2022-02-10 12:33:40 +00:00
..
hadoop-annotations Preparing for 3.3.3 development 2021-11-16 16:02:34 -08:00
hadoop-auth Preparing for 3.3.3 development 2021-11-16 16:02:34 -08:00
hadoop-auth-examples Preparing for 3.3.3 development 2021-11-16 16:02:34 -08:00
hadoop-common HADOOP-18091. S3A auditing leaks memory through ThreadLocal references (#3930) 2022-02-10 12:33:40 +00:00
hadoop-kms HADOOP-18040. Use maven.test.failure.ignore instead of ignoreTestFailure (#3774) 2021-12-10 01:38:26 +09:00
hadoop-minikdc Preparing for 3.3.3 development 2021-11-16 16:02:34 -08:00
hadoop-nfs Preparing for 3.3.3 development 2021-11-16 16:02:34 -08:00
hadoop-registry HADOOP-18040. Use maven.test.failure.ignore instead of ignoreTestFailure (#3774) 2021-12-10 01:38:26 +09:00
pom.xml Preparing for 3.3.3 development 2021-11-16 16:02:34 -08:00