HBASE-11822 Convert EnvironmentEdge#getCurrentTimeMillis to getCurrentTime

This commit is contained in:
stack 2014-08-29 17:14:17 -07:00
parent 3bfbd06291
commit 651b6bab49
3 changed files with 8 additions and 8 deletions

View File

@ -203,7 +203,7 @@ public class ZKSplitLogManagerCoordination extends ZooKeeperListener implements
// 2) after a configurable timeout if the server is not marked as dead but has still not // 2) after a configurable timeout if the server is not marked as dead but has still not
// finished the task. This allows to continue if the worker cannot actually handle it, // finished the task. This allows to continue if the worker cannot actually handle it,
// for any reason. // for any reason.
final long time = EnvironmentEdgeManager.currentTimeMillis() - task.last_update; final long time = EnvironmentEdgeManager.currentTime() - task.last_update;
final boolean alive = final boolean alive =
details.getMaster().getServerManager() != null ? details.getMaster().getServerManager() details.getMaster().getServerManager() != null ? details.getMaster().getServerManager()
.isServerOnline(task.cur_worker_name) : true; .isServerOnline(task.cur_worker_name) : true;
@ -233,7 +233,7 @@ public class ZKSplitLogManagerCoordination extends ZooKeeperListener implements
task.incarnation++; task.incarnation++;
boolean result = resubmit(this.details.getServerName(), path, version); boolean result = resubmit(this.details.getServerName(), path, version);
if (!result) { if (!result) {
task.heartbeatNoDetails(EnvironmentEdgeManager.currentTimeMillis()); task.heartbeatNoDetails(EnvironmentEdgeManager.currentTime());
return false; return false;
} }
// don't count forced resubmits // don't count forced resubmits
@ -551,7 +551,7 @@ public class ZKSplitLogManagerCoordination extends ZooKeeperListener implements
if (task.isUnassigned()) { if (task.isUnassigned()) {
LOG.info("task " + path + " acquired by " + workerName); LOG.info("task " + path + " acquired by " + workerName);
} }
task.heartbeat(EnvironmentEdgeManager.currentTimeMillis(), new_version, workerName); task.heartbeat(EnvironmentEdgeManager.currentTime(), new_version, workerName);
SplitLogCounters.tot_mgr_heartbeat.incrementAndGet(); SplitLogCounters.tot_mgr_heartbeat.incrementAndGet();
} else { } else {
// duplicate heartbeats - heartbeats w/o zk node version // duplicate heartbeats - heartbeats w/o zk node version
@ -599,7 +599,7 @@ public class ZKSplitLogManagerCoordination extends ZooKeeperListener implements
@Override @Override
public void markRegionsRecovering(final ServerName serverName, Set<HRegionInfo> userRegions) public void markRegionsRecovering(final ServerName serverName, Set<HRegionInfo> userRegions)
throws IOException, InterruptedIOException { throws IOException, InterruptedIOException {
this.lastRecoveringNodeCreationTime = EnvironmentEdgeManager.currentTimeMillis(); this.lastRecoveringNodeCreationTime = EnvironmentEdgeManager.currentTime();
for (HRegionInfo region : userRegions) { for (HRegionInfo region : userRegions) {
String regionEncodeName = region.getEncodedName(); String regionEncodeName = region.getEncodedName();
long retries = this.zkretries; long retries = this.zkretries;
@ -665,7 +665,7 @@ public class ZKSplitLogManagerCoordination extends ZooKeeperListener implements
task = details.getTasks().get(path); task = details.getTasks().get(path);
if (task != null || ZKSplitLog.isRescanNode(watcher, path)) { if (task != null || ZKSplitLog.isRescanNode(watcher, path)) {
if (task != null) { if (task != null) {
task.heartbeatNoDetails(EnvironmentEdgeManager.currentTimeMillis()); task.heartbeatNoDetails(EnvironmentEdgeManager.currentTime());
} }
getDataSetWatch(path, zkretries); getDataSetWatch(path, zkretries);
} }

View File

@ -298,7 +298,7 @@ public class ZkSplitLogWorkerCoordination extends ZooKeeperListener implements
@Override @Override
public boolean progress() { public boolean progress() {
long t = EnvironmentEdgeManager.currentTimeMillis(); long t = EnvironmentEdgeManager.currentTime();
if ((t - last_report_at) > reportPeriod) { if ((t - last_report_at) > reportPeriod) {
last_report_at = t; last_report_at = t;
int latestZKVersion = int latestZKVersion =

View File

@ -707,7 +707,7 @@ public class HStore implements Store {
} }
if (verifyBulkLoads) { if (verifyBulkLoads) {
long verificationStartTime = EnvironmentEdgeManager.currentTimeMillis(); long verificationStartTime = EnvironmentEdgeManager.currentTime();
LOG.info("Full verification started for bulk load hfile: " + srcPath.toString()); LOG.info("Full verification started for bulk load hfile: " + srcPath.toString());
Cell prevKV = null; Cell prevKV = null;
HFileScanner scanner = reader.getScanner(false, false, false); HFileScanner scanner = reader.getScanner(false, false, false);
@ -735,7 +735,7 @@ public class HStore implements Store {
prevKV = kv; prevKV = kv;
} while (scanner.next()); } while (scanner.next());
LOG.info("Full verification complete for bulk load hfile: " + srcPath.toString() LOG.info("Full verification complete for bulk load hfile: " + srcPath.toString()
+ " took " + (EnvironmentEdgeManager.currentTimeMillis() - verificationStartTime) + " took " + (EnvironmentEdgeManager.currentTime() - verificationStartTime)
+ " ms"); + " ms");
} }
} finally { } finally {