HBASE-11822 Convert EnvironmentEdge#getCurrentTimeMillis to getCurrentTime

This commit is contained in:
stack 2014-08-29 17:30:02 -07:00
parent 7ac9cbbca0
commit 1834196fcb
3 changed files with 9 additions and 9 deletions

View File

@ -225,7 +225,7 @@ public class ZkRegionMergeCoordination implements RegionMergeCoordination {
transitionMergingNode(mergedRegionInfo, region_a.getRegionInfo(), region_b.getRegionInfo(),
manager.getServer().getServerName(), rmd, RS_ZK_REGION_MERGING, RS_ZK_REGION_MERGED);
long startTime = EnvironmentEdgeManager.currentTimeMillis();
long startTime = EnvironmentEdgeManager.currentTime();
int spins = 0;
// Now wait for the master to process the merge. We know it's done
// when the znode is deleted. The reason we keep tickling the znode is
@ -234,7 +234,7 @@ public class ZkRegionMergeCoordination implements RegionMergeCoordination {
if (spins % 10 == 0) {
LOG.debug("Still waiting on the master to process the merge for "
+ mergedRegionInfo.getEncodedName() + ", waited "
+ (EnvironmentEdgeManager.currentTimeMillis() - startTime) + "ms");
+ (EnvironmentEdgeManager.currentTime() - startTime) + "ms");
}
Thread.sleep(100);
// When this returns -1 it means the znode doesn't exist

View File

@ -151,8 +151,8 @@ public class SplitLogWorker extends ZooKeeperListener implements Runnable {
return Status.RESIGNED;
} catch (IOException e) {
Throwable cause = e.getCause();
if (e instanceof RetriesExhaustedException && (cause instanceof NotServingRegionException
|| cause instanceof ConnectException
if (e instanceof RetriesExhaustedException && (cause instanceof NotServingRegionException
|| cause instanceof ConnectException
|| cause instanceof SocketTimeoutException)) {
LOG.warn("log replaying of " + filename + " can't connect to the target regionserver, "
+ "resigning", e);
@ -454,7 +454,7 @@ public class SplitLogWorker extends ZooKeeperListener implements Runnable {
@Override
public boolean progress() {
long t = EnvironmentEdgeManager.currentTimeMillis();
long t = EnvironmentEdgeManager.currentTime();
if ((t - last_report_at) > reportPeriod) {
last_report_at = t;
int latestZKVersion = attemptToOwnTask(false, watcher, serverName, curTask, mode,
@ -468,8 +468,8 @@ public class SplitLogWorker extends ZooKeeperListener implements Runnable {
return true;
}
};
HLogSplitterHandler hsh = new HLogSplitterHandler(this.server, curTask, zkVersion, reporter,
HLogSplitterHandler hsh = new HLogSplitterHandler(this.server, curTask, zkVersion, reporter,
this.tasksInProgress, this.splitTaskExecutor, mode);
this.executorService.submit(hsh);
}

View File

@ -1410,10 +1410,10 @@ public class TestAssignmentManager {
ZKAssign.createNodeOffline(this.watcher, hri, SERVERNAME_A);
// Trigger a transition event
ZKAssign.transitionNodeOpening(this.watcher, hri, SERVERNAME_A);
long startTime = EnvironmentEdgeManager.currentTimeMillis();
long startTime = EnvironmentEdgeManager.currentTime();
while (!zkEventProcessed.get()) {
assertTrue("Timed out in waiting for ZK event to be processed",
EnvironmentEdgeManager.currentTimeMillis() - startTime < 30000);
EnvironmentEdgeManager.currentTime() - startTime < 30000);
Threads.sleepWithoutInterrupt(100);
}
assertFalse(am.getRegionStates().isRegionInTransition(hri));