Uploaded image for project: 'Hadoop Map/Reduce'
  1. Hadoop Map/Reduce
  2. MAPREDUCE-471

Refactor JobTracker.Expire* arround an utility class

    XMLWordPrintableJSON

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

        1. ExpiringHashSet.patch
          27 kB
          Brice Arnould

        Issue Links

          Activity

            People

              Unassigned Unassigned
              un_brice Brice Arnould
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: