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, writeLong
protected 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()
ValuesWriter
getBufferedSize
in class ValuesWriter
public long getAllocatedSize()
getAllocatedSize
in class ValuesWriter
public BytesInput getBytes()
getBytes
in class ValuesWriter
public Encoding getEncoding()
ValuesWriter
getEncoding
in class ValuesWriter
public void reset()
ValuesWriter
reset
in class ValuesWriter
public void resetDictionary()
ValuesWriter
resetDictionary
in class ValuesWriter
protected abstract void clearDictionaryContent()
protected abstract int getDictionarySize()
public String memUsageString(String prefix)
memUsageString
in class ValuesWriter
Copyright © 2015. All rights reserved.