incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [2/3] git commit: Removing old directory reference counter code.
Date Sun, 23 Feb 2014 02:47:35 GMT
Removing old directory reference counter 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/31f23a35
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/31f23a35
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/31f23a35

Branch: refs/heads/apache-blur-0.2
Commit: 31f23a35b54feccae2826d2b843500763950e938
Parents: 044923c
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Sat Feb 22 20:45:31 2014 -0500
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Sat Feb 22 20:45:31 2014 -0500

----------------------------------------------------------------------
 .../blur/manager/indexserver/DistributedIndexServer.java | 11 ++---------
 .../blur/manager/indexserver/LocalIndexServer.java       |  7 ++-----
 .../java/org/apache/blur/manager/writer/BlurIndex.java   |  4 +---
 .../apache/blur/manager/writer/BlurIndexReadOnly.java    |  4 +---
 .../blur/manager/writer/BlurIndexSimpleWriter.java       |  7 +++----
 .../main/java/org/apache/blur/server/TableContext.java   | 11 +++--------
 .../blur/manager/writer/BlurIndexSimpleWriterTest.java   | 10 +++-------
 .../apache/blur/manager/writer/IndexImporterTest.java    |  2 +-
 8 files changed, 16 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/31f23a35/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 9500872..8858621 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
@@ -39,7 +39,6 @@ import java.util.concurrent.atomic.AtomicLong;
 import org.apache.blur.concurrent.Executors;
 import org.apache.blur.log.Log;
 import org.apache.blur.log.LogFactory;
-import org.apache.blur.lucene.store.refcounter.DirectoryReferenceFileGC;
 import org.apache.blur.manager.BlurFilterCache;
 import org.apache.blur.manager.clusterstatus.ClusterStatus;
 import org.apache.blur.manager.clusterstatus.ClusterStatus.Action;
@@ -47,7 +46,6 @@ import org.apache.blur.manager.clusterstatus.ZookeeperPathConstants;
 import org.apache.blur.manager.writer.BlurIndex;
 import org.apache.blur.manager.writer.BlurIndexCloser;
 import org.apache.blur.manager.writer.BlurIndexReadOnly;
-import org.apache.blur.manager.writer.BlurIndexRefresher;
 import org.apache.blur.manager.writer.SharedMergeScheduler;
 import org.apache.blur.server.IndexSearcherClosable;
 import org.apache.blur.server.ShardContext;
