accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Havanki (JIRA)" <>
Subject [jira] [Created] (ACCUMULO-2419) Improve SimpleTimer by replacing java.util.Timer
Date Thu, 27 Feb 2014 17:27:20 GMT
Bill Havanki created ACCUMULO-2419:

             Summary: Improve SimpleTimer by replacing java.util.Timer
                 Key: ACCUMULO-2419
             Project: Accumulo
          Issue Type: Improvement
          Components: tserver
            Reporter: Bill Havanki
            Priority: Minor

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

bq. {{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.

This message was sent by Atlassian JIRA

View raw message