incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject git commit: Refactoring unused code.
Date Sat, 16 Jan 2016 16:21:21 GMT
Repository: incubator-blur
Updated Branches:
  refs/heads/master 97611acf1 -> 1f2e98416


Refactoring unused 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/1f2e9841
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/1f2e9841
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/1f2e9841

Branch: refs/heads/master
Commit: 1f2e98416f3e923226a26d0b0c1b9dcdee0dc184
Parents: 97611ac
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Sat Jan 16 11:21:14 2016 -0500
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Sat Jan 16 11:21:14 2016 -0500

----------------------------------------------------------------------
 .../indexserver/DistributedIndexServer.java     |  4 +-
 .../manager/indexserver/LocalIndexServer.java   |  4 +-
 .../apache/blur/manager/writer/BlurIndex.java   |  8 +-
 .../blur/manager/writer/BlurIndexConf.java      | 94 --------------------
 .../blur/manager/writer/BlurIndexReadOnly.java  |  4 -
 .../manager/writer/BlurIndexSimpleWriter.java   |  7 +-
 .../org/apache/blur/server/TableContext.java    |  6 +-
 .../blur/command/ShardCommandManagerTest.java   |  9 +-
 .../blur/command/stream/StreamServerTest.java   |  9 +-
 .../writer/BlurIndexSimpleWriterTest.java       |  5 +-
 .../blur/manager/writer/IndexImporterTest.java  |  7 +-
 11 files changed, 18 insertions(+), 139 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1f2e9841/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 6fb5b2f..91d699f 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
@@ -46,7 +46,7 @@ import org.apache.blur.manager.clusterstatus.ClusterStatus;
 import org.apache.blur.manager.clusterstatus.ClusterStatus.Action;
 import org.apache.blur.manager.writer.BlurIndex;
 import org.apache.blur.manager.writer.BlurIndexCloser;
-import org.apache.blur.manager.writer.BlurIndexConf;
+import org.apache.blur.manager.writer.BlurIndexConfig;
 import org.apache.blur.manager.writer.BlurIndexReadOnly;
 import org.apache.blur.manager.writer.SharedMergeScheduler;
 import org.apache.blur.server.ShardContext;
@@ -527,7 +527,7 @@ public class DistributedIndexServer extends AbstractDistributedIndexServer
{
       directory = _blockCacheDirectoryFactory.newDirectory(table, shard, directory, blockCacheFileTypes);
     }
 
