incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [1/2] git commit: Fixed BLUR-32.
Date Wed, 17 Oct 2012 01:39:21 GMT
Updated Branches:
  refs/heads/lucene-4.0.0 989e5f064 -> 55a3b5f44


Fixed BLUR-32.


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/55a3b5f4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/55a3b5f4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/55a3b5f4

Branch: refs/heads/lucene-4.0.0
Commit: 55a3b5f4488e2e385c72af3b3f43e2faa7b6c10f
Parents: 6c38c69
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Tue Oct 16 21:38:53 2012 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Tue Oct 16 21:38:53 2012 -0400

----------------------------------------------------------------------
 .../apache/blur/manager/writer/BlurNRTIndex.java   |    4 +-
 .../manager/writer/DirectoryReferenceCounter.java  |  122 +++++++--------
 .../blur/manager/writer/TransactionRecorder.java   |   31 +++--
 .../blur/manager/writer/BlurNRTIndexTest.java      |    8 +-
 .../writer/DirectoryReferenceCounterTest.java      |  118 +++++++--------
 .../manager/writer/TransactionRecorderTest.java    |   10 +-
 6 files changed, 144 insertions(+), 149 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/55a3b5f4/src/blur-core/src/main/java/org/apache/blur/manager/writer/BlurNRTIndex.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/manager/writer/BlurNRTIndex.java
b/src/blur-core/src/main/java/org/apache/blur/manager/writer/BlurNRTIndex.java
index e0e6d48..164be3b 100644
--- a/src/blur-core/src/main/java/org/apache/blur/manager/writer/BlurNRTIndex.java
+++ b/src/blur-core/src/main/java/org/apache/blur/manager/writer/BlurNRTIndex.java
@@ -16,7 +16,7 @@ package org.apache.blur.manager.writer;
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-import static org.apache.blur.lucene.LuceneConstant.LUCENE_VERSION;
+import static org.apache.blur.lucene.LuceneVersionConstant.LUCENE_VERSION;
 
 import java.io.IOException;
 import java.util.List;
@@ -42,7 +42,7 @@ import org.apache.lucene.search.NRTManager;
 import org.apache.lucene.search.NRTManager.TrackingIndexWriter;
 import org.apache.lucene.search.NRTManagerReopenThread;
 import org.apache.lucene.search.SearcherFactory;
-import org.apache.lucene.search.Similarity;
+import org.apache.lucene.search.similarities.Similarity;
 import org.apache.lucene.store.Directory;
 
 

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/55a3b5f4/src/blur-core/src/main/java/org/apache/blur/manager/writer/DirectoryReferenceCounter.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/manager/writer/DirectoryReferenceCounter.java
b/src/blur-core/src/main/java/org/apache/blur/manager/writer/DirectoryReferenceCounter.java
index 124b06d..56f9caf 100644
--- a/src/blur-core/src/main/java/org/apache/blur/manager/writer/DirectoryReferenceCounter.java
+++ b/src/blur-core/src/main/java/org/apache/blur/manager/writer/DirectoryReferenceCounter.java
@@ -26,12 +26,12 @@ import org.apache.blur.log.Log;
 import org.apache.blur.log.LogFactory;
 import org.apache.lucene.index.IndexFileNames;
 import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.IOContext;
 import org.apache.lucene.store.IndexInput;
 import org.apache.lucene.store.IndexOutput;
 import org.apache.lucene.store.Lock;
 import org.apache.lucene.store.LockFactory;
 
-
 public class DirectoryReferenceCounter extends Directory {
 
   private final static Log LOG = LogFactory.getLog(DirectoryReferenceCounter.class);
@@ -58,16 +58,10 @@ public class DirectoryReferenceCounter extends Directory {
     }
   }
 
