public class CompressingMetaIndex extends Object implements MetaIndex
MetaIndex
implementation that compresses contents.
Values have maximum lengths, but overall value blobs are
compressed using java.util.zip.Inflater.Modifier and Type | Class and Description |
---|---|
static class |
CompressingMetaIndex.CompressingMetaIndexInputFormat
A Hadoop input format for a compressing meta index (allows the reading of a meta index
as input to a MapReduce job.
|
static class |
CompressingMetaIndex.InputStream
An iterator for reading a MetaIndex as a stream
|
Modifier and Type | Field and Description |
---|---|
protected int |
compressionLevel |
protected org.terrier.structures.CompressingMetaIndex.ByteAccessor |
dataSource |
protected Map<org.apache.hadoop.io.Text,org.apache.hadoop.io.IntWritable>[] |
forwardMetaMaps |
protected static ThreadLocal<Inflater> |
inflaterCache
thread-local cache of Inflaters to be re-used for decompression
|
protected gnu.trove.TObjectIntHashMap<String> |
key2bytelength |
protected gnu.trove.TObjectIntHashMap<String> |
key2byteoffset |
protected gnu.trove.TObjectIntHashMap<String> |
key2forwardOffset |
protected int |
keyCount |
protected FixedSizeWriteableFactory<org.apache.hadoop.io.Text>[] |
keyFactories |
protected String[] |
keyNames |
protected org.terrier.structures.CompressingMetaIndex.Docid2OffsetLookup |
offsetLookup |
protected String |
path |
protected String |
prefix |
protected int |
recordLength |
protected int[] |
valueByteLengths |
protected int[] |
valueByteOffsets |
Constructor and Description |
---|
CompressingMetaIndex(IndexOnDisk index,
String structureName)
Construct an instance of the class with
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the underlying structures.
|
String[] |
getAllItems(int docid)
Obtain all metadata for specified document.
|
int |
getDocument(String key,
String value)
Obtain docid where document has specified metadata value in the specified type.
|
String |
getItem(String Key,
int docid)
Obtain metadata of specified type for specified document.
|
String[] |
getItems(String[] Keys,
int docid)
Obtain metadata of specified types for specified document.
|
String[][] |
getItems(String[] Keys,
int[] _docids)
Obtain metadata of specified types for specified documents.
|
String[] |
getItems(String Key,
int[] _docids)
Obtain metadata of specified type for specified documents.
|
String[] |
getKeys()
Returns the keys of this meta index
|
protected void |
loadIndex(IndexOnDisk index,
String structureName) |
static void |
main(String[] args)
main
|
protected static final ThreadLocal<Inflater> inflaterCache
protected org.terrier.structures.CompressingMetaIndex.Docid2OffsetLookup offsetLookup
protected int compressionLevel
protected int recordLength
protected String[] keyNames
protected gnu.trove.TObjectIntHashMap<String> key2byteoffset
protected gnu.trove.TObjectIntHashMap<String> key2bytelength
protected gnu.trove.TObjectIntHashMap<String> key2forwardOffset
protected int keyCount
protected int[] valueByteOffsets
protected int[] valueByteLengths
protected final String path
protected final String prefix
protected final org.terrier.structures.CompressingMetaIndex.ByteAccessor dataSource
protected Map<org.apache.hadoop.io.Text,org.apache.hadoop.io.IntWritable>[] forwardMetaMaps
protected FixedSizeWriteableFactory<org.apache.hadoop.io.Text>[] keyFactories
public CompressingMetaIndex(IndexOnDisk index, String structureName) throws IOException
index
- structureName
- IOException
public String[] getKeys()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public int getDocument(String key, String value) throws IOException
getDocument
in interface MetaIndex
IOException
public String[] getItems(String Key, int[] _docids) throws IOException
getItems
in interface MetaIndex
IOException
public String[][] getItems(String[] Keys, int[] _docids) throws IOException
getItems
in interface MetaIndex
IOException
public String getItem(String Key, int docid) throws IOException
getItem
in interface MetaIndex
IOException
public String[] getItems(String[] Keys, int docid) throws IOException
getItems
in interface MetaIndex
IOException
public String[] getAllItems(int docid) throws IOException
getAllItems
in interface MetaIndex
IOException
protected void loadIndex(IndexOnDisk index, String structureName) throws IOException
IOException
Terrier Information Retrieval Platform4.1. Copyright © 2004-2015, University of Glasgow