Package org.apache.hadoop.fs.impl
Class WeakReferenceThreadMap<V>
- Type Parameters:
V- value type of the map
A WeakReferenceMap for threads.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongGet the current thread ID.Get the value for the current thread, creating if needed.Remove the reference for the current thread.setForCurrentThread(V newVal) Set the new value for the current thread.Methods inherited from class org.apache.hadoop.util.WeakReferenceMap
clear, containsKey, create, get, getEntriesCreatedCount, getReferenceLostCount, lookup, prune, put, remove, resolve, size, toString
-
Constructor Details
-
WeakReferenceThreadMap
-
-
Method Details
-
getForCurrentThread
Get the value for the current thread, creating if needed.- Returns:
- an instance.
-
removeForCurrentThread
Remove the reference for the current thread.- Returns:
- any reference value which existed.
-
currentThreadId
public long currentThreadId()Get the current thread ID.- Returns:
- thread ID.
-
setForCurrentThread
Set the new value for the current thread.- Parameters:
newVal- new reference to set for the active thread.- Returns:
- the previously set value, possibly null
-