hadoop/hadoop-common-project/hadoop-common
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
..
dev-support Make upstream aware of 3.2.2 release. 2021-01-09 18:07:10 +08:00
src HADOOP-18091. S3A auditing leaks memory through ThreadLocal references (#3930) 2022-02-10 12:33:40 +00:00
HadoopCommon.cmake HADOOP-17196. Fix C/C++ standard warnings (#2208) 2020-08-11 16:35:41 +09:00
HadoopJNI.cmake
pom.xml HADOOP-18040. Use maven.test.failure.ignore instead of ignoreTestFailure (#3774) 2021-12-10 01:38:26 +09:00