Changed the pause warmup atomic long to be static and have a getter on the DistributedIndexServer class.
Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/c40ccb48 Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/c40ccb48 Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/c40ccb48 Branch: refs/heads/master Commit: c40ccb485ac9c6f707973f4c56adcd5d75c071d4 Parents: 1740696 Author: Aaron McCurry <[email protected]> Authored: Wed Jul 3 21:12:45 2013 -0400 Committer: Aaron McCurry <[email protected]> Committed: Wed Jul 3 21:12:45 2013 -0400 ---------------------------------------------------------------------- .../blur/manager/indexserver/DistributedIndexServer.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c40ccb48/blur-core/src/main/java/org/apache/blur/manager/indexserver/DistributedIndexServer.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/manager/indexserver/DistributedIndexServer.java b/blur-core/src/main/java/org/apache/blur/manager/indexserver/DistributedIndexServer.java index f0f449e..71a4ee0 100644 --- a/blur-core/src/main/java/org/apache/blur/manager/indexserver/DistributedIndexServer.java +++ b/blur-core/src/main/java/org/apache/blur/manager/indexserver/DistributedIndexServer.java @@ -97,6 +97,8 @@ public class DistributedIndexServer extends AbstractIndexServer { private static final Log LOG = LogFactory.getLog(DistributedIndexServer.class); private static final long _delay = TimeUnit.SECONDS.toMillis(10); private static final long CHECK_PERIOD = TimeUnit.SECONDS.toMillis(60); + + private static final AtomicLong _pauseWarmup = new AtomicLong(); private Map<String, BlurAnalyzer> _tableAnalyzers = new ConcurrentHashMap<String, BlurAnalyzer>(); private Map<String, TableDescriptor> _tableDescriptors = new ConcurrentHashMap<String, TableDescriptor>(); @@ -139,13 +141,13 @@ public class DistributedIndexServer extends AbstractIndexServer { private int _internalSearchThreads; private ExecutorService _warmupExecutor; private int _warmupThreads; - private final AtomicLong _pauseWarmup = new AtomicLong(); + private long _lastRamUsageCheck = 0; public static interface ReleaseReader { void release() throws IOException; } - + public void init() throws KeeperException, InterruptedException, IOException { MetricName tableCount = new MetricName(ORG_APACHE_BLUR, BLUR, TABLE_COUNT, _cluster); MetricName indexCount = new MetricName(ORG_APACHE_BLUR, BLUR, INDEX_COUNT, _cluster); @@ -781,4 +783,8 @@ public class DistributedIndexServer extends AbstractIndexServer { public void setWarmupThreads(int warmupThreads) { _warmupThreads = warmupThreads; } + + public static AtomicLong getPauseWarmup() { + return _pauseWarmup; + } }
