Search in sources :

Example 86 with IndexOutput

use of org.apache.lucene.store.IndexOutput in project jackrabbit-oak by apache.

the class BufferedOakDirectoryTest method writeFile.

private byte[] writeFile(Directory dir, String name) throws IOException {
    byte[] data = randomBytes(rnd.nextInt((int) (16 * FileUtils.ONE_KB)));
    IndexOutput out = dir.createOutput(name, IOContext.DEFAULT);
    out.writeBytes(data, data.length);
    out.close();
    return data;
}
Also used : IndexOutput(org.apache.lucene.store.IndexOutput)

Example 87 with IndexOutput

use of org.apache.lucene.store.IndexOutput in project jackrabbit-oak by apache.

the class OakDirectoryTest method createFile.

private int createFile(Directory dir, String fileName) throws IOException {
    int size = rnd.nextInt(1000) + 1;
    byte[] data = randomBytes(size);
    IndexOutput o = dir.createOutput(fileName, IOContext.DEFAULT);
    o.writeBytes(data, data.length);
    o.close();
    return size;
}
Also used : IndexOutput(org.apache.lucene.store.IndexOutput)

Example 88 with IndexOutput

use of org.apache.lucene.store.IndexOutput in project jackrabbit-oak by apache.

the class IndexCopierTest method writeFile.

private byte[] writeFile(Directory dir, String name) throws IOException {
    byte[] data = randomBytes(rnd.nextInt(maxFileSize) + 1);
    IndexOutput o = dir.createOutput(name, IOContext.DEFAULT);
    o.writeBytes(data, data.length);
    o.close();
    return data;
}
Also used : IndexOutput(org.apache.lucene.store.IndexOutput)

Example 89 with IndexOutput

use of org.apache.lucene.store.IndexOutput in project jackrabbit-oak by apache.

the class LuceneIndexDumperTest method createFile.

private int createFile(Directory dir, String fileName, String content) throws IOException {
    byte[] data = content.getBytes();
    IndexOutput o = dir.createOutput(fileName, IOContext.DEFAULT);
    o.writeBytes(data, data.length);
    o.close();
    return data.length;
}
Also used : IndexOutput(org.apache.lucene.store.IndexOutput)

Example 90 with IndexOutput

use of org.apache.lucene.store.IndexOutput in project jackrabbit-oak by apache.

the class IndexSanityCheckerTest method writeFile.

private void writeFile(Directory dir, String name, byte[] data) throws IOException {
    IndexOutput o = dir.createOutput(name, IOContext.DEFAULT);
    o.writeBytes(data, data.length);
    o.close();
}
Also used : IndexOutput(org.apache.lucene.store.IndexOutput)

Aggregations

IndexOutput (org.apache.lucene.store.IndexOutput)157 IndexInput (org.apache.lucene.store.IndexInput)69 Directory (org.apache.lucene.store.Directory)66 RAMDirectory (org.apache.lucene.store.RAMDirectory)28 FilterDirectory (org.apache.lucene.store.FilterDirectory)26 ChecksumIndexInput (org.apache.lucene.store.ChecksumIndexInput)22 CorruptIndexException (org.apache.lucene.index.CorruptIndexException)19 CorruptingIndexOutput (org.apache.lucene.store.CorruptingIndexOutput)18 BytesRef (org.apache.lucene.util.BytesRef)18 RAMFile (org.apache.lucene.store.RAMFile)16 RAMOutputStream (org.apache.lucene.store.RAMOutputStream)16 IOException (java.io.IOException)14 IOContext (org.apache.lucene.store.IOContext)12 BufferedChecksumIndexInput (org.apache.lucene.store.BufferedChecksumIndexInput)11 RAMInputStream (org.apache.lucene.store.RAMInputStream)11 NRTCachingDirectory (org.apache.lucene.store.NRTCachingDirectory)10 ArrayList (java.util.ArrayList)9 IntersectVisitor (org.apache.lucene.index.PointValues.IntersectVisitor)9 Relation (org.apache.lucene.index.PointValues.Relation)9 HashMap (java.util.HashMap)8