mirror of https://github.com/apache/cassandra
unregister mbean on flush. patch by daishi; reviewed by jbellis for CASSANDRA-157
git-svn-id: https://svn.apache.org/repos/asf/incubator/cassandra/trunk@774002 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9307f621bc
commit
2fd856de35
|
|
@ -38,6 +38,7 @@ public class DebuggableThreadPoolExecutor extends ThreadPoolExecutor implements
|
|||
{
|
||||
private static Logger logger_ = Logger.getLogger(DebuggableThreadPoolExecutor.class);
|
||||
|
||||
private ObjectName objName;
|
||||
public DebuggableThreadPoolExecutor(String threadPoolName)
|
||||
{
|
||||
this(1, 1, Integer.MAX_VALUE, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), new ThreadFactoryImpl(threadPoolName));
|
||||
|
|
@ -55,7 +56,21 @@ public class DebuggableThreadPoolExecutor extends ThreadPoolExecutor implements
|
|||
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
|
||||
try
|
||||
{
|
||||
mbs.registerMBean(this, new ObjectName("org.apache.cassandra.concurrent:type=" + threadFactory.id_));
|
||||
objName = new ObjectName("org.apache.cassandra.concurrent:type=" + threadFactory.id_);
|
||||
mbs.registerMBean(this, objName);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void unregisterMBean()
|
||||
{
|
||||
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
|
||||
try
|
||||
{
|
||||
mbs.unregisterMBean(objName);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -384,6 +384,7 @@ public class Memtable implements Comparable<Memtable>
|
|||
{
|
||||
flushQueuer.run();
|
||||
}
|
||||
this.unregisterMBean();
|
||||
}
|
||||
|
||||
public void flushWhenTerminated(final CommitLog.CommitLogContext cLogCtx)
|
||||
|
|
|
|||
Loading…
Reference in New Issue