|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.terrier.structures.indexing.MetaIndexBuilder org.terrier.structures.indexing.CompressingMetaIndexBuilder
public class CompressingMetaIndexBuilder
Creates a metaindex structure that compresses all values using Deflator.
Nested Class Summary | |
---|---|
static class |
CompressingMetaIndexBuilder.KeyedPartitioner
class KeyedPartitioner |
Field Summary | |
---|---|
protected java.io.ByteArrayOutputStream |
baos
|
protected byte[] |
compressedBuffer
|
protected long |
currentIndexOffset
|
protected long |
currentOffset
|
protected java.io.DataOutputStream |
dataOutput
|
protected static int |
DOCS_PER_CHECK
|
protected int |
entryCount
|
protected int |
entryLengthBytes
|
protected java.lang.String[] |
forwardKeyNames
|
protected int[] |
forwardKeys
|
protected boolean[] |
forwardKeyValuesSorted
|
protected FSOrderedMapFile.MapFileWriter[] |
forwardWriters
|
protected Index |
index
|
protected java.io.DataOutputStream |
indexOutput
|
protected gnu.trove.TObjectIntHashMap<java.lang.String> |
key2Index
|
protected int |
keyCount
|
protected FixedSizeWriteableFactory<org.apache.hadoop.io.Text>[] |
keyFactories
|
protected java.lang.String[] |
keyNames
|
protected java.lang.String[] |
lastValues
|
protected static org.apache.log4j.Logger |
logger
|
protected static int |
MAX_INDEX_MB_IN_MEM_RETRIEVAL
|
protected static int |
MAX_MB_IN_MEM_RETRIEVAL
|
protected MemoryChecker |
memCheck
|
protected static int |
REVERSE_KEY_LOOKUP_WRITING_BUFFER_SIZE
|
protected byte[] |
spaces
|
protected java.lang.String |
structureName
|
protected int[] |
valueLensBytes
|
protected int[] |
valueLensChars
|
protected java.util.zip.Deflater |
zip
|
protected static int |
ZIP_COMPRESSION_LEVEL
|
Constructor Summary | |
---|---|
CompressingMetaIndexBuilder(Index _index,
java.lang.String[] _keyNames,
int[] _valueLens,
java.lang.String[] _forwardKeys)
constructor |
|
CompressingMetaIndexBuilder(Index _index,
java.lang.String _structureName,
java.lang.String[] _keyNames,
int[] _valueLens,
java.lang.String[] _forwardKeys)
constructor |
Method Summary | |
---|---|
void |
close()
|
void |
flush()
|
static void |
reverseAsMapReduceJob(Index index,
java.lang.String structureName,
java.lang.String[] keys)
reverseAsMapReduceJob |
static void |
reverseAsMapReduceJob(Index index,
java.lang.String structureName,
java.lang.String[] keys,
HadoopPlugin.JobFactory jf)
reverseAsMapReduceJob |
void |
writeDocumentEntry(java.util.Map<java.lang.String,java.lang.String> data)
Write out metadata for current document, extracted from specified map Typically, the MetaIndexBuilder will know which keys from data that it is interested in. |
void |
writeDocumentEntry(java.lang.String[] data)
Write out metadata for current document. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.log4j.Logger logger
protected static final int MAX_MB_IN_MEM_RETRIEVAL
protected static final int MAX_INDEX_MB_IN_MEM_RETRIEVAL
protected static final int REVERSE_KEY_LOOKUP_WRITING_BUFFER_SIZE
protected static final int DOCS_PER_CHECK
protected static final int ZIP_COMPRESSION_LEVEL
protected final gnu.trove.TObjectIntHashMap<java.lang.String> key2Index
protected java.io.DataOutputStream dataOutput
protected final java.lang.String[] keyNames
protected final int keyCount
protected java.util.zip.Deflater zip
protected java.io.ByteArrayOutputStream baos
protected java.io.DataOutputStream indexOutput
protected byte[] compressedBuffer
protected Index index
protected int[] valueLensChars
protected int[] valueLensBytes
protected byte[] spaces
protected int entryLengthBytes
protected long currentOffset
protected long currentIndexOffset
protected int entryCount
protected int[] forwardKeys
protected java.lang.String[] forwardKeyNames
protected FSOrderedMapFile.MapFileWriter[] forwardWriters
protected boolean[] forwardKeyValuesSorted
protected java.lang.String[] lastValues
protected MemoryChecker memCheck
protected FixedSizeWriteableFactory<org.apache.hadoop.io.Text>[] keyFactories
protected java.lang.String structureName
Constructor Detail |
---|
public CompressingMetaIndexBuilder(Index _index, java.lang.String[] _keyNames, int[] _valueLens, java.lang.String[] _forwardKeys)
_index
- _keyNames
- _valueLens
- _forwardKeys
- public CompressingMetaIndexBuilder(Index _index, java.lang.String _structureName, java.lang.String[] _keyNames, int[] _valueLens, java.lang.String[] _forwardKeys)
_index
- _structureName
- _keyNames
- _valueLens
- _forwardKeys
- Method Detail |
---|
public void writeDocumentEntry(java.util.Map<java.lang.String,java.lang.String> data) throws java.io.IOException
writeDocumentEntry
in class MetaIndexBuilder
java.io.IOException
public void writeDocumentEntry(java.lang.String[] data) throws java.io.IOException
writeDocumentEntry
in class MetaIndexBuilder
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
java.io.IOException
public static void reverseAsMapReduceJob(Index index, java.lang.String structureName, java.lang.String[] keys) throws java.lang.Exception
index
- structureName
- keys
-
java.lang.Exception
public static void reverseAsMapReduceJob(Index index, java.lang.String structureName, java.lang.String[] keys, HadoopPlugin.JobFactory jf) throws java.lang.Exception
index
- structureName
- keys
- jf
-
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |