HBASE-13552 ChoreService shutdown message could be more informative (Jonathan Lawlor)

This commit is contained in:
stack 2015-04-24 13:42:03 -07:00
parent b5fb861f76
commit 0415649f3d
2 changed files with 9 additions and 3 deletions

View File

@ -21,7 +21,6 @@ package org.apache.hadoop.hbase;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map.Entry;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.ScheduledThreadPoolExecutor;
@ -298,9 +297,10 @@ public class ChoreService implements ChoreServicer {
* after this method has been called (i.e. future scheduling attempts will fail).
*/
public void shutdown() {
List<Runnable> ongoing = scheduler.shutdownNow();
scheduler.shutdownNow();
if (LOG.isInfoEnabled()) {
LOG.info("Chore service for: " + coreThreadPoolPrefix + " had " + ongoing + " on shutdown");
LOG.info("Chore service for: " + coreThreadPoolPrefix + " had " + scheduledChores.keySet()
+ " on shutdown");
}
cancelAllChores(true);
scheduledChores.clear();

View File

@ -338,4 +338,10 @@ public abstract class ScheduledChore implements Runnable {
*/
protected synchronized void cleanup() {
}
@Override
public String toString() {
return "[ScheduledChore: Name: " + getName() + " Period: " + getPeriod() + " Unit: "
+ getTimeUnit() + "]";
}
}