[
https://issues.apache.org/jira/browse/HBASE-6476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13425437#comment-13425437
]
Lars Hofhansl commented on HBASE-6476:
--------------------------------------
Write a quick script that performs the replace.
155 files are changed.
A quick check reveals some cases of {code}new
Random(EnvironmentEdgeManager.currentTimeMillis()){code}, which would not need
to change (but it does not hurt and would lead to repeatable random numbers in
tests).
There are also fragment like this one found in TestZooKepper:
{code}
while (EnvironmentEdgeManager.currentTimeMillis() < limit1 && state !=
States.CLOSED){
state = connectionZK.getRecoverableZooKeeper().getState();
}
{code}
Which would hang forever if time does not progress.
I also assume it's OK to requite o.a.h.h.util.EnvironmentEdgeManager in all
changed client and server classes.
> Replace all occurrances of System.currentTimeMillis() with EnvironmentEdge
> equivalent
> -------------------------------------------------------------------------------------
>
> Key: HBASE-6476
> URL: https://issues.apache.org/jira/browse/HBASE-6476
> Project: HBase
> Issue Type: Bug
> Reporter: Lars Hofhansl
> Assignee: Lars Hofhansl
> Priority: Minor
> Fix For: 0.94.2
>
>
> There are still some areas where System.currentTimeMillis() is used in HBase.
> In order to make all parts of the code base testable and (potentially) to be
> able to configure HBase's notion of time, this should be generally be
> replaced with EnvironmentEdgeManager.currentTimeMillis().
> How hard would it be to add a maven task that checks for that, so we do not
> introduce System.currentTimeMillis back in the future?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira