Accumulo
  1. Accumulo
  2. ACCUMULO-2419

Improve SimpleTimer by replacing java.util.Timer

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.0
    • Component/s: tserver
    • Labels:

      Description

      The server utility class SimpleTimer uses a java.util.Timer under the hood for scheduling tasks. From Java Concurrency in Practice, p. 123:

      Timer has some drawbacks, and ScheduledThreadPoolExecutor should be thought of as its replacement. ... there is little reason to use Timer in Java 5.0 or later.

      The purpose of SimpleTimer is "to reduce the number of threads dedicated to simple events", but a user cannot opt to let more than one thread handle the events on systems that can take the load. Also, if any task does take a long time for some reason, execution of other tasks is affected.

      The Timer in SimpleTimer should be replaced with ScheduledThreadPoolExecutor, and the class should allow for more than one thread to be used for task execution.

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Bill Havanki
              Reporter:
              Bill Havanki
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development