HADOOP-17690. Improve the log for The DecayRpcScheduler. Contributed by Bhavik Patel.
This commit is contained in:
parent
7f93349ee7
commit
6d6766bc22
@ -628,7 +628,8 @@ public class DecayRpcScheduler implements RpcScheduler,
|
|||||||
List<AtomicLong> costList = callCosts.get(identity);
|
List<AtomicLong> costList = callCosts.get(identity);
|
||||||
long currentCost = costList == null ? 0 : costList.get(0).get();
|
long currentCost = costList == null ? 0 : costList.get(0).get();
|
||||||
int priority = computePriorityLevel(currentCost, identity);
|
int priority = computePriorityLevel(currentCost, identity);
|
||||||
LOG.debug("compute priority for {} priority {}", identity, priority);
|
LOG.debug("compute priority for identity: {}={}", identity,
|
||||||
|
priority);
|
||||||
return priority;
|
return priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -666,7 +667,7 @@ public class DecayRpcScheduler implements RpcScheduler,
|
|||||||
void setPriorityLevel(UserGroupInformation ugi, int priority) {
|
void setPriorityLevel(UserGroupInformation ugi, int priority) {
|
||||||
String identity = getIdentity(newSchedulable(ugi));
|
String identity = getIdentity(newSchedulable(ugi));
|
||||||
priority = Math.min(numLevels - 1, priority);
|
priority = Math.min(numLevels - 1, priority);
|
||||||
LOG.info("Setting priority for user:" + identity + "=" + priority);
|
LOG.info("Setting priority for user: {}={}", identity, priority);
|
||||||
staticPriorities.put(identity, priority);
|
staticPriorities.put(identity, priority);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -735,12 +736,10 @@ public class DecayRpcScheduler implements RpcScheduler,
|
|||||||
responseTimeCountInCurrWindow.getAndIncrement(priorityLevel);
|
responseTimeCountInCurrWindow.getAndIncrement(priorityLevel);
|
||||||
responseTimeTotalInCurrWindow.getAndAdd(priorityLevel,
|
responseTimeTotalInCurrWindow.getAndAdd(priorityLevel,
|
||||||
queueTime+processingTime);
|
queueTime+processingTime);
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("addResponseTime for call: {} priority: {} queueTime: {} " +
|
LOG.debug("addResponseTime for call: {} priority: {} queueTime: {} " +
|
||||||
"processingTime: {} ", callName, priorityLevel, queueTime,
|
"processingTime: {} ", callName, priorityLevel, queueTime,
|
||||||
processingTime);
|
processingTime);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Update the cached average response time at the end of the decay window
|
// Update the cached average response time at the end of the decay window
|
||||||
void updateAverageResponseTime(boolean enableDecay) {
|
void updateAverageResponseTime(boolean enableDecay) {
|
||||||
@ -763,10 +762,8 @@ public class DecayRpcScheduler implements RpcScheduler,
|
|||||||
responseTimeAvgInLastWindow.set(i, 0);
|
responseTimeAvgInLastWindow.set(i, 0);
|
||||||
}
|
}
|
||||||
responseTimeCountInLastWindow.set(i, responseTimeCount);
|
responseTimeCountInLastWindow.set(i, responseTimeCount);
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("updateAverageResponseTime queue: {} Average: {} Count: {}",
|
LOG.debug("updateAverageResponseTime queue: {} Average: {} Count: {}",
|
||||||
i, averageResponseTime, responseTimeCount);
|
i, averageResponseTime, responseTimeCount);
|
||||||
}
|
|
||||||
// Reset for next decay window
|
// Reset for next decay window
|
||||||
responseTimeTotalInCurrWindow.set(i, 0);
|
responseTimeTotalInCurrWindow.set(i, 0);
|
||||||
responseTimeCountInCurrWindow.set(i, 0);
|
responseTimeCountInCurrWindow.set(i, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user