public class IntegerCodingPostingOutputStream extends AbstractPostingOutputStream
Modifier and Type | Field and Description |
---|---|
protected int[] |
bfs |
protected int[] |
blocks |
protected IntegerCodec |
blocksCodec |
protected int |
chunkSize
Number of posting in a chunk
|
protected int[][] |
fields |
protected IntegerCodec |
fieldsCodec |
protected int |
fieldsCount |
protected int |
hasBlocks |
protected int[] |
ids |
protected IntegerCodec |
idsCodec |
protected static org.slf4j.Logger |
logger
The logger used
|
protected int |
maxBlocks |
protected ByteOut |
output |
protected int[] |
tfs |
protected IntegerCodec |
tfsCodec |
Constructor and Description |
---|
IntegerCodingPostingOutputStream(ByteOut output,
int chunkSize,
int fieldsCount,
int hasBlocks,
int maxBlocks,
IntegerCodec idsCodec,
IntegerCodec tfsCodec,
IntegerCodec fieldsCodec,
IntegerCodec blocksCodec) |
IntegerCodingPostingOutputStream(String filename,
int chunkSize,
int fieldsCount,
int hasBlocks,
int maxBlocks,
IntegerCodec idsCodec,
IntegerCodec tfsCodec,
IntegerCodec fieldsCodec,
IntegerCodec blocksCodec) |
Modifier and Type | Method and Description |
---|---|
void |
close()
close this object.
|
BitFilePosition |
getOffset()
What is current offset?
|
Class<? extends IterablePosting> |
getPostingIteratorClass()
Returns the IterablePosting class to use for reading structure written by
this class
|
protected void |
init(int fieldsCount,
int hasBlocks,
int maxBlocks,
int chunkSize,
IntegerCodec idsCodec,
IntegerCodec tfsCodec,
IntegerCodec fieldsCodec,
IntegerCodec blocksCodec) |
protected void |
write(int i,
int cnt)
compress and write down the current chunk of postings
|
BitIndexPointer |
writePostings(int[][] postings,
int startOffset,
int Length,
int firstId) |
BitIndexPointer |
writePostings(IterablePosting postings)
Write out the specified postings.
|
BitIndexPointer |
writePostings(IterablePosting postings,
int previousId) |
BitIndexPointer |
writePostings(Iterator<Posting> iterator) |
BitIndexPointer |
writePostings(Iterator<Posting> iterator,
int previousId) |
protected static final org.slf4j.Logger logger
protected ByteOut output
protected int chunkSize
protected int fieldsCount
protected int hasBlocks
protected int maxBlocks
protected int[] ids
protected int[] tfs
protected int[][] fields
protected int[] bfs
protected int[] blocks
protected IntegerCodec idsCodec
protected IntegerCodec tfsCodec
protected IntegerCodec fieldsCodec
protected IntegerCodec blocksCodec
public IntegerCodingPostingOutputStream(String filename, int chunkSize, int fieldsCount, int hasBlocks, int maxBlocks, IntegerCodec idsCodec, IntegerCodec tfsCodec, IntegerCodec fieldsCodec, IntegerCodec blocksCodec) throws IOException
filename
- the file where to writechunkSize
- the chunk size (in term of number of posting)fieldsCount
- the number of fields, if any. 0 otherwisehasBlocks
- 0:no blocks, 1:positions, 2:blocks of any size!=1maxBlocks
- 0:no limit, >0 limited.idsCodec
- the IntegerCodec to use to compress idstfsCodec
- the IntegerCodec to use to compress tfsfieldsCodec
- the IntegerCodec to use to compress fields (null if there are no fields)blocksCodec
- the IntegerCodec to use to compress blocks (null if there are no blocks)IOException
public IntegerCodingPostingOutputStream(ByteOut output, int chunkSize, int fieldsCount, int hasBlocks, int maxBlocks, IntegerCodec idsCodec, IntegerCodec tfsCodec, IntegerCodec fieldsCodec, IntegerCodec blocksCodec) throws IOException
output
- the output channelchunkSize
- the chunk size (in term of number of posting)fieldsCount
- the number of fields, if any. 0 otherwisehasBlocks
- 0:no blocks, 1:positions, 2:blocks of any size!=1maxBlocks
- 0:no limit, >0 limited.idsCodec
- the IntegerCodec to use to compress idstfsCodec
- the IntegerCodec to use to compress tfsfieldsCodec
- the IntegerCodec to use to compress fields (null if there are no fields)blocksCodec
- the IntegerCodec to use to compress blocks (null if there are no blocks)IOException
protected void init(int fieldsCount, int hasBlocks, int maxBlocks, int chunkSize, IntegerCodec idsCodec, IntegerCodec tfsCodec, IntegerCodec fieldsCodec, IntegerCodec blocksCodec)
public Class<? extends IterablePosting> getPostingIteratorClass()
getPostingIteratorClass
in class AbstractPostingOutputStream
public BitIndexPointer writePostings(IterablePosting postings) throws IOException
writePostings
in class AbstractPostingOutputStream
postings
- IterablePosting postings accessed through an IterablePosting
objectIOException
protected void write(int i, int cnt) throws IOException
i
- number of postingscnt
- number of blocksIOException
public void close()
close
in class AbstractPostingOutputStream
public BitFilePosition getOffset()
getOffset
in class AbstractPostingOutputStream
public BitIndexPointer writePostings(int[][] postings, int startOffset, int Length, int firstId) throws IOException
writePostings
in class AbstractPostingOutputStream
IOException
public BitIndexPointer writePostings(IterablePosting postings, int previousId) throws IOException
writePostings
in class AbstractPostingOutputStream
IOException
public BitIndexPointer writePostings(Iterator<Posting> iterator, int previousId) throws IOException
writePostings
in class AbstractPostingOutputStream
IOException
public BitIndexPointer writePostings(Iterator<Posting> iterator) throws IOException
writePostings
in class AbstractPostingOutputStream
IOException
Terrier Information Retrieval Platform4.1. Copyright © 2004-2015, University of Glasgow