public abstract class DictionaryValuesWriter extends ValuesWriter
| Modifier and Type | Class and Description |
|---|---|
static class |
DictionaryValuesWriter.PlainBinaryDictionaryValuesWriter |
static class |
DictionaryValuesWriter.PlainDoubleDictionaryValuesWriter |
static class |
DictionaryValuesWriter.PlainFixedLenArrayDictionaryValuesWriter |
static class |
DictionaryValuesWriter.PlainFloatDictionaryValuesWriter |
static class |
DictionaryValuesWriter.PlainIntegerDictionaryValuesWriter |
static class |
DictionaryValuesWriter.PlainLongDictionaryValuesWriter |
| Modifier and Type | Field and Description |
|---|---|
protected int |
dictionaryByteSize |
protected boolean |
dictionaryTooBig |
protected IntList |
encodedValues |
protected boolean |
firstPage
indicates if this is the first page being processed
|
protected int |
lastUsedDictionaryByteSize |
protected int |
lastUsedDictionarySize |
protected int |
maxDictionaryByteSize |
protected ValuesWriter |
plainValuesWriter |
protected long |
rawDataByteSize |
| Modifier | Constructor and Description |
|---|---|
protected |
DictionaryValuesWriter(int maxDictionaryByteSize,
int initialSize) |
protected |
DictionaryValuesWriter(int maxDictionaryByteSize,
int initialSize,
int fixedLength)
Construct a DictionaryValuesWriter for fixed-length byte array values.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkAndFallbackIfNeeded()
check the size constraints of the dictionary and fail over to plain values encoding if threshold reached
|
protected abstract void |
clearDictionaryContent()
clear/free the underlying dictionary content
|
protected abstract void |
fallBackDictionaryEncodedData() |
long |
getAllocatedSize() |
long |
getBufferedSize()
used to decide if we want to work to the next page
|
BytesInput |
getBytes() |
protected abstract int |
getDictionarySize() |
Encoding |
getEncoding()
called after getBytes() and before reset()
|
String |
memUsageString(String prefix) |
void |
reset()
called after getBytes() to reset the current buffer and start writing the next page
|
void |
resetDictionary()
reset the dictionary when a new block starts
|
createDictionaryPage, writeBoolean, writeByte, writeBytes, writeDouble, writeFloat, writeInteger, writeLongprotected final int maxDictionaryByteSize
protected final ValuesWriter plainValuesWriter
protected boolean dictionaryTooBig
protected int dictionaryByteSize
protected int lastUsedDictionaryByteSize
protected int lastUsedDictionarySize
protected IntList encodedValues
protected long rawDataByteSize
protected boolean firstPage
protected DictionaryValuesWriter(int maxDictionaryByteSize,
int initialSize)
maxDictionaryByteSize - initialSize - protected DictionaryValuesWriter(int maxDictionaryByteSize,
int initialSize,
int fixedLength)
maxDictionaryByteSize - initialSize - fixedLength - Fixed length for byte arraysprotected void checkAndFallbackIfNeeded()
protected abstract void fallBackDictionaryEncodedData()
public long getBufferedSize()
ValuesWritergetBufferedSize in class ValuesWriterpublic long getAllocatedSize()
getAllocatedSize in class ValuesWriterpublic BytesInput getBytes()
getBytes in class ValuesWriterpublic Encoding getEncoding()
ValuesWritergetEncoding in class ValuesWriterpublic void reset()
ValuesWriterreset in class ValuesWriterpublic void resetDictionary()
ValuesWriterresetDictionary in class ValuesWriterprotected abstract void clearDictionaryContent()
protected abstract int getDictionarySize()
public String memUsageString(String prefix)
memUsageString in class ValuesWriterCopyright © 2014. All Rights Reserved.