accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ACCUMULO-2419) Improve SimpleTimer by replacing java.util.Timer
Date Tue, 18 Mar 2014 13:49:43 GMT

    [ https://issues.apache.org/jira/browse/ACCUMULO-2419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13939205#comment-13939205
] 

ASF subversion and git services commented on ACCUMULO-2419:
-----------------------------------------------------------

Commit 3bd0caa5877e16fd3ff98863040dc6eb67fdeef2 in accumulo's branch refs/heads/master from
[~bhavanki]
[ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=3bd0caa ]

ACCUMULO-2419 Reimplement SimpleTimer using executors

The SimpleTimer class is changed to use Java's executor service for thread pools, rather
than java.util.Timer. This allows Accumulo to run SimpleTimer threads using more than
one thread, for systems that can handle the load.

This change also transitions a wide variety of SimpleTimer users to use the new form of the
SimpleTimer.getInstance() method.


> Improve SimpleTimer by replacing java.util.Timer
> ------------------------------------------------
>
>                 Key: ACCUMULO-2419
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-2419
>             Project: Accumulo
>          Issue Type: Improvement
>          Components: tserver
>            Reporter: Bill Havanki
>            Assignee: Bill Havanki
>            Priority: Minor
>              Labels: performance
>
> 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
(v6.2#6252)

Mime
View raw message