Example usage for org.apache.lucene.store FlushInfo FlushInfo

List of usage examples for org.apache.lucene.store FlushInfo FlushInfo

Introduction

In this page you can find the example usage for org.apache.lucene.store FlushInfo FlushInfo.

Prototype


public FlushInfo(int numDocs, long estimatedSegmentSize) 

Source Link

Document

Creates a new FlushInfo instance from the values required for a FLUSH IOContext context.

Usage

From source file:com.github.lucene.store.database.DatabaseDirectoryITest.java

License:Apache License

private void addContentIndexOutput(final Directory directory, final String fileName, final String content,
        final Context context) throws IOException {
    IOContext ioContext = null;/*from  ww w.ja  v  a2 s  . co m*/
    switch (context) {
    case FLUSH:
        ioContext = new IOContext(new FlushInfo(1, 1));
        break;
    case MERGE:
        ioContext = new IOContext(new MergeInfo(1, 1, false, 1));
        break;
    default:
        ioContext = new IOContext(context);
        break;
    }
    final IndexOutput indexOutput = directory.createOutput(fileName, ioContext);
    indexOutput.writeString(content);
    indexOutput.close();
}