public abstract class BlockIndexOutput extends Object implements Closeable
This class is not thread-safe and not safe for concurrent file access. It must not be used to encode multiple blocks concurrently. In the current implementation of Lucene, terms are processed sequentially during the creation of a new index segment. It is ensured that (1) one instance of this class is always used by one single thread, and (2) one instance of this class is always encoding postings one term at a time.
Modifier and Type | Class and Description |
---|---|
protected class |
BlockIndexOutput.BlockWriter
Abstraction over the writer of the blocks of the postings file.
|
class |
BlockIndexOutput.Index
This class stores the file pointer of an
IndexOutput . |
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
logger |
protected org.apache.lucene.store.IndexOutput |
out |
Constructor and Description |
---|
BlockIndexOutput(org.apache.lucene.store.IndexOutput out) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
abstract BlockIndexOutput.BlockWriter |
getBlockWriter()
Create a new
BlockIndexOutput.BlockWriter associated to this
BlockIndexOutput . |
BlockIndexOutput.Index |
index()
Instantiates a new block index.
|
protected final org.apache.lucene.store.IndexOutput out
protected static final org.slf4j.Logger logger
public BlockIndexOutput(org.apache.lucene.store.IndexOutput out)
public BlockIndexOutput.Index index() throws IOException
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public abstract BlockIndexOutput.BlockWriter getBlockWriter()
BlockIndexOutput.BlockWriter
associated to this
BlockIndexOutput
.
You should ensure to flush all BlockIndexOutput.BlockWriter
before closing the
BlockIndexOutput
.
More than one BlockIndexOutput.BlockWriter
can be instantiated by a
BlockIndexOutput
. Usually one writer is instantiated for each term.
Copyright © 2014. All rights reserved.