-    BlurIndexConf blurIndexConf = new BlurIndexConf(shardContext, directory, _mergeScheduler,
_searchExecutor,
+    BlurIndexConfig blurIndexConf = new BlurIndexConfig(shardContext, directory, _mergeScheduler,
_searchExecutor,
         _indexCloser, _indexImporterTimer, _indexBulkTimer, _thriftCache, _indexIdleWriterTimer,
_maxWriterIdle);
 
     BlurIndex index = tableContext.newInstanceBlurIndex(blurIndexConf);

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1f2e9841/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 71eb35c..99daec4 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
@@ -35,7 +35,7 @@ import org.apache.blur.log.Log;
 import org.apache.blur.log.LogFactory;
 import org.apache.blur.manager.writer.BlurIndex;
 import org.apache.blur.manager.writer.BlurIndexCloser;
-import org.apache.blur.manager.writer.BlurIndexConf;
+import org.apache.blur.manager.writer.BlurIndexConfig;
 import org.apache.blur.manager.writer.BlurIndexSimpleWriter;
 import org.apache.blur.manager.writer.SharedMergeScheduler;
 import org.apache.blur.server.ShardContext;
@@ -158,7 +158,7 @@ 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(new BlurIndexConf(shardContext,
dir, _mergeScheduler,
+    BlurIndexSimpleWriter index = new BlurIndexSimpleWriter(new BlurIndexConfig(shardContext,
dir, _mergeScheduler,
         _searchExecutor, _indexCloser, _timer, _bulkTimer, null, _closerTimer, _maxWriterIdle));
     return index;
   }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1f2e9841/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 9721d42..d23d2ae 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
@@ -31,13 +31,13 @@ import org.apache.lucene.search.TopDocs;
 
 public abstract class BlurIndex {
 
-  protected final BlurIndexConf _blurIndexConf;
+  protected final BlurIndexConfig _blurIndexConf;
 
-  public BlurIndex(BlurIndexConf blurIndexConf) throws IOException {
+  public BlurIndex(BlurIndexConfig blurIndexConf) throws IOException {
     _blurIndexConf = blurIndexConf;
   }
 
-  public BlurIndexConf getBlurIndexConf() {
+  public BlurIndexConfig getBlurIndexConf() {
     return _blurIndexConf;
   }
 
@@ -45,8 +45,6 @@ public abstract class BlurIndex {
 
   public abstract void close() throws IOException;
 
-  public abstract void refresh() throws IOException;
-
   public abstract AtomicBoolean isClosed();
 
   public abstract void optimize(int numberOfSegmentsPerShard) throws IOException;

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1f2e9841/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexConf.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexConf.java b/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexConf.java
deleted file mode 100644
index 2225253..0000000
--- a/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexConf.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * 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.
- */
-package org.apache.blur.manager.writer;
-
-import java.util.Timer;
-import java.util.concurrent.ExecutorService;
-
-import org.apache.blur.server.ShardContext;
-import org.apache.blur.server.cache.ThriftCache;
-import org.apache.lucene.store.Directory;
-
-public class BlurIndexConf {
-
-  private final ShardContext _shardContext;
-  private final Directory _directory;
-  private final SharedMergeScheduler _mergeScheduler;
-  private final ExecutorService _searchExecutor;
-  private final BlurIndexCloser _indexCloser;
-  private final Timer _indexImporterTimer;
-  private final Timer _bulkIndexingTimer;
-  private final ThriftCache _thriftCache;
-  private final Timer _indexWriterTimer;
-  private final long _maxWriterIdle;
-
-  public BlurIndexConf(ShardContext shardContext, Directory directory, SharedMergeScheduler
mergeScheduler,
-      ExecutorService searchExecutor, BlurIndexCloser indexCloser, Timer indexImporterTimer,
Timer bulkIndexingTimer,
-      ThriftCache thriftCache, Timer indexWriterTimer, long maxWriterIdle) {
-    _shardContext = shardContext;
-    _directory = directory;
-    _mergeScheduler = mergeScheduler;
-    _searchExecutor = searchExecutor;
-    _indexCloser = indexCloser;
-    _indexImporterTimer = indexImporterTimer;
-    _bulkIndexingTimer = bulkIndexingTimer;
-    _thriftCache = thriftCache;
-    _indexWriterTimer = indexWriterTimer;
-    _maxWriterIdle = maxWriterIdle;
-  }
-
-  public ShardContext getShardContext() {
-    return _shardContext;
-  }
-
-  public Directory getDirectory() {
-    return _directory;
-  }
-
-  public SharedMergeScheduler getMergeScheduler() {
-    return _mergeScheduler;
-  }
-
-  public ExecutorService getSearchExecutor() {
-    return _searchExecutor;
-  }
-
-  public BlurIndexCloser getIndexCloser() {
-    return _indexCloser;
-  }
-
-  public Timer getIndexImporterTimer() {
-    return _indexImporterTimer;
-  }
-
-  public Timer getBulkIndexingTimer() {
-    return _bulkIndexingTimer;
-  }
-
-  public ThriftCache getThriftCache() {
-    return _thriftCache;
-  }
-
-  public Timer getIndexWriterTimer() {
-    return _indexWriterTimer;
-  }
-
-  public long getMaxWriterIdle() {
-    return _maxWriterIdle;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1f2e9841/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 328c2ac..cdd0102 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
@@ -40,10 +40,6 @@ public class BlurIndexReadOnly extends BlurIndex {
     _blurIndex.close();
   }
 
-  public void refresh() throws IOException {
-    _blurIndex.refresh();
-  }
-
   public AtomicBoolean isClosed() {
     return _blurIndex.isClosed();
   }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1f2e9841/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 8aa2f76..3dab20f 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
@@ -155,7 +155,7 @@ public class BlurIndexSimpleWriter extends BlurIndex {
 
   private volatile Thread _optimizeThread;
 
-  public BlurIndexSimpleWriter(BlurIndexConf blurIndexConf) throws IOException {
+  public BlurIndexSimpleWriter(BlurIndexConfig blurIndexConf) throws IOException {
     super(blurIndexConf);
     _maxWriterIdle = blurIndexConf.getMaxWriterIdle();
     _indexWriterTimer = blurIndexConf.getIndexWriterTimer();
@@ -430,11 +430,6 @@ public class BlurIndexSimpleWriter extends BlurIndex {
   }
 
   @Override
-  public void refresh() throws IOException {
-
-  }
-
-  @Override
   public AtomicBoolean isClosed() {
     return _isClosed;
   }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1f2e9841/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 f1722ba..a65132c 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
@@ -50,7 +50,7 @@ import org.apache.blur.lucene.security.index.AccessControlFactory;
 import org.apache.blur.lucene.security.index.FilterAccessControlFactory;
 import org.apache.blur.manager.ReadInterceptor;
 import org.apache.blur.manager.writer.BlurIndex;
-import org.apache.blur.manager.writer.BlurIndexConf;
+import org.apache.blur.manager.writer.BlurIndexConfig;
 import org.apache.blur.manager.writer.BlurIndexSimpleWriter;
 import org.apache.blur.thrift.generated.Blur.Iface;
 import org.apache.blur.thrift.generated.ScoreType;
@@ -363,7 +363,7 @@ public class TableContext implements Cloneable {
   }
 
   @SuppressWarnings("unchecked")
-  public BlurIndex newInstanceBlurIndex(BlurIndexConf blurIndexConf) throws IOException {
+  public BlurIndex newInstanceBlurIndex(BlurIndexConfig blurIndexConf) throws IOException
{
     String className = _blurConfiguration.get(BLUR_SHARD_BLURINDEX_CLASS, BlurIndexSimpleWriter.class.getName());
     Class<? extends BlurIndex> clazz;
     try {
@@ -387,7 +387,7 @@ public class TableContext implements Cloneable {
 
   private Constructor<? extends BlurIndex> findConstructor(Class<? extends BlurIndex>
clazz) throws IOException {
     try {
-      return clazz.getConstructor(new Class[] { BlurIndexConf.class });
+      return clazz.getConstructor(new Class[] { BlurIndexConfig.class });
     } catch (NoSuchMethodException e) {
       throw new IOException(e);
     } catch (SecurityException e) {

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1f2e9841/blur-core/src/test/java/org/apache/blur/command/ShardCommandManagerTest.java
----------------------------------------------------------------------
diff --git a/blur-core/src/test/java/org/apache/blur/command/ShardCommandManagerTest.java
b/blur-core/src/test/java/org/apache/blur/command/ShardCommandManagerTest.java
index 5d3205f..f5fe4ea 100644
--- a/blur-core/src/test/java/org/apache/blur/command/ShardCommandManagerTest.java
+++ b/blur-core/src/test/java/org/apache/blur/command/ShardCommandManagerTest.java
@@ -38,7 +38,7 @@ import org.apache.blur.lucene.search.IndexSearcherCloseable;
 import org.apache.blur.lucene.search.IndexSearcherCloseableBase;
 import org.apache.blur.manager.IndexServer;
 import org.apache.blur.manager.writer.BlurIndex;
-import org.apache.blur.manager.writer.BlurIndexConf;
+import org.apache.blur.manager.writer.BlurIndexConfig;
 import org.apache.blur.manager.writer.IndexAction;
 import org.apache.blur.server.ShardContext;
 import org.apache.blur.server.TableContext;
@@ -384,7 +384,7 @@ public class ShardCommandManagerTest {
 
   protected BlurIndex getNullBlurIndex(String shard) throws IOException {
     ShardContext shardContext = ShardContext.create(getTableContextFactory().getTableContext("test"),
shard);
-    return new BlurIndex(new BlurIndexConf(shardContext, null, null, null, null, null, null,
null, null, 0)) {
+    return new BlurIndex(new BlurIndexConfig(shardContext, null, null, null, null, null,
null, null, null, 0)) {
 
       @Override
       public void removeSnapshot(String name) throws IOException {
@@ -392,11 +392,6 @@ public class ShardCommandManagerTest {
       }
 
       @Override
-      public void refresh() throws IOException {
-        throw new RuntimeException("Not implemented.");
-      }
-
-      @Override
       public void process(IndexAction indexAction) throws IOException {
         throw new RuntimeException("Not implemented.");
       }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1f2e9841/blur-core/src/test/java/org/apache/blur/command/stream/StreamServerTest.java
----------------------------------------------------------------------
diff --git a/blur-core/src/test/java/org/apache/blur/command/stream/StreamServerTest.java
b/blur-core/src/test/java/org/apache/blur/command/stream/StreamServerTest.java
index c99715c..0c8ded9 100644
--- a/blur-core/src/test/java/org/apache/blur/command/stream/StreamServerTest.java
+++ b/blur-core/src/test/java/org/apache/blur/command/stream/StreamServerTest.java
@@ -33,7 +33,7 @@ import org.apache.blur.command.IndexContext;
 import org.apache.blur.lucene.search.IndexSearcherCloseable;
 import org.apache.blur.manager.IndexServer;
 import org.apache.blur.manager.writer.BlurIndex;
-import org.apache.blur.manager.writer.BlurIndexConf;
+import org.apache.blur.manager.writer.BlurIndexConfig;
 import org.apache.blur.manager.writer.IndexAction;
 import org.apache.blur.server.ShardContext;
 import org.apache.blur.server.TableContext;
@@ -212,7 +212,7 @@ public class StreamServerTest implements Serializable {
     tableDescriptor.setTableUri("file:///tmp");
     TableContext tableContext = TableContext.create(tableDescriptor);
     ShardContext shardContext = ShardContext.create(tableContext, shard);
-    return new BlurIndex(new BlurIndexConf(shardContext, null, null, null, null, null, null,
null, null, 0)) {
+    return new BlurIndex(new BlurIndexConfig(shardContext, null, null, null, null, null,
null, null, null, 0)) {
 
       @Override
       public void removeSnapshot(String name) throws IOException {
@@ -220,11 +220,6 @@ public class StreamServerTest implements Serializable {
       }
 
       @Override
-      public void refresh() throws IOException {
-        throw new RuntimeException("Not implemented.");
-      }
-
-      @Override
       public void process(IndexAction indexAction) throws IOException {
         throw new RuntimeException("Not implemented.");
       }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1f2e9841/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 a0069b9..91dbdc0 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
@@ -128,8 +128,8 @@ public class BlurIndexSimpleWriterTest {
     directory.setLockFactory(lockFactory);
 
     ShardContext shardContext = ShardContext.create(tableContext, "test-shard-" + uuid);
-    _writer = new BlurIndexSimpleWriter(new BlurIndexConf(shardContext, directory, _mergeScheduler,
_service, _closer,
-        _indexImporterTimer, _bulkTimer, null, _idleWriterTimer, TimeUnit.SECONDS.toMillis(5)));
+    _writer = new BlurIndexSimpleWriter(new BlurIndexConfig(shardContext, directory, _mergeScheduler,
_service,
+        _closer, _indexImporterTimer, _bulkTimer, null, _idleWriterTimer, TimeUnit.SECONDS.toMillis(5)));
   }
 
   @After
@@ -264,7 +264,6 @@ public class BlurIndexSimpleWriterTest {
     // //wait one second for the data to become visible the test is set to
     // refresh once every 25 ms
     Thread.sleep(1000);// Hack for now
-    _writer.refresh();
     IndexSearcherCloseable searcher2 = _writer.getIndexSearcher();
     IndexReader reader2 = searcher2.getIndexReader();
     assertEquals(TEST_NUMBER, reader2.numDocs());

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1f2e9841/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 60ce6ef..ae635c3 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
@@ -126,7 +126,7 @@ public class IndexImporterTest {
   }
 
   private BlurIndex getBlurIndex(ShardContext shardContext, final Directory mainDirectory)
throws IOException {
-    return new BlurIndex(new BlurIndexConf(shardContext, mainDirectory, null, null, null,
null, null, null, null, 0)) {
+    return new BlurIndex(new BlurIndexConfig(shardContext, mainDirectory, null, null, null,
null, null, null, null, 0)) {
 
       @Override
       public void removeSnapshot(String name) throws IOException {
@@ -134,11 +134,6 @@ public class IndexImporterTest {
       }
 
       @Override
-      public void refresh() throws IOException {
-        throw new RuntimeException("Not Implemented");
-      }
-
-      @Override
       public void process(IndexAction indexAction) throws IOException {
         final DirectoryReader reader = DirectoryReader.open(mainDirectory);
         IndexSearcherCloseable searcherClosable = new IndexSearcherCloseableBase(reader,
null) {


Mime
View raw message