java.lang.Object
org.elasticsearch.transport.LeakTracker
Leak tracking mechanism that allows for ensuring that a resource has been properly released before a given object is garbage collected.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic void
setContextHint
(String hint) Set a hint string that will be recorded with every leak that is recorded.Track the given object.static RefCounted
wrap
(RefCounted refCounted) static Releasable
wrap
(Releasable releasable)
-
Field Details
-
INSTANCE
-
-
Method Details
-
track
Track the given object.- Parameters:
obj
- object to track- Returns:
- leak object that must be released by a call to
LeakTracker.Leak.close()
beforeobj
goes out of scope
-
setContextHint
Set a hint string that will be recorded with every leak that is recorded. Used by unit tests to allow identifying the exact test that caused a leak by setting the test name here.- Parameters:
hint
- hint value
-
wrap
-
wrap
-