Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Not A Problem
-
None
-
None
-
None
-
None
Description
I would like to propose a new class, called ExpiringHashSet, which could factorize the code from JobTracker.ExpireLaunchingTasks and JobTracker.ExpireTrackers.
It behaves like an ordinary HashSet, but adds two methods and one argument to the constructor.
That argument, lifeTime, tells after how much milliseconds an element added to the container expire and is removed.
The first method, update(element), takes an element as it argument and delay it's expiration by lifeTime milliseconds.
The last method, makeExpire is called by the ExpiringHashSet just before it remove an old item. If that method return false, the item won't be removed.
Nothing expire while we're synchronized on the ExpiringHashSet.
Attachments
Attachments
Issue Links
- relates to
-
HADOOP-3608 Make the JobTracker reentrant
- Resolved