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

          Bill Havanki created issue -
          Bill Havanki made changes -
          Field Original Value New Value
          Assignee Bill Havanki [ bhavanki ]
          Bill Havanki made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Bill Havanki made changes -
          Status In Progress [ 3 ] Open [ 1 ]
          Bill Havanki made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Bill Havanki made changes -
          Remote Link This issue links to "Review (Web Link)" [ 14526 ]
          Bill Havanki made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          John Vines made changes -
          Fix Version/s 1.7.0 [ 12324607 ]
          Mike Drob made changes -
          Link This issue is duplicated by ACCUMULO-2502 [ ACCUMULO-2502 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development