HBASE-13552 ChoreService shutdown message could be more informative (Jonathan Lawlor)
This commit is contained in:
parent
b5fb861f76
commit
0415649f3d
|
@ -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();
|
||||
|
|
|
@ -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() + "]";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue