*
* @throws InvalidStateException
* @throws DependencyException
*/
protected void runTaker() throws DependencyException, InvalidStateException {
IMetricsScope scope = MetricsHelper.startScope(metricsFactory, "TakeLeases");
long startTime = System.currentTimeMillis();
boolean success = false;
try {
Map<String, T> takenLeases = leaseTaker.takeLeases();
leaseRenewer.addLeasesToRenew(takenLeases.values());
success = true;
} finally {
scope.addDimension(WORKER_IDENTIFIER_METRIC, getWorkerIdentifier());
MetricsHelper.addSuccessAndLatency(startTime, success);
MetricsHelper.endScope();
}
}