hadoop/hadoop-tools/hadoop-aws
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 HADOOP-17409. Remove s3guard from S3A module (#3534) 2022-01-18 18:04:48 +00:00
src HADOOP-18091. S3A auditing leaks memory through ThreadLocal references (#3930) 2022-02-10 12:33:40 +00:00
pom.xml HADOOP-17409. Remove s3guard from S3A module (#3534) 2022-01-18 18:04:48 +00:00