-  private void addToFileGC(String name) {
-    if (gc != null) {
-      LOG.debug("Add file [{0}] to be GCed once refs are closed.", name);
-      gc.add(directory, name, refs);
-    }
-  }
-
-  public IndexOutput createOutput(String name) throws IOException {
+  @Override
+  public IndexOutput createOutput(String name, IOContext context) throws IOException {
     if (name.equals(IndexFileNames.SEGMENTS_GEN)) {
-      return directory.createOutput(name);
+      return directory.createOutput(name, context);
     }
     LOG.debug("Create file [{0}]", name);
     AtomicInteger counter = refs.get(name);
@@ -77,42 +71,26 @@ public class DirectoryReferenceCounter extends Directory {
     }
     counter = new AtomicInteger(0);
     refs.put(name, counter);
-    return directory.createOutput(name);
+    return directory.createOutput(name, context);
   }
 
-  public IndexInput openInput(String name) throws IOException {
-    IndexInput input = directory.openInput(name);
+  @Override
+  public IndexInput openInput(String name, IOContext context) throws IOException {
+    IndexInput input = directory.openInput(name, context);
     if (name.equals(IndexFileNames.SEGMENTS_GEN)) {
       return input;
     }
     return wrap(name, input);
   }
 
-  public IndexInput openInput(String name, int bufferSize) throws IOException {
-    IndexInput input = directory.openInput(name, bufferSize);
-    if (name.equals(IndexFileNames.SEGMENTS_GEN)) {
-      return input;
-    }
-    return wrap(name, input);
-  }
-
-  private IndexInput wrap(String name, IndexInput input) {
-    AtomicInteger counter = refs.get(name);
-    if (counter == null) {
-      counter = new AtomicInteger();
-      refs.put(name, counter);
-    }
-    return new RefIndexInput(input, counter);
-  }
-
-  @SuppressWarnings("deprecation")
   public static class RefIndexInput extends IndexInput {
 
     private IndexInput input;
     private AtomicInteger ref;
     private boolean closed = false;
 
-    public RefIndexInput(IndexInput input, AtomicInteger ref) {
+    public RefIndexInput(String resourceDescription, IndexInput input, AtomicInteger ref)
{
+      super(resourceDescription);
       this.input = input;
       this.ref = ref;
       ref.incrementAndGet();
@@ -124,21 +102,15 @@ public class DirectoryReferenceCounter extends Directory {
       close();
     }
 
-    public Object clone() {
+    @Override
+    public RefIndexInput clone() {
       RefIndexInput ref = (RefIndexInput) super.clone();
       ref.input = (IndexInput) input.clone();
       ref.ref.incrementAndGet();
       return ref;
     }
 
-    public void skipChars(int length) throws IOException {
-      input.skipChars(length);
-    }
-
-    public void setModifiedUTF8StringsMode() {
-      input.setModifiedUTF8StringsMode();
-    }
-
+    @Override
     public void close() throws IOException {
       if (!closed) {
         input.close();
@@ -147,133 +119,151 @@ public class DirectoryReferenceCounter extends Directory {
       }
     }
 
+    @Override
     public short readShort() throws IOException {
       return input.readShort();
     }
 
+    @Override
     public int readInt() throws IOException {
       return input.readInt();
     }
 
+    @Override
     public void seek(long pos) throws IOException {
       input.seek(pos);
     }
 
-    public void copyBytes(IndexOutput out, long numBytes) throws IOException {
-      input.copyBytes(out, numBytes);
-    }
-
+    @Override
     public int readVInt() throws IOException {
       return input.readVInt();
     }
 
+    @Override
     public String toString() {
       return input.toString();
     }
 
+    @Override
     public long readLong() throws IOException {
       return input.readLong();
     }
 
+    @Override
     public long readVLong() throws IOException {
       return input.readVLong();
     }
 
+    @Override
     public String readString() throws IOException {
       return input.readString();
     }
 
+    @Override
     public long getFilePointer() {
       return input.getFilePointer();
     }
 
+    @Override
     public byte readByte() throws IOException {
       return input.readByte();
     }
 
+    @Override
     public void readBytes(byte[] b, int offset, int len) throws IOException {
       input.readBytes(b, offset, len);
     }
 
+    @Override
     public void readBytes(byte[] b, int offset, int len, boolean useBuffer) throws IOException
{
       input.readBytes(b, offset, len, useBuffer);
     }
 
+    @Override
     public long length() {
       return input.length();
     }
 
-    public void readChars(char[] buffer, int start, int length) throws IOException {
-      input.readChars(buffer, start, length);
-    }
-
+    @Override
     public Map<String, String> readStringStringMap() throws IOException {
       return input.readStringStringMap();
     }
 
   }
 
-  @SuppressWarnings("deprecation")
-  public void touchFile(String name) throws IOException {
-    directory.touchFile(name);
-  }
-
-  @SuppressWarnings("deprecation")
-  public void sync(String name) throws IOException {
-    directory.sync(name);
-  }
-
+  @Override
   public void sync(Collection<String> names) throws IOException {
     directory.sync(names);
   }
 
+  @Override
   public void clearLock(String name) throws IOException {
     directory.clearLock(name);
   }
 
+  @Override
   public void close() throws IOException {
     directory.close();
   }
 
+  @Override
   public void setLockFactory(LockFactory lockFactory) throws IOException {
     directory.setLockFactory(lockFactory);
   }
 
+  @Override
   public String getLockID() {
     return directory.getLockID();
   }
 
-  public void copy(Directory to, String src, String dest) throws IOException {
-    directory.copy(to, src, dest);
+  @Override
+  public void copy(Directory to, String src, String dest, IOContext context) throws IOException
{
+    directory.copy(to, src, dest, context);
   }
 
+  @Override
   public boolean fileExists(String name) throws IOException {
     return directory.fileExists(name);
   }
 
-  @SuppressWarnings("deprecation")
-  public long fileModified(String name) throws IOException {
-    return directory.fileModified(name);
-  }
-
+  @Override
   public long fileLength(String name) throws IOException {
     return directory.fileLength(name);
   }
 
+  @Override
   public LockFactory getLockFactory() {
     return directory.getLockFactory();
   }
 
+  @Override
   public String[] listAll() throws IOException {
     return directory.listAll();
   }
 
+  @Override
   public Lock makeLock(String name) {
     return directory.makeLock(name);
   }
 
+  @Override
   public String toString() {
     return directory.toString();
   }
 
+  private void addToFileGC(String name) {
+    if (gc != null) {
+      LOG.debug("Add file [{0}] to be GCed once refs are closed.", name);
+      gc.add(directory, name, refs);
+    }
+  }
+
+  private IndexInput wrap(String name, IndexInput input) {
+    AtomicInteger counter = refs.get(name);
+    if (counter == null) {
+      counter = new AtomicInteger();
+      refs.put(name, counter);
+    }
+    return new RefIndexInput(input.toString(), input, counter);
+  }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/55a3b5f4/src/blur-core/src/main/java/org/apache/blur/manager/writer/TransactionRecorder.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/manager/writer/TransactionRecorder.java
b/src/blur-core/src/main/java/org/apache/blur/manager/writer/TransactionRecorder.java
index 9d8f1c7..2f24e22 100644
--- a/src/blur-core/src/main/java/org/apache/blur/manager/writer/TransactionRecorder.java
+++ b/src/blur-core/src/main/java/org/apache/blur/manager/writer/TransactionRecorder.java
@@ -46,13 +46,11 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.record.Utils;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
-import org.apache.lucene.document.Field.Index;
-import org.apache.lucene.document.Field.Store;
+import org.apache.lucene.document.FieldType;
 import org.apache.lucene.index.CorruptIndexException;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.NRTManager.TrackingIndexWriter;
 
-
 public class TransactionRecorder {
 
   enum TYPE {
@@ -80,7 +78,16 @@ public class TransactionRecorder {
   }
 
   private static final Log LOG = LogFactory.getLog(TransactionRecorder.class);
-  private static final Term ROW_ID = new Term(BlurConstants.ROW_ID);
+  private static FieldType ID_TYPE;
+
+  static {
+    ID_TYPE = new FieldType();
+    ID_TYPE.setIndexed(true);
+    ID_TYPE.setTokenized(false);
+    ID_TYPE.setOmitNorms(true);
+    ID_TYPE.setStored(true);
+  }
+
   private AtomicBoolean running = new AtomicBoolean(true);
   private Path walPath;
   private Configuration configuration;
@@ -127,12 +134,12 @@ public class TransactionRecorder {
       switch (lookup) {
       case ROW:
         Row row = readRow(dataInputStream);
-        writer.updateDocuments(ROW_ID.createTerm(row.id), getDocs(row, analyzer));
+        writer.updateDocuments(createRowId(row.id), getDocs(row, analyzer));
         updateCount++;
         continue;
       case DELETE:
         String deleteRowId = readString(dataInputStream);
-        writer.deleteDocuments(ROW_ID.createTerm(deleteRowId));
+        writer.deleteDocuments(createRowId(deleteRowId));
         deleteCount++;
         continue;
       default:
@@ -273,7 +280,7 @@ public class TransactionRecorder {
         sync(baos.toByteArray());
       }
     }
-    Term term = ROW_ID.createTerm(row.id);
+    Term term = createRowId(row.id);
     List<Document> docs = getDocs(row, analyzer);
     return writer.updateDocuments(term, docs);
   }
@@ -289,7 +296,7 @@ public class TransactionRecorder {
         sync(baos.toByteArray());
       }
     }
-    return writer.deleteDocuments(ROW_ID.createTerm(rowId));
+    return writer.deleteDocuments(createRowId(rowId));
   }
 
   public void setWalPath(Path walPath) {
@@ -330,8 +337,8 @@ public class TransactionRecorder {
 
   public static Document convert(String rowId, Record record, StringBuilder builder, BlurAnalyzer
analyzer) {
     Document document = new Document();
-    document.add(new Field(BlurConstants.ROW_ID, rowId, Store.YES, Index.NOT_ANALYZED_NO_NORMS));
-    document.add(new Field(BlurConstants.RECORD_ID, record.recordId, Store.YES, Index.NOT_ANALYZED_NO_NORMS));
+    document.add(new Field(BlurConstants.ROW_ID, rowId, ID_TYPE));
+    document.add(new Field(BlurConstants.RECORD_ID, record.recordId, ID_TYPE));
     RowIndexWriter.addColumns(document, analyzer, builder, record.family, record.columns);
     return document;
   }
@@ -339,4 +346,8 @@ public class TransactionRecorder {
   public void setAnalyzer(BlurAnalyzer analyzer) {
     this.analyzer = analyzer;
   }
+
+  private Term createRowId(String id) {
+    return new Term(BlurConstants.ROW_ID, id);
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/55a3b5f4/src/blur-core/src/test/java/org/apache/blur/manager/writer/BlurNRTIndexTest.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/test/java/org/apache/blur/manager/writer/BlurNRTIndexTest.java
b/src/blur-core/src/test/java/org/apache/blur/manager/writer/BlurNRTIndexTest.java
index 9e402f0..20883e0 100644
--- a/src/blur-core/src/test/java/org/apache/blur/manager/writer/BlurNRTIndexTest.java
+++ b/src/blur-core/src/test/java/org/apache/blur/manager/writer/BlurNRTIndexTest.java
@@ -26,20 +26,18 @@ import java.util.concurrent.ExecutorService;
 
 import org.apache.blur.analysis.BlurAnalyzer;
 import org.apache.blur.concurrent.Executors;
-import org.apache.blur.lucene.search.FairSimilarity;
 import org.apache.blur.thrift.generated.Column;
 import org.apache.blur.thrift.generated.Record;
 import org.apache.blur.thrift.generated.Row;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.Path;
-import org.apache.lucene.analysis.KeywordAnalyzer;
+import org.apache.lucene.analysis.core.KeywordAnalyzer;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.store.FSDirectory;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-
 public class BlurNRTIndexTest {
 
   private static final int TEST_NUMBER_WAIT_VISIBLE = 500;
@@ -70,7 +68,6 @@ public class BlurNRTIndexTest {
     writer.setDirectory(FSDirectory.open(new File(base, "index")));
     writer.setCloser(closer);
     writer.setAnalyzer(analyzer);
-    writer.setSimilarity(new FairSimilarity());
     writer.setTable("testing-table");
     writer.setShard("testing-shard");
 
@@ -133,9 +130,12 @@ public class BlurNRTIndexTest {
     double seconds = (e - s) / 1000000000.0;
     double rate = total / seconds;
     System.out.println("Rate " + rate);
+    //wait one second for the data to become visible the test is set to refresh once every
25 ms
+    Thread.sleep(1000);
     writer.refresh();
     IndexReader reader = writer.getIndexReader();
     assertEquals(TEST_NUMBER, reader.numDocs());
+    reader.decRef();
   }
 
   private Row genRow() {

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/55a3b5f4/src/blur-core/src/test/java/org/apache/blur/manager/writer/DirectoryReferenceCounterTest.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/test/java/org/apache/blur/manager/writer/DirectoryReferenceCounterTest.java
b/src/blur-core/src/test/java/org/apache/blur/manager/writer/DirectoryReferenceCounterTest.java
index c0999a8..c0106bf 100644
--- a/src/blur-core/src/test/java/org/apache/blur/manager/writer/DirectoryReferenceCounterTest.java
+++ b/src/blur-core/src/test/java/org/apache/blur/manager/writer/DirectoryReferenceCounterTest.java
@@ -17,6 +17,7 @@ package org.apache.blur.manager.writer;
  * limitations under the License.
  */
 
+import static org.apache.blur.lucene.LuceneVersionConstant.LUCENE_VERSION;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
@@ -26,40 +27,37 @@ import java.util.Collection;
 import java.util.Map;
 import java.util.concurrent.LinkedBlockingQueue;
 
-import org.apache.blur.manager.writer.DirectoryReferenceCounter;
-import org.apache.blur.manager.writer.DirectoryReferenceFileGC;
-import org.apache.lucene.analysis.KeywordAnalyzer;
+import org.apache.lucene.analysis.core.KeywordAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
-import org.apache.lucene.document.Field.Index;
-import org.apache.lucene.document.Field.Store;
+import org.apache.lucene.document.FieldType;
 import org.apache.lucene.index.CorruptIndexException;
+import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.IndexWriterConfig;
 import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.IOContext;
 import org.apache.lucene.store.IndexInput;
 import org.apache.lucene.store.IndexOutput;
 import org.apache.lucene.store.Lock;
 import org.apache.lucene.store.LockFactory;
 import org.apache.lucene.store.LockObtainFailedException;
 import org.apache.lucene.store.RAMDirectory;
-import org.apache.lucene.util.Version;
 import org.junit.Test;
 
-
 public class DirectoryReferenceCounterTest {
 
   @Test
   public void testDirectoryReferenceCounterTestError() throws CorruptIndexException, IOException
{
     Directory directory = wrap(new RAMDirectory());
-    IndexWriterConfig conf = new IndexWriterConfig(Version.LUCENE_36, new KeywordAnalyzer());
+    IndexWriterConfig conf = new IndexWriterConfig(LUCENE_VERSION, new KeywordAnalyzer());
     IndexWriter writer = new IndexWriter(directory, conf);
     int size = 100;
     IndexReader[] readers = new IndexReader[size];
     for (int i = 0; i < size; i++) {
       writer.addDocument(getDoc());
-      readers[i] = IndexReader.open(writer, true);
+      readers[i] = DirectoryReader.open(writer, true);
       writer.forceMerge(1);
     }
 
@@ -79,14 +77,14 @@ public class DirectoryReferenceCounterTest {
     DirectoryReferenceFileGC gc = new DirectoryReferenceFileGC();
     gc.init();
     DirectoryReferenceCounter counter = new DirectoryReferenceCounter(directory, gc);
-    IndexWriterConfig conf = new IndexWriterConfig(Version.LUCENE_36, new KeywordAnalyzer());
+    IndexWriterConfig conf = new IndexWriterConfig(LUCENE_VERSION, new KeywordAnalyzer());
     IndexWriter writer = new IndexWriter(counter, conf);
     int size = 100;
     IndexReader[] readers = new IndexReader[size];
     for (int i = 0; i < size; i++) {
       writer.addDocument(getDoc());
       writer.forceMerge(1);
-      readers[i] = IndexReader.open(writer, true);
+      readers[i] = DirectoryReader.open(writer, true);
     }
 
     for (int i = 0; i < size; i++) {
@@ -118,7 +116,12 @@ public class DirectoryReferenceCounterTest {
 
   private Document getDoc() {
     Document document = new Document();
-    document.add(new Field("id", "value", Store.YES, Index.NOT_ANALYZED_NO_NORMS));
+    FieldType type = new FieldType();
+    type.setIndexed(true);
+    type.setOmitNorms(true);
+    type.setTokenized(false);
+    type.setStored(true);
+    document.add(new Field("id", "value", type));
     return document;
   }
 
@@ -126,7 +129,7 @@ public class DirectoryReferenceCounterTest {
     for (int i = 0; i < size; i++) {
       Document document = indexReader.document(i);
       String value = document.get("id");
-      assertEquals(value, "value");
+      assertEquals("value", value);
     }
   }
 
@@ -137,99 +140,91 @@ public class DirectoryReferenceCounterTest {
       private Directory d = ramDirectory;
       private Collection<String> deletedFiles = new LinkedBlockingQueue<String>();
 
-      @SuppressWarnings("deprecation")
-      public void touchFile(String name) throws IOException {
-        d.touchFile(name);
-      }
-
+      @Override
       public void deleteFile(String name) throws IOException {
         deletedFiles.add(name);
         d.deleteFile(name);
       }
 
-      public IndexOutput createOutput(String name) throws IOException {
-        return d.createOutput(name);
-      }
-
-      @SuppressWarnings("deprecation")
-      public void sync(String name) throws IOException {
-        d.sync(name);
+      @Override
+      public IndexOutput createOutput(String name, IOContext context) throws IOException
{
+        return d.createOutput(name, context);
       }
 
+      @Override
       public void sync(Collection<String> names) throws IOException {
         d.sync(names);
       }
 
-      public IndexInput openInput(String name) throws IOException {
-        return wrap(d.openInput(name), deletedFiles, name);
-      }
-
-      public IndexInput openInput(String name, int bufferSize) throws IOException {
-        return wrap(d.openInput(name, bufferSize), deletedFiles, name);
+      @Override
+      public IndexInput openInput(String name, IOContext context) throws IOException {
+        return wrap(d.openInput(name, context), deletedFiles, name);
       }
 
+      @Override
       public void clearLock(String name) throws IOException {
         d.clearLock(name);
       }
 
+      @Override
       public void close() throws IOException {
         d.close();
       }
 
+      @Override
       public void setLockFactory(LockFactory lockFactory) throws IOException {
         d.setLockFactory(lockFactory);
       }
 
+      @Override
       public String getLockID() {
         return d.getLockID();
       }
 
-      public void copy(Directory to, String src, String dest) throws IOException {
-        d.copy(to, src, dest);
-      }
-
+      @Override
       public boolean equals(Object arg0) {
         return d.equals(arg0);
       }
 
+      @Override
       public boolean fileExists(String name) throws IOException {
         return d.fileExists(name);
       }
 
-      @SuppressWarnings("deprecation")
-      public long fileModified(String name) throws IOException {
-        return d.fileModified(name);
-      }
-
+      @Override
       public long fileLength(String name) throws IOException {
         return d.fileLength(name);
       }
 
+      @Override
       public LockFactory getLockFactory() {
         return d.getLockFactory();
       }
 
+      @Override
       public int hashCode() {
         return d.hashCode();
       }
 
+      @Override
       public String[] listAll() throws IOException {
         return d.listAll();
       }
 
+      @Override
       public Lock makeLock(String name) {
         return d.makeLock(name);
       }
 
+      @Override
       public String toString() {
         return d.toString();
       }
     };
   }
 
-  @SuppressWarnings("deprecation")
   public static IndexInput wrap(final IndexInput input, final Collection<String> deletedFiles,
final String name) {
-    return new IndexInput() {
+    return new IndexInput(input.toString()) {
       private IndexInput in = input;
 
       private void checkForDeleted() throws IOException {
@@ -238,104 +233,103 @@ public class DirectoryReferenceCounterTest {
         }
       }
 
-      public void skipChars(int length) throws IOException {
-        checkForDeleted();
-        in.skipChars(length);
-      }
-
-      public void setModifiedUTF8StringsMode() {
-        in.setModifiedUTF8StringsMode();
-      }
-
+      @Override
       public void close() throws IOException {
         checkForDeleted();
         in.close();
       }
 
+      @Override
       public short readShort() throws IOException {
         checkForDeleted();
         return in.readShort();
       }
 
+      @Override
       public void seek(long pos) throws IOException {
         checkForDeleted();
         in.seek(pos);
       }
 
+      @Override
       public int readInt() throws IOException {
         checkForDeleted();
         return in.readInt();
       }
 
-      public void copyBytes(IndexOutput out, long numBytes) throws IOException {
-        checkForDeleted();
-        in.copyBytes(out, numBytes);
-      }
-
+      @Override
       public int readVInt() throws IOException {
         checkForDeleted();
         return in.readVInt();
       }
 
+      @Override
       public String toString() {
         return in.toString();
       }
 
+      @Override
       public long readLong() throws IOException {
         checkForDeleted();
         return in.readLong();
       }
 
+      @Override
       public long readVLong() throws IOException {
         checkForDeleted();
         return in.readVLong();
       }
 
+      @Override
       public String readString() throws IOException {
         checkForDeleted();
         return in.readString();
       }
 
-      public Object clone() {
+      @Override
+      public IndexInput clone() {
         return super.clone();
       }
 
+      @Override
       public boolean equals(Object obj) {
         return in.equals(obj);
       }
 
+      @Override
       public long getFilePointer() {
         return in.getFilePointer();
       }
 
+      @Override
       public int hashCode() {
         return in.hashCode();
       }
 
+      @Override
       public byte readByte() throws IOException {
         checkForDeleted();
         return in.readByte();
       }
 
+      @Override
       public void readBytes(byte[] b, int offset, int len) throws IOException {
         checkForDeleted();
         in.readBytes(b, offset, len);
       }
 
+      @Override
       public void readBytes(byte[] b, int offset, int len, boolean useBuffer) throws IOException
{
         checkForDeleted();
         in.readBytes(b, offset, len, useBuffer);
       }
 
+      @Override
       public long length() {
         return in.length();
       }
 
-      public void readChars(char[] buffer, int start, int length) throws IOException {
-        checkForDeleted();
-        in.readChars(buffer, start, length);
-      }
-
+      @Override
       public Map<String, String> readStringStringMap() throws IOException {
         checkForDeleted();
         return in.readStringStringMap();

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/55a3b5f4/src/blur-core/src/test/java/org/apache/blur/manager/writer/TransactionRecorderTest.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/test/java/org/apache/blur/manager/writer/TransactionRecorderTest.java
b/src/blur-core/src/test/java/org/apache/blur/manager/writer/TransactionRecorderTest.java
index 06180dc..ef43df4 100644
--- a/src/blur-core/src/test/java/org/apache/blur/manager/writer/TransactionRecorderTest.java
+++ b/src/blur-core/src/test/java/org/apache/blur/manager/writer/TransactionRecorderTest.java
@@ -17,6 +17,7 @@ package org.apache.blur.manager.writer;
  * limitations under the License.
  */
 
+import static org.apache.blur.lucene.LuceneVersionConstant.LUCENE_VERSION;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
@@ -30,14 +31,13 @@ import org.apache.blur.thrift.generated.Record;
 import org.apache.blur.thrift.generated.Row;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.Path;
-import org.apache.lucene.analysis.KeywordAnalyzer;
+import org.apache.lucene.analysis.core.KeywordAnalyzer;
+import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriterConfig;
 import org.apache.lucene.store.RAMDirectory;
-import org.apache.lucene.util.Version;
 import org.junit.Test;
 
-
 public class TransactionRecorderTest {
 
   @Test
@@ -65,7 +65,7 @@ public class TransactionRecorderTest {
                                  // the file to disk for reading
 
     RAMDirectory directory = new RAMDirectory();
-    IndexWriterConfig conf = new IndexWriterConfig(Version.LUCENE_35, analyzer);
+    IndexWriterConfig conf = new IndexWriterConfig(LUCENE_VERSION, analyzer);
     IndexWriter writer = new IndexWriter(directory, conf);
 
     TransactionRecorder replayTransactionRecorder = new TransactionRecorder();
@@ -75,7 +75,7 @@ public class TransactionRecorderTest {
     replayTransactionRecorder.init();
 
     replayTransactionRecorder.replay(writer);
-    IndexReader reader = IndexReader.open(directory);
+    IndexReader reader = DirectoryReader.open(directory);
     assertEquals(1, reader.numDocs());
   }
 


Mime
View raw message