lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sim...@apache.org
Subject svn commit: r1137639 [4/4] - in /lucene/dev/branches/LUCENE2793: lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/ lucene/contrib/misc/src/java/org/apache/lucene/store/ lucene/contrib/misc/src/test/org/apache/lucene/index/codecs/ap...
Date Mon, 20 Jun 2011 14:28:29 GMT
Modified: lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/index/TestSegmentReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/index/TestSegmentReader.java?rev=1137639&r1=1137638&r2=1137639&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/index/TestSegmentReader.java
(original)
+++ lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/index/TestSegmentReader.java
Mon Jun 20 14:28:24 2011
@@ -27,6 +27,7 @@ import org.apache.lucene.util.BytesRef;
 
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Fieldable;
+import org.apache.lucene.index.IOContext.Context;
 import org.apache.lucene.store.Directory;
 
 public class TestSegmentReader extends LuceneTestCase {
@@ -41,7 +42,7 @@ public class TestSegmentReader extends L
     dir = newDirectory();
     DocHelper.setupDoc(testDoc);
     SegmentInfo info = DocHelper.writeDoc(random, dir, testDoc);
-    reader = SegmentReader.get(true, info, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR);
+    reader = SegmentReader.get(true, info, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR, IOContext.READ);
   }
   
   @Override
@@ -77,7 +78,7 @@ public class TestSegmentReader extends L
     Document docToDelete = new Document();
     DocHelper.setupDoc(docToDelete);
     SegmentInfo info = DocHelper.writeDoc(random, dir, docToDelete);
-    SegmentReader deleteReader = SegmentReader.get(false, info, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR);
+    SegmentReader deleteReader = SegmentReader.get(false, info, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR,
IOContext.READ);
     assertTrue(deleteReader != null);
     assertTrue(deleteReader.numDocs() == 1);
     deleteReader.deleteDocument(0);

Modified: lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/index/TestSegmentTermDocs.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/index/TestSegmentTermDocs.java?rev=1137639&r1=1137638&r2=1137639&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/index/TestSegmentTermDocs.java
(original)
+++ lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/index/TestSegmentTermDocs.java
Mon Jun 20 14:28:24 2011
@@ -55,7 +55,7 @@ public class TestSegmentTermDocs extends
 
   public void testTermDocs(int indexDivisor) throws IOException {
     //After adding the document, we should be able to read it back in
-    SegmentReader reader = SegmentReader.get(true, info, indexDivisor);
+    SegmentReader reader = SegmentReader.get(true, info, indexDivisor, IOContext.DEFAULT);
     assertTrue(reader != null);
     assertEquals(indexDivisor, reader.getTermInfosIndexDivisor());
 
@@ -78,7 +78,7 @@ public class TestSegmentTermDocs extends
   public void testBadSeek(int indexDivisor) throws IOException {
     {
       //After adding the document, we should be able to read it back in
-      SegmentReader reader = SegmentReader.get(true, info, indexDivisor);
+      SegmentReader reader = SegmentReader.get(true, info, indexDivisor, IOContext.DEFAULT);
       assertTrue(reader != null);
       DocsEnum termDocs = reader.termDocsEnum(reader.getDeletedDocs(),
                                               "textField2",
@@ -89,7 +89,7 @@ public class TestSegmentTermDocs extends
     }
     {
       //After adding the document, we should be able to read it back in
-      SegmentReader reader = SegmentReader.get(true, info, indexDivisor);
+      SegmentReader reader = SegmentReader.get(true, info, indexDivisor, IOContext.DEFAULT);
       assertTrue(reader != null);
       DocsEnum termDocs = reader.termDocsEnum(reader.getDeletedDocs(),
                                               "junk",

Modified: lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java?rev=1137639&r1=1137638&r2=1137639&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java
(original)
+++ lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java
Mon Jun 20 14:28:24 2011
@@ -202,7 +202,7 @@ public class TestSnapshotDeletionPolicy 
   byte[] buffer = new byte[4096];
 
   private void readFile(Directory dir, String name) throws Exception {
-    IndexInput input = dir.openInput(name);
+    IndexInput input = dir.openInput(name, IOContext.DEFAULT);
     try {
       long size = dir.fileLength(name);
       long bytesLeft = size;

Modified: lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/index/TestTermVectorsReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/index/TestTermVectorsReader.java?rev=1137639&r1=1137638&r2=1137639&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/index/TestTermVectorsReader.java
(original)
+++ lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/index/TestTermVectorsReader.java
Mon Jun 20 14:28:24 2011
@@ -31,6 +31,7 @@ import org.apache.lucene.analysis.tokena
 import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
+import org.apache.lucene.index.IOContext.Context;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.LuceneTestCase;
@@ -174,7 +175,7 @@ public class TestTermVectorsReader exten
   }
 
   public void testReader() throws IOException {
-    TermVectorsReader reader = new TermVectorsReader(dir, seg, fieldInfos);
+    TermVectorsReader reader = new TermVectorsReader(dir, seg, fieldInfos, IOContext.READ);
     for (int j = 0; j < 5; j++) {
       TermFreqVector vector = reader.get(j, testFields[0]);
       assertTrue(vector != null);
@@ -191,7 +192,7 @@ public class TestTermVectorsReader exten
   }
 
   public void testPositionReader() throws IOException {
-    TermVectorsReader reader = new TermVectorsReader(dir, seg, fieldInfos);
+    TermVectorsReader reader = new TermVectorsReader(dir, seg, fieldInfos, IOContext.READ);
     TermPositionVector vector;
     BytesRef[] terms;
     vector = (TermPositionVector) reader.get(0, testFields[0]);
@@ -234,7 +235,7 @@ public class TestTermVectorsReader exten
   }
 
   public void testOffsetReader() throws IOException {
-    TermVectorsReader reader = new TermVectorsReader(dir, seg, fieldInfos);
+    TermVectorsReader reader = new TermVectorsReader(dir, seg, fieldInfos, IOContext.READ);
     TermPositionVector vector = (TermPositionVector) reader.get(0, testFields[0]);
     assertTrue(vector != null);
     BytesRef[] terms = vector.getTerms();
@@ -263,7 +264,7 @@ public class TestTermVectorsReader exten
   }
 
   public void testMapper() throws IOException {
-    TermVectorsReader reader = new TermVectorsReader(dir, seg, fieldInfos);
+    TermVectorsReader reader = new TermVectorsReader(dir, seg, fieldInfos, IOContext.READ);
     SortedTermVectorMapper mapper = new SortedTermVectorMapper(new TermVectorEntryFreqSortedComparator());
     reader.get(0, mapper);
     SortedSet<TermVectorEntry> set = mapper.getTermVectorEntrySet();
@@ -384,7 +385,7 @@ public class TestTermVectorsReader exten
   public void testBadParams() throws IOException {
     TermVectorsReader reader = null;
     try {
-      reader = new TermVectorsReader(dir, seg, fieldInfos);
+      reader = new TermVectorsReader(dir, seg, fieldInfos, IOContext.READ);
       //Bad document number, good field number
       reader.get(50, testFields[0]);
       fail();
@@ -394,7 +395,7 @@ public class TestTermVectorsReader exten
       reader.close();
     }
     try {
-      reader = new TermVectorsReader(dir, seg, fieldInfos);
+      reader = new TermVectorsReader(dir, seg, fieldInfos, IOContext.READ);
       //Bad document number, no field
       reader.get(50);
       fail();
@@ -404,7 +405,7 @@ public class TestTermVectorsReader exten
       reader.close();
     }
     try {
-      reader = new TermVectorsReader(dir, seg, fieldInfos);
+      reader = new TermVectorsReader(dir, seg, fieldInfos, IOContext.READ);
       //good document number, bad field number
       TermFreqVector vector = reader.get(0, "f50");
       assertTrue(vector == null);

Modified: lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/index/TestTermVectorsWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/index/TestTermVectorsWriter.java?rev=1137639&r1=1137638&r2=1137639&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/index/TestTermVectorsWriter.java
(original)
+++ lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/index/TestTermVectorsWriter.java
Mon Jun 20 14:28:24 2011
@@ -299,7 +299,7 @@ public class TestTermVectorsWriter exten
           .setMergeScheduler(new SerialMergeScheduler()).setMergePolicy(
               new LogDocMergePolicy()));
 
-      Directory[] indexDirs = {new MockDirectoryWrapper(random, new RAMDirectory(dir))};
+      Directory[] indexDirs = {new MockDirectoryWrapper(random, new RAMDirectory(dir, IOContext.DEFAULT))};
       writer.addIndexes(indexDirs);
       writer.optimize();
       writer.close();

Modified: lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/index/codecs/intblock/TestIntBlockCodec.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/index/codecs/intblock/TestIntBlockCodec.java?rev=1137639&r1=1137638&r2=1137639&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/index/codecs/intblock/TestIntBlockCodec.java
(original)
+++ lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/index/codecs/intblock/TestIntBlockCodec.java
Mon Jun 20 14:28:24 2011
@@ -19,6 +19,7 @@ package org.apache.lucene.index.codecs.i
 
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.store.*;
+import org.apache.lucene.index.IOContext;
 import org.apache.lucene.index.codecs.sep.*;
 import org.apache.lucene.index.codecs.mockintblock.*;
 
@@ -35,7 +36,7 @@ public class TestIntBlockCodec extends L
     }
     out.close();
 
-    IntIndexInput in = f.openInput(dir, "test");
+    IntIndexInput in = f.openInput(dir, "test", IOContext.DEFAULT);
     IntIndexInput.Reader r = in.reader();
 
     for(int i=0;i<11777;i++) {
@@ -55,7 +56,7 @@ public class TestIntBlockCodec extends L
     // write no ints
     out.close();
 
-    IntIndexInput in = f.openInput(dir, "test");
+    IntIndexInput in = f.openInput(dir, "test", IOContext.DEFAULT);
     in.reader();
     // read no ints
     in.close();

Modified: lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/search/TestBoolean2.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/search/TestBoolean2.java?rev=1137639&r1=1137638&r2=1137639&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/search/TestBoolean2.java
(original)
+++ lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/search/TestBoolean2.java
Mon Jun 20 14:28:24 2011
@@ -23,6 +23,7 @@ import java.util.Random;
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
+import org.apache.lucene.index.IOContext;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.index.IndexReader;
@@ -64,13 +65,13 @@ public class TestBoolean2 extends Lucene
     searcher = new IndexSearcher(directory, true);
 
     // Make big index
-    dir2 = new MockDirectoryWrapper(random, new RAMDirectory(directory));
+    dir2 = new MockDirectoryWrapper(random, new RAMDirectory(directory, IOContext.DEFAULT));
 
     // First multiply small test index:
     mulFactor = 1;
     int docCount = 0;
     do {
-      final Directory copy = new MockDirectoryWrapper(random, new RAMDirectory(dir2));
+      final Directory copy = new MockDirectoryWrapper(random, new RAMDirectory(dir2, IOContext.DEFAULT));
       RandomIndexWriter w = new RandomIndexWriter(random, dir2);
       w.addIndexes(copy);
       docCount = w.maxDoc();

Modified: lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/store/TestBufferedIndexInput.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/store/TestBufferedIndexInput.java?rev=1137639&r1=1137638&r2=1137639&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/store/TestBufferedIndexInput.java
(original)
+++ lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/store/TestBufferedIndexInput.java
Mon Jun 20 14:28:24 2011
@@ -29,6 +29,7 @@ import java.util.Random;
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
+import org.apache.lucene.index.IOContext;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.IndexWriterConfig;
@@ -93,11 +94,11 @@ public class TestBufferedIndexInput exte
 
     // run test with chunk size of 10 bytes
     runReadBytesAndClose(new SimpleFSIndexInput(tmpInputFile,
-                                                inputBufferSize, 10), inputBufferSize, random);
+                                                IOContext.DEFAULT, 10), inputBufferSize,
random);
 
     // run test with chunk size of 10 bytes
     runReadBytesAndClose(new NIOFSIndexInput(tmpInputFile,
-                                             inputBufferSize, 10), inputBufferSize, random);
+                                             IOContext.DEFAULT, 10), inputBufferSize, random);
   }
 
   private void runReadBytesAndClose(IndexInput input, int bufferSize, Random r)
@@ -303,11 +304,6 @@ public class TestBufferedIndexInput exte
         dir = new SimpleFSDirectory(path, null);
       }
 
-      @Override
-      public IndexInput openInput(String name) throws IOException {
-        return openInput(name, BufferedIndexInput.BUFFER_SIZE);
-      }
-
       public void tweakBufferSizes() {
         //int count = 0;
         for (final IndexInput ip : allIndexInputs) {
@@ -320,17 +316,17 @@ public class TestBufferedIndexInput exte
       }
       
       @Override
-      public IndexInput openInput(String name, int bufferSize) throws IOException {
+      public IndexInput openInput(String name, IOContext context) throws IOException {
         // Make random changes to buffer size
-        bufferSize = 1+Math.abs(rand.nextInt() % 10);
-        IndexInput f = dir.openInput(name, bufferSize);
+        //bufferSize = 1+Math.abs(rand.nextInt() % 10);
+        IndexInput f = dir.openInput(name, context);
         allIndexInputs.add(f);
         return f;
       }
 
       @Override
-      public IndexOutput createOutput(String name) throws IOException {
-        return dir.createOutput(name);
+      public IndexOutput createOutput(String name, IOContext context) throws IOException
{
+        return dir.createOutput(name, context);
       }
 
       @Override

Modified: lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/store/TestCopyBytes.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/store/TestCopyBytes.java?rev=1137639&r1=1137638&r2=1137639&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/store/TestCopyBytes.java
(original)
+++ lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/store/TestCopyBytes.java
Mon Jun 20 14:28:24 2011
@@ -18,6 +18,7 @@ package org.apache.lucene.store;
  */
 
 
+import org.apache.lucene.index.IOContext;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util._TestUtil;
 
@@ -40,7 +41,7 @@ public class TestCopyBytes extends Lucen
       }
 
       // make random file
-      IndexOutput out = dir.createOutput("test");
+      IndexOutput out = dir.createOutput("test", IOContext.DEFAULT);
       byte[] bytes = new byte[_TestUtil.nextInt(random, 1, 77777)];
       final int size = _TestUtil.nextInt(random, 1, 1777777);
       int upto = 0;
@@ -60,9 +61,9 @@ public class TestCopyBytes extends Lucen
       assertEquals(size, dir.fileLength("test"));
 
       // copy from test -> test2
-      final IndexInput in = dir.openInput("test");
+      final IndexInput in = dir.openInput("test", IOContext.DEFAULT);
 
-      out = dir.createOutput("test2");
+      out = dir.createOutput("test2", IOContext.DEFAULT);
 
       upto = 0;
       while(upto < size) {
@@ -80,7 +81,7 @@ public class TestCopyBytes extends Lucen
       in.close();
 
       // verify
-      IndexInput in2 = dir.openInput("test2");
+      IndexInput in2 = dir.openInput("test2", IOContext.DEFAULT);
       upto = 0;
       while(upto < size) {
         if (random.nextBoolean()) {

Modified: lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/store/TestDirectory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/store/TestDirectory.java?rev=1137639&r1=1137638&r2=1137639&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/store/TestDirectory.java
(original)
+++ lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/store/TestDirectory.java
Mon Jun 20 14:28:24 2011
@@ -17,6 +17,7 @@ package org.apache.lucene.store;
  * limitations under the License.
  */
 
+import org.apache.lucene.index.IOContext;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util._TestUtil;
 
@@ -31,7 +32,7 @@ public class TestDirectory extends Lucen
     for (Directory dir : dirs) {
       dir.close();
       try {
-        dir.createOutput("test");
+        dir.createOutput("test", IOContext.DEFAULT);
         fail("did not hit expected exception");
       } catch (AlreadyClosedException ace) {
       }
@@ -56,7 +57,7 @@ public class TestDirectory extends Lucen
       dir.ensureOpen();
       String fname = "foo." + i;
       String lockname = "foo" + i + ".lck";
-      IndexOutput out = dir.createOutput(fname);
+      IndexOutput out = dir.createOutput(fname, IOContext.DEFAULT);
       out.writeByte((byte)i);
       out.close();
 
@@ -70,7 +71,7 @@ public class TestDirectory extends Lucen
         // closed and will cause a failure to delete the file.
         if (d2 instanceof MMapDirectory) continue;
         
-        IndexInput input = d2.openInput(fname);
+        IndexInput input = d2.openInput(fname, IOContext.DEFAULT);
         assertEquals((byte)i, input.readByte());
         input.close();
       }
@@ -141,7 +142,7 @@ public class TestDirectory extends Lucen
   private void checkDirectoryFilter(Directory dir) throws IOException {
     String name = "file";
     try {
-      dir.createOutput(name).close();
+      dir.createOutput(name, IOContext.DEFAULT).close();
       assertTrue(dir.fileExists(name));
       assertTrue(Arrays.asList(dir.listAll()).contains(name));
     } finally {
@@ -156,7 +157,7 @@ public class TestDirectory extends Lucen
       path.mkdirs();
       new File(path, "subdir").mkdirs();
       Directory fsDir = new SimpleFSDirectory(path, null);
-      assertEquals(0, new RAMDirectory(fsDir).listAll().length);
+      assertEquals(0, new RAMDirectory(fsDir, IOContext.DEFAULT).listAll().length);
     } finally {
       _TestUtil.rmDir(path);
     }
@@ -167,7 +168,7 @@ public class TestDirectory extends Lucen
     File path = _TestUtil.getTempDir("testnotdir");
     Directory fsDir = new SimpleFSDirectory(path, null);
     try {
-      IndexOutput out = fsDir.createOutput("afile");
+      IndexOutput out = fsDir.createOutput("afile", IOContext.DEFAULT);
       out.close();
       assertTrue(fsDir.fileExists("afile"));
       try {

Modified: lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/store/TestMultiMMap.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/store/TestMultiMMap.java?rev=1137639&r1=1137638&r2=1137639&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/store/TestMultiMMap.java
(original)
+++ lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/store/TestMultiMMap.java
Mon Jun 20 14:28:24 2011
@@ -23,6 +23,7 @@ import java.util.Random;
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
+import org.apache.lucene.index.IOContext;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.util.BytesRef;
@@ -51,9 +52,9 @@ public class TestMultiMMap extends Lucen
     for (int i = 0; i < 31; i++) {
       MMapDirectory mmapDir = new MMapDirectory(_TestUtil.getTempDir("testSeekZero"));
       mmapDir.setMaxChunkSize(1<<i);
-      IndexOutput io = mmapDir.createOutput("zeroBytes");
+      IndexOutput io = mmapDir.createOutput("zeroBytes", IOContext.DEFAULT);
       io.close();
-      IndexInput ii = mmapDir.openInput("zeroBytes");
+      IndexInput ii = mmapDir.openInput("zeroBytes", IOContext.DEFAULT);
       ii.seek(0L);
       ii.close();
       mmapDir.close();
@@ -64,12 +65,12 @@ public class TestMultiMMap extends Lucen
     for (int i = 0; i < 17; i++) {
       MMapDirectory mmapDir = new MMapDirectory(_TestUtil.getTempDir("testSeekEnd"));
       mmapDir.setMaxChunkSize(1<<i);
-      IndexOutput io = mmapDir.createOutput("bytes");
+      IndexOutput io = mmapDir.createOutput("bytes", IOContext.DEFAULT);
       byte bytes[] = new byte[1<<i];
       random.nextBytes(bytes);
       io.writeBytes(bytes, bytes.length);
       io.close();
-      IndexInput ii = mmapDir.openInput("bytes");
+      IndexInput ii = mmapDir.openInput("bytes", IOContext.DEFAULT);
       byte actual[] = new byte[1<<i];
       ii.readBytes(actual, 0, actual.length);
       assertEquals(new BytesRef(bytes), new BytesRef(actual));
@@ -83,12 +84,12 @@ public class TestMultiMMap extends Lucen
     for (int i = 0; i < 10; i++) {
       MMapDirectory mmapDir = new MMapDirectory(_TestUtil.getTempDir("testSeeking"));
       mmapDir.setMaxChunkSize(1<<i);
-      IndexOutput io = mmapDir.createOutput("bytes");
+      IndexOutput io = mmapDir.createOutput("bytes", IOContext.DEFAULT);
       byte bytes[] = new byte[1<<(i+1)]; // make sure we switch buffers
       random.nextBytes(bytes);
       io.writeBytes(bytes, bytes.length);
       io.close();
-      IndexInput ii = mmapDir.openInput("bytes");
+      IndexInput ii = mmapDir.openInput("bytes", IOContext.DEFAULT);
       byte actual[] = new byte[1<<(i+1)]; // first read all bytes
       ii.readBytes(actual, 0, actual.length);
       assertEquals(new BytesRef(bytes), new BytesRef(actual));

Modified: lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/store/TestRAMDirectory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/store/TestRAMDirectory.java?rev=1137639&r1=1137638&r2=1137639&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/store/TestRAMDirectory.java
(original)
+++ lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/store/TestRAMDirectory.java
Mon Jun 20 14:28:24 2011
@@ -28,6 +28,7 @@ import org.apache.lucene.util._TestUtil;
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
+import org.apache.lucene.index.IOContext;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.IndexWriterConfig;
@@ -70,7 +71,7 @@ public class TestRAMDirectory extends Lu
   public void testRAMDirectory () throws IOException {
     
     Directory dir = newFSDirectory(indexDir);
-    MockDirectoryWrapper ramDir = new MockDirectoryWrapper(random, new RAMDirectory(dir));
+    MockDirectoryWrapper ramDir = new MockDirectoryWrapper(random, new RAMDirectory(dir,
IOContext.DEFAULT));
     
     // close the underlaying directory
     dir.close();
@@ -102,7 +103,7 @@ public class TestRAMDirectory extends Lu
   public void testRAMDirectorySize() throws IOException, InterruptedException {
       
     Directory dir = newFSDirectory(indexDir);
-    final MockDirectoryWrapper ramDir = new MockDirectoryWrapper(random, new RAMDirectory(dir));
+    final MockDirectoryWrapper ramDir = new MockDirectoryWrapper(random, new RAMDirectory(dir,
IOContext.DEFAULT));
     dir.close();
     
     final IndexWriter writer = new IndexWriter(ramDir, new IndexWriterConfig(
@@ -152,11 +153,11 @@ public class TestRAMDirectory extends Lu
   // LUCENE-1196
   public void testIllegalEOF() throws Exception {
     RAMDirectory dir = new RAMDirectory();
-    IndexOutput o = dir.createOutput("out");
+    IndexOutput o = dir.createOutput("out", IOContext.DEFAULT);
     byte[] b = new byte[1024];
     o.writeBytes(b, 0, 1024);
     o.close();
-    IndexInput i = dir.openInput("out");
+    IndexInput i = dir.openInput("out", IOContext.DEFAULT);
     i.seek(1024);
     i.close();
     dir.close();
@@ -174,12 +175,12 @@ public class TestRAMDirectory extends Lu
   public void testSeekToEOFThenBack() throws Exception {
     RAMDirectory dir = new RAMDirectory();
 
-    IndexOutput o = dir.createOutput("out");
+    IndexOutput o = dir.createOutput("out", IOContext.DEFAULT);
     byte[] bytes = new byte[3*RAMInputStream.BUFFER_SIZE];
     o.writeBytes(bytes, 0, bytes.length);
     o.close();
 
-    IndexInput i = dir.openInput("out");
+    IndexInput i = dir.openInput("out", IOContext.DEFAULT);
     i.seek(2*RAMInputStream.BUFFER_SIZE-1);
     i.seek(3*RAMInputStream.BUFFER_SIZE);
     i.seek(RAMInputStream.BUFFER_SIZE);

Modified: lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/util/TestBitVector.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/util/TestBitVector.java?rev=1137639&r1=1137638&r2=1137639&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/util/TestBitVector.java
(original)
+++ lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/util/TestBitVector.java
Mon Jun 20 14:28:24 2011
@@ -19,6 +19,7 @@ package org.apache.lucene.util;
 
 import java.io.IOException;
 
+import org.apache.lucene.index.IOContext;
 import org.apache.lucene.store.MockDirectoryWrapper;
 import org.apache.lucene.store.RAMDirectory;
 
@@ -146,8 +147,8 @@ public class TestBitVector extends Lucen
             bv.set(i);
             assertTrue(bv.get(i));
             assertEquals(i+1,bv.count());
-            bv.write(d, "TESTBV");
-            BitVector compare = new BitVector(d, "TESTBV");
+            bv.write(d, "TESTBV", IOContext.DEFAULT);
+            BitVector compare = new BitVector(d, "TESTBV", IOContext.DEFAULT);
             // compare bit vectors with bits set incrementally
             assertTrue(doCompare(bv,compare));
         }
@@ -174,24 +175,24 @@ public class TestBitVector extends Lucen
         bv.set(i);
         assertEquals(i+1,bv.count());
       }
-      bv.write(d, "TESTBV");
+      bv.write(d, "TESTBV", IOContext.DEFAULT);
       // gradually increase number of set bits
       for (int i=count1; i<count2; i++) {
-        BitVector bv2 = new BitVector(d, "TESTBV");
+        BitVector bv2 = new BitVector(d, "TESTBV", IOContext.DEFAULT);
         assertTrue(doCompare(bv,bv2));
         bv = bv2;
         bv.set(i);
         assertEquals(i+1,bv.count());
-        bv.write(d, "TESTBV");
+        bv.write(d, "TESTBV", IOContext.DEFAULT);
       }
       // now start decreasing number of set bits
       for (int i=count2-1; i>=count1; i--) {
-        BitVector bv2 = new BitVector(d, "TESTBV");
+        BitVector bv2 = new BitVector(d, "TESTBV", IOContext.DEFAULT);
         assertTrue(doCompare(bv,bv2));
         bv = bv2;
         bv.clear(i);
         assertEquals(i,bv.count());
-        bv.write(d, "TESTBV");
+        bv.write(d, "TESTBV", IOContext.DEFAULT);
       }
     }
     /**

Modified: lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/util/fst/TestFSTs.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/util/fst/TestFSTs.java?rev=1137639&r1=1137638&r2=1137639&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/util/fst/TestFSTs.java
(original)
+++ lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/util/fst/TestFSTs.java
Mon Jun 20 14:28:24 2011
@@ -29,6 +29,7 @@ import java.util.*;
 
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
+import org.apache.lucene.index.IOContext;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.IndexWriterConfig;
@@ -468,10 +469,10 @@ public class TestFSTs extends LuceneTest
       FST<T> fst = builder.finish();
 
       if (random.nextBoolean() && fst != null) {
-        IndexOutput out = dir.createOutput("fst.bin");
+        IndexOutput out = dir.createOutput("fst.bin", IOContext.DEFAULT);
         fst.save(out);
         out.close();
-        IndexInput in = dir.openInput("fst.bin");
+        IndexInput in = dir.openInput("fst.bin", IOContext.DEFAULT);
         try {
           fst = new FST<T>(in, outputs);
         } finally {
@@ -1181,7 +1182,7 @@ public class TestFSTs extends LuceneTest
         }
 
         Directory dir = FSDirectory.open(new File(dirOut));
-        IndexOutput out = dir.createOutput("fst.bin");
+        IndexOutput out = dir.createOutput("fst.bin", IOContext.DEFAULT);
         fst.save(out);
         out.close();
 
@@ -1510,11 +1511,11 @@ public class TestFSTs extends LuceneTest
 
     // Make sure it still works after save/load:
     Directory dir = newDirectory();
-    IndexOutput out = dir.createOutput("fst");
+    IndexOutput out = dir.createOutput("fst", IOContext.DEFAULT);
     fst.save(out);
     out.close();
 
-    IndexInput in = dir.openInput("fst");
+    IndexInput in = dir.openInput("fst", IOContext.DEFAULT);
     final FST<Long> fst2 = new FST<Long>(in, outputs);
     checkStopNodes(fst2, outputs);
     in.close();

Modified: lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/util/packed/TestPackedInts.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/util/packed/TestPackedInts.java?rev=1137639&r1=1137638&r2=1137639&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/util/packed/TestPackedInts.java
(original)
+++ lucene/dev/branches/LUCENE2793/lucene/src/test/org/apache/lucene/util/packed/TestPackedInts.java
Mon Jun 20 14:28:24 2011
@@ -17,6 +17,7 @@ package org.apache.lucene.util.packed;
  * limitations under the License.
  */
 
+import org.apache.lucene.index.IOContext;
 import org.apache.lucene.store.*;
 import org.apache.lucene.util.LuceneTestCase;
 
@@ -54,7 +55,7 @@ public class TestPackedInts extends Luce
         final int valueCount = 100+random.nextInt(500);
         final Directory d = newDirectory();
 
-        IndexOutput out = d.createOutput("out.bin");
+        IndexOutput out = d.createOutput("out.bin", IOContext.DEFAULT);
         PackedInts.Writer w = PackedInts.getWriter(
                 out, valueCount, nbits);
 
@@ -71,7 +72,7 @@ public class TestPackedInts extends Luce
         final long fp = out.getFilePointer();
         out.close();
         {// test reader
-          IndexInput in = d.openInput("out.bin");
+          IndexInput in = d.openInput("out.bin", IOContext.DEFAULT);
           PackedInts.Reader r = PackedInts.getReader(in);
           assertEquals(fp, in.getFilePointer());
           for(int i=0;i<valueCount;i++) {
@@ -82,7 +83,7 @@ public class TestPackedInts extends Luce
           in.close();
         }
         { // test reader iterator next
-          IndexInput in = d.openInput("out.bin");
+          IndexInput in = d.openInput("out.bin", IOContext.DEFAULT);
           PackedInts.ReaderIterator r = PackedInts.getReaderIterator(in);
           for(int i=0;i<valueCount;i++) {
             assertEquals("index=" + i + " ceil=" + ceil + " valueCount="
@@ -93,7 +94,7 @@ public class TestPackedInts extends Luce
           in.close();
         }
         { // test reader iterator next vs. advance
-          IndexInput in = d.openInput("out.bin");
+          IndexInput in = d.openInput("out.bin", IOContext.DEFAULT);
           PackedInts.ReaderIterator intsEnum = PackedInts.getReaderIterator(in);
           for (int i = 0; i < valueCount; i += 
             1 + ((valueCount - i) <= 20 ? random.nextInt(valueCount - i)
@@ -229,14 +230,14 @@ public class TestPackedInts extends Luce
 
   public void testSingleValue() throws Exception {
     Directory dir = newDirectory();
-    IndexOutput out = dir.createOutput("out");
+    IndexOutput out = dir.createOutput("out", IOContext.DEFAULT);
     PackedInts.Writer w = PackedInts.getWriter(out, 1, 8);
     w.add(17);
     w.finish();
     final long end = out.getFilePointer();
     out.close();
 
-    IndexInput in = dir.openInput("out");
+    IndexInput in = dir.openInput("out", IOContext.DEFAULT);
     PackedInts.getReader(in);
     assertEquals(end, in.getFilePointer());
     in.close();

Modified: lucene/dev/branches/LUCENE2793/solr/src/java/org/apache/solr/core/RefCntRamDirectory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE2793/solr/src/java/org/apache/solr/core/RefCntRamDirectory.java?rev=1137639&r1=1137638&r2=1137639&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE2793/solr/src/java/org/apache/solr/core/RefCntRamDirectory.java
(original)
+++ lucene/dev/branches/LUCENE2793/solr/src/java/org/apache/solr/core/RefCntRamDirectory.java
Mon Jun 20 14:28:24 2011
@@ -20,6 +20,7 @@ package org.apache.solr.core;
 import java.io.IOException;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import org.apache.lucene.index.IOContext;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.RAMDirectory;
 
@@ -35,7 +36,7 @@ public class RefCntRamDirectory extends 
   public RefCntRamDirectory(Directory dir) throws IOException {
     this();
     for (String file : dir.listAll()) {
-      dir.copy(this, file, file);
+      dir.copy(this, file, file, IOContext.DEFAULT);
     }
   }
 



Mime
View raw message