Repository: accumulo Updated Branches: refs/heads/ACCUMULO-2061 db76dd751 -> de5c29bc8
ACCUMULO-2319 Move MemoryManagementFramework thread starts out of constructor Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/d11acbe5 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/d11acbe5 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/d11acbe5 Branch: refs/heads/ACCUMULO-2061 Commit: d11acbe5dc3f88efcb03b5b08832ecfa9fc15381 Parents: 117dce7 Author: Bill Havanki <bhava...@cloudera.com> Authored: Wed Mar 12 10:50:20 2014 -0400 Committer: Bill Havanki <bhava...@cloudera.com> Committed: Wed Mar 12 10:50:20 2014 -0400 ---------------------------------------------------------------------- .../TabletServerResourceManager.java | 21 ++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/d11acbe5/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServerResourceManager.java ---------------------------------------------------------------------- diff --git a/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServerResourceManager.java b/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServerResourceManager.java index f7f04c9..87d73b5 100644 --- a/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServerResourceManager.java +++ b/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServerResourceManager.java @@ -187,6 +187,7 @@ public class TabletServerResourceManager { } memMgmt = new MemoryManagementFramework(); + memMgmt.startThreads(); } @@ -230,6 +231,8 @@ public class TabletServerResourceManager { private LinkedBlockingQueue<TabletStateImpl> memUsageReports; private long lastMemCheckTime = System.currentTimeMillis(); private long maxMem; + private Thread memoryGuardThread; + private Thread minorCompactionInitiatorThread; MemoryManagementFramework() { tabletReports = Collections.synchronizedMap(new HashMap<KeyExtent,TabletStateImpl>()); @@ -242,10 +245,9 @@ public class TabletServerResourceManager { } }; - Thread t1 = new Daemon(new LoggingRunnable(log, r1)); - t1.setPriority(Thread.NORM_PRIORITY + 1); - t1.setName("Accumulo Memory Guard"); - t1.start(); + memoryGuardThread = new Daemon(new LoggingRunnable(log, r1)); + memoryGuardThread.setPriority(Thread.NORM_PRIORITY + 1); + memoryGuardThread.setName("Accumulo Memory Guard"); Runnable r2 = new Runnable() { public void run() { @@ -253,10 +255,13 @@ public class TabletServerResourceManager { } }; - Thread t2 = new Daemon(new LoggingRunnable(log, r2)); - t2.setName("Accumulo Minor Compaction Initiator"); - t2.start(); - + minorCompactionInitiatorThread = new Daemon(new LoggingRunnable(log, r2)); + minorCompactionInitiatorThread.setName("Accumulo Minor Compaction Initiator"); + } + + void startThreads() { + memoryGuardThread.start(); + minorCompactionInitiatorThread.start(); } private long lastMemTotal = 0;