Repository: incubator-blur Updated Branches: refs/heads/master 059d003d8 -> 2db2bf3fe
Removing dead code. Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/a7d16399 Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/a7d16399 Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/a7d16399 Branch: refs/heads/master Commit: a7d1639989871639a3f3339515b2114db5f50e22 Parents: a3cc47d Author: Aaron McCurry <[email protected]> Authored: Tue Nov 11 07:50:43 2014 -0500 Committer: Aaron McCurry <[email protected]> Committed: Tue Nov 11 07:50:43 2014 -0500 ---------------------------------------------------------------------- .../blur/manager/writer/BlurIndexRefresher.java | 88 -------------------- .../blur/thrift/ThriftBlurShardServer.java | 7 +- 2 files changed, 2 insertions(+), 93 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a7d16399/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexRefresher.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexRefresher.java b/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexRefresher.java deleted file mode 100644 index 67181ab..0000000 --- a/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexRefresher.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.apache.blur.manager.writer; - -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import java.io.Closeable; -import java.io.IOException; -import java.util.Collection; -import java.util.Timer; -import java.util.TimerTask; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.TimeUnit; - -import org.apache.blur.log.Log; -import org.apache.blur.log.LogFactory; -import org.apache.lucene.store.AlreadyClosedException; - -public class BlurIndexRefresher extends TimerTask implements Closeable { - - private static final Log LOG = LogFactory.getLog(BlurIndexRefresher.class); - - private Timer _timer; - private long _period = TimeUnit.MINUTES.toMillis(1); - private long _delay = _period; - private Collection<BlurIndex> _indexes = new LinkedBlockingQueue<BlurIndex>(); - - public BlurIndexRefresher() { - _timer = new Timer("IndexReader-Refresher", true); - _timer.schedule(this, _delay, _period); - LOG.info("Init Complete"); - } - - public void register(BlurIndex blurIndex) { - _indexes.add(blurIndex); - } - - public void unregister(BlurIndex blurIndex) { - _indexes.remove(blurIndex); - } - - public void close() { - _timer.purge(); - _timer.cancel(); - } - - @Override - public void run() { - try { - refreshInternal(); - } catch (Throwable e) { - LOG.error("Unknown error", e); - } - } - - private void refreshInternal() { - for (BlurIndex index : _indexes) { - try { - index.refresh(); - } catch (IOException e) { - LOG.error("Unknown error while refreshing index of writer [{0}]", e, index); - } catch (AlreadyClosedException e) { - LOG.warn("Index has already been closed [{0}]", e, index); - } - } - } - - public void setPeriod(long period) { - _period = period; - } - - public void setDelay(long delay) { - _delay = delay; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a7d16399/blur-core/src/main/java/org/apache/blur/thrift/ThriftBlurShardServer.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/thrift/ThriftBlurShardServer.java b/blur-core/src/main/java/org/apache/blur/thrift/ThriftBlurShardServer.java index 18dc375..1f0e080 100644 --- a/blur-core/src/main/java/org/apache/blur/thrift/ThriftBlurShardServer.java +++ b/blur-core/src/main/java/org/apache/blur/thrift/ThriftBlurShardServer.java @@ -84,7 +84,6 @@ import org.apache.blur.manager.indexserver.BlurServerShutDown.BlurShutdown; import org.apache.blur.manager.indexserver.DistributedIndexServer; import org.apache.blur.manager.indexserver.DistributedLayoutFactory; import org.apache.blur.manager.indexserver.DistributedLayoutFactoryImpl; -import org.apache.blur.manager.writer.BlurIndexRefresher; import org.apache.blur.metrics.JSONReporter; import org.apache.blur.metrics.ReporterSetup; import org.apache.blur.server.ShardServerEventHandler; @@ -107,9 +106,9 @@ import org.apache.blur.zookeeper.ZkUtils; import org.apache.hadoop.conf.Configuration; import org.apache.lucene.search.BooleanQuery; import org.apache.zookeeper.ZooKeeper; - import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.webapp.WebAppContext; + import sun.misc.VM; public class ThriftBlurShardServer extends ThriftServer { @@ -196,8 +195,6 @@ public class ThriftBlurShardServer extends ThriftServer { final ZookeeperClusterStatus clusterStatus = new ZookeeperClusterStatus(zooKeeper, configuration, config); - final BlurIndexRefresher refresher = new BlurIndexRefresher(); - BlurFilterCache filterCache = getFilterCache(configuration); DistributedLayoutFactory distributedLayoutFactory = DistributedLayoutFactoryImpl.getDistributedLayoutFactory( @@ -323,7 +320,7 @@ public class ThriftBlurShardServer extends ThriftServer { public void shutdown() { ThreadWatcher threadWatcher = ThreadWatcher.instance(); quietClose(makeCloseable(hdfsKeyValueTimer), makeCloseable(indexImporterTimer), blockCacheDirectoryFactory, - commandManager, traceStorage, refresher, server, shardServer, indexManager, indexServer, threadWatcher, + commandManager, traceStorage, server, shardServer, indexManager, indexServer, threadWatcher, clusterStatus, zooKeeper, httpServer); } };