@@ -110,11 +108,9 @@ public class DistributedIndexServer extends AbstractDistributedIndexServer
{
   private final Thread _timerCacheFlush;
   private final Object _cleanupLock = new Object();
   private final ExecutorService _openerService;
-  private final DirectoryReferenceFileGC _gc;
   private final WatchChildren _watchOnlineShards;
   private final SharedMergeScheduler _mergeScheduler;
   private final ExecutorService _searchExecutor;
-  private final BlurIndexRefresher _refresher;
   private final BlurIndexCloser _indexCloser;
   private final ExecutorService _warmupExecutor;
   private final ConcurrentMap<String, LayoutEntry> _layout = new ConcurrentHashMap<String,
LayoutEntry>();
@@ -154,12 +150,9 @@ public class DistributedIndexServer extends AbstractDistributedIndexServer
{
     _closer.register(CloseableExecutorService.close(_searchExecutor));
     _closer.register(CloseableExecutorService.close(_warmupExecutor));
 
-    _gc = _closer.register(new DirectoryReferenceFileGC());
-
     // @TODO allow for configuration of these
     _mergeScheduler = _closer.register(new SharedMergeScheduler(maxMergeThreads));
 
-    _refresher = _closer.register(new BlurIndexRefresher());
     _indexCloser = _closer.register(new BlurIndexCloser());
     _timerCacheFlush = setupFlushCacheTimer();
     _timerCacheFlush.start();
@@ -565,8 +558,8 @@ public class DistributedIndexServer extends AbstractDistributedIndexServer
{
       directory = _blockCacheDirectoryFactory.newDirectory(table, shard, directory, blockCacheFileTypes);
     }
 
-    BlurIndex index = tableContext.newInstanceBlurIndex(shardContext, directory, _mergeScheduler,
_gc, _searchExecutor,
-        _indexCloser, _refresher, _warmup);
+    BlurIndex index = tableContext.newInstanceBlurIndex(shardContext, directory, _mergeScheduler,
_searchExecutor,
+        _indexCloser, _warmup);
 
     if (_clusterStatus.isReadOnly(true, _cluster, table)) {
       index = new BlurIndexReadOnly(index);

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/31f23a35/blur-core/src/main/java/org/apache/blur/manager/indexserver/LocalIndexServer.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/manager/indexserver/LocalIndexServer.java
b/blur-core/src/main/java/org/apache/blur/manager/indexserver/LocalIndexServer.java
index f851875..8ffa392 100644
--- a/blur-core/src/main/java/org/apache/blur/manager/indexserver/LocalIndexServer.java
+++ b/blur-core/src/main/java/org/apache/blur/manager/indexserver/LocalIndexServer.java
@@ -34,7 +34,6 @@ import java.util.concurrent.Executors;
 
 import org.apache.blur.log.Log;
 import org.apache.blur.log.LogFactory;
-import org.apache.blur.lucene.store.refcounter.DirectoryReferenceFileGC;
 import org.apache.blur.manager.writer.BlurIndex;
 import org.apache.blur.manager.writer.BlurIndexCloser;
 import org.apache.blur.manager.writer.BlurIndexSimpleWriter;
@@ -63,7 +62,6 @@ public class LocalIndexServer extends AbstractIndexServer {
 
   private final Map<String, Map<String, BlurIndex>> _readersMap = new ConcurrentHashMap<String,
Map<String, BlurIndex>>();
   private final SharedMergeScheduler _mergeScheduler;
-  private final DirectoryReferenceFileGC _gc;
   private final ExecutorService _searchExecutor;
   private final TableContext _tableContext;
   private final Closer _closer;
@@ -79,7 +77,6 @@ public class LocalIndexServer extends AbstractIndexServer {
     _closer = Closer.create();
     _tableContext = TableContext.create(tableDescriptor);
     _mergeScheduler = _closer.register(new SharedMergeScheduler(3));
-    _gc = _closer.register(new DirectoryReferenceFileGC());
     _searchExecutor = Executors.newCachedThreadPool();
     _closer.register(new CloseableExecutorService(_searchExecutor));
     _ramDir = ramDir;
@@ -161,8 +158,8 @@ public class LocalIndexServer extends AbstractIndexServer {
 
   private BlurIndex openIndex(String table, String shard, Directory dir) throws CorruptIndexException,
IOException {
     ShardContext shardContext = ShardContext.create(_tableContext, shard);
-    BlurIndexSimpleWriter index = new BlurIndexSimpleWriter(shardContext, dir, _mergeScheduler,
_gc, _searchExecutor,
-        _indexCloser, null, _indexWarmup);
+    BlurIndexSimpleWriter index = new BlurIndexSimpleWriter(shardContext, dir, _mergeScheduler,
_searchExecutor,
+        _indexCloser, _indexWarmup);
     return index;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/31f23a35/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndex.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndex.java b/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndex.java
index 55d36c5..23464b9 100644
--- a/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndex.java
+++ b/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndex.java
@@ -22,7 +22,6 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import org.apache.blur.lucene.store.refcounter.DirectoryReferenceFileGC;
 import org.apache.blur.manager.indexserver.BlurIndexWarmup;
 import org.apache.blur.server.IndexSearcherClosable;
 import org.apache.blur.server.ShardContext;
@@ -42,8 +41,7 @@ public abstract class BlurIndex {
   protected ShardContext _shardContext;
 
   public BlurIndex(ShardContext shardContext, Directory directory, SharedMergeScheduler mergeScheduler,
-      DirectoryReferenceFileGC gc, ExecutorService searchExecutor, BlurIndexCloser indexCloser,
-      BlurIndexRefresher refresher, BlurIndexWarmup indexWarmup) throws IOException {
+      ExecutorService searchExecutor, BlurIndexCloser indexCloser, BlurIndexWarmup indexWarmup)
throws IOException {
     _shardContext = shardContext;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/31f23a35/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexReadOnly.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexReadOnly.java
b/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexReadOnly.java
index 9819952..1860291 100644
--- a/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexReadOnly.java
+++ b/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexReadOnly.java
@@ -28,7 +28,7 @@ public class BlurIndexReadOnly extends BlurIndex {
   private final BlurIndex _blurIndex;
 
   public BlurIndexReadOnly(BlurIndex blurIndex) throws IOException {
-    super(null, null, null, null, null, null, null, null);
+    super(null, null, null, null, null, null);
     _blurIndex = blurIndex;
   }
 
@@ -77,6 +77,4 @@ public class BlurIndexReadOnly extends BlurIndex {
     throw new RuntimeException("Read-only shard");
   }
 
-
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/31f23a35/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexSimpleWriter.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexSimpleWriter.java
b/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexSimpleWriter.java
index a2da582..f9dc1c8 100644
--- a/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexSimpleWriter.java
+++ b/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexSimpleWriter.java
@@ -34,7 +34,6 @@ import org.apache.blur.index.IndexDeletionPolicyReader;
 import org.apache.blur.log.Log;
 import org.apache.blur.log.LogFactory;
 import org.apache.blur.lucene.codec.Blur022Codec;
-import org.apache.blur.lucene.store.refcounter.DirectoryReferenceFileGC;
 import org.apache.blur.lucene.warmup.TraceableDirectory;
 import org.apache.blur.manager.indexserver.BlurIndexWarmup;
 import org.apache.blur.server.IndexSearcherClosable;
@@ -78,9 +77,9 @@ public class BlurIndexSimpleWriter extends BlurIndex {
   private final IndexDeletionPolicyReader _policy;
 
   public BlurIndexSimpleWriter(ShardContext shardContext, Directory directory, SharedMergeScheduler
mergeScheduler,
-      DirectoryReferenceFileGC gc, final ExecutorService searchExecutor, BlurIndexCloser
indexCloser,
-      BlurIndexRefresher refresher, BlurIndexWarmup indexWarmup) throws IOException {
-    super(shardContext, directory, mergeScheduler, gc, searchExecutor, indexCloser, refresher,
indexWarmup);
+      final ExecutorService searchExecutor, BlurIndexCloser indexCloser, BlurIndexWarmup
indexWarmup)
+      throws IOException {
+    super(shardContext, directory, mergeScheduler, searchExecutor, indexCloser, indexWarmup);
     _searchThreadPool = searchExecutor;
     _shardContext = shardContext;
     _tableContext = _shardContext.getTableContext();

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/31f23a35/blur-core/src/main/java/org/apache/blur/server/TableContext.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/server/TableContext.java b/blur-core/src/main/java/org/apache/blur/server/TableContext.java
index 3ec68f4..788d34f 100644
--- a/blur-core/src/main/java/org/apache/blur/server/TableContext.java
+++ b/blur-core/src/main/java/org/apache/blur/server/TableContext.java
@@ -44,12 +44,10 @@ import org.apache.blur.analysis.NoStopWordStandardAnalyzer;
 import org.apache.blur.log.Log;
 import org.apache.blur.log.LogFactory;
 import org.apache.blur.lucene.search.FairSimilarity;
-import org.apache.blur.lucene.store.refcounter.DirectoryReferenceFileGC;
 import org.apache.blur.manager.ReadInterceptor;
 import org.apache.blur.manager.indexserver.BlurIndexWarmup;
 import org.apache.blur.manager.writer.BlurIndex;
 import org.apache.blur.manager.writer.BlurIndexCloser;
-import org.apache.blur.manager.writer.BlurIndexRefresher;
 import org.apache.blur.manager.writer.BlurIndexSimpleWriter;
 //import org.apache.blur.manager.writer.BlurNRTIndex;
 import org.apache.blur.manager.writer.SharedMergeScheduler;
@@ -327,8 +325,7 @@ public class TableContext {
 
   @SuppressWarnings("unchecked")
   public BlurIndex newInstanceBlurIndex(ShardContext shardContext, Directory dir, SharedMergeScheduler
mergeScheduler,
-      DirectoryReferenceFileGC gc, ExecutorService searchExecutor, BlurIndexCloser indexCloser,
-      BlurIndexRefresher refresher, BlurIndexWarmup indexWarmup) throws IOException {
+      ExecutorService searchExecutor, BlurIndexCloser indexCloser, BlurIndexWarmup indexWarmup)
throws IOException {
 
     String className = _blurConfiguration.get(BLUR_SHARD_BLURINDEX_CLASS, BlurIndexSimpleWriter.class.getName());
 
@@ -340,8 +337,7 @@ public class TableContext {
     }
     Constructor<? extends BlurIndex> constructor = findConstructor(clazz);
     try {
-      return constructor.newInstance(shardContext, dir, mergeScheduler, gc, searchExecutor,
indexCloser, refresher,
-          indexWarmup);
+      return constructor.newInstance(shardContext, dir, mergeScheduler, searchExecutor, indexCloser,
indexWarmup);
     } catch (InstantiationException e) {
       throw new IOException(e);
     } catch (IllegalAccessException e) {
@@ -356,8 +352,7 @@ public class TableContext {
   private Constructor<? extends BlurIndex> findConstructor(Class<? extends BlurIndex>
clazz) throws IOException {
     try {
       return clazz.getConstructor(new Class[] { ShardContext.class, Directory.class, SharedMergeScheduler.class,
-          DirectoryReferenceFileGC.class, ExecutorService.class, BlurIndexCloser.class, BlurIndexRefresher.class,
-          BlurIndexWarmup.class });
+          ExecutorService.class, BlurIndexCloser.class, BlurIndexWarmup.class });
     } catch (NoSuchMethodException e) {
       throw new IOException(e);
     } catch (SecurityException e) {

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/31f23a35/blur-core/src/test/java/org/apache/blur/manager/writer/BlurIndexSimpleWriterTest.java
----------------------------------------------------------------------
diff --git a/blur-core/src/test/java/org/apache/blur/manager/writer/BlurIndexSimpleWriterTest.java
b/blur-core/src/test/java/org/apache/blur/manager/writer/BlurIndexSimpleWriterTest.java
index f0e95e6..618b24b 100644
--- a/blur-core/src/test/java/org/apache/blur/manager/writer/BlurIndexSimpleWriterTest.java
+++ b/blur-core/src/test/java/org/apache/blur/manager/writer/BlurIndexSimpleWriterTest.java
@@ -17,7 +17,8 @@ package org.apache.blur.manager.writer;
  * limitations under the License.
  */
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
 
 import java.io.File;
 import java.io.IOException;
@@ -27,7 +28,6 @@ import java.util.concurrent.ExecutorService;
 
 import org.apache.blur.BlurConfiguration;
 import org.apache.blur.concurrent.Executors;
-import org.apache.blur.lucene.store.refcounter.DirectoryReferenceFileGC;
 import org.apache.blur.manager.indexserver.DefaultBlurIndexWarmup;
 import org.apache.blur.server.IndexSearcherClosable;
 import org.apache.blur.server.ShardContext;
@@ -61,7 +61,6 @@ public class BlurIndexSimpleWriterTest {
   private File _base;
   private Configuration _configuration;
 
-  private DirectoryReferenceFileGC _gc;
   private SharedMergeScheduler _mergeScheduler;
   private String uuid;
   private BlurIndexRefresher _refresher;
@@ -76,7 +75,6 @@ public class BlurIndexSimpleWriterTest {
     _base.mkdirs();
 
     _mergeScheduler = new SharedMergeScheduler(1);
-    _gc = new DirectoryReferenceFileGC();
 
     _configuration = new Configuration();
     _service = Executors.newThreadPool("test", 10);
@@ -104,8 +102,7 @@ public class BlurIndexSimpleWriterTest {
     path.mkdirs();
     FSDirectory directory = FSDirectory.open(path);
     ShardContext shardContext = ShardContext.create(tableContext, "test-shard-" + uuid);
-    _writer = new BlurIndexSimpleWriter(shardContext, directory, _mergeScheduler, _gc, _service,
_closer, _refresher,
-        _indexWarmup);
+    _writer = new BlurIndexSimpleWriter(shardContext, directory, _mergeScheduler, _service,
_closer, _indexWarmup);
   }
 
   @After
@@ -113,7 +110,6 @@ public class BlurIndexSimpleWriterTest {
     _refresher.close();
     _writer.close();
     _mergeScheduler.close();
-    _gc.close();
     _service.shutdownNow();
     rmr(_base);
   }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/31f23a35/blur-core/src/test/java/org/apache/blur/manager/writer/IndexImporterTest.java
----------------------------------------------------------------------
diff --git a/blur-core/src/test/java/org/apache/blur/manager/writer/IndexImporterTest.java
b/blur-core/src/test/java/org/apache/blur/manager/writer/IndexImporterTest.java
index 4229c0d..407788a 100644
--- a/blur-core/src/test/java/org/apache/blur/manager/writer/IndexImporterTest.java
+++ b/blur-core/src/test/java/org/apache/blur/manager/writer/IndexImporterTest.java
@@ -112,7 +112,7 @@ public class IndexImporterTest {
   }
 
   private BlurIndex getBlurIndex(ShardContext shardContext, final Directory mainDirectory)
throws IOException {
-    return new BlurIndex(shardContext, mainDirectory, null, null, null, null, null, null)
{
+    return new BlurIndex(shardContext, mainDirectory, null, null, null, null) {
 
       @Override
       public void removeSnapshot(String name) throws IOException {


Mime
View raw message