public abstract class DictionaryValuesWriter extends ValuesWriter implements RequiresFallback
| 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 Encoding |
encodingForDictionaryPage |
protected int |
lastUsedDictionaryByteSize |
protected int |
lastUsedDictionarySize |
protected int |
maxDictionaryByteSize |
| Modifier | Constructor and Description |
|---|---|
protected |
DictionaryValuesWriter(int maxDictionaryByteSize,
Encoding encodingForDataPage,
Encoding encodingForDictionaryPage) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
clearDictionaryContent()
clear/free the underlying dictionary content
|
protected DictionaryPage |
dictPage(ValuesWriter dictionaryEncoder) |
void |
fallBackAllValuesTo(ValuesWriter writer)
When falling back to a different encoding we must re-encode all the values seen so far
|
protected abstract void |
fallBackDictionaryEncodedData(ValuesWriter writer) |
long |
getAllocatedSize()
( >
#getBufferedMemorySize ) |
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()
|
boolean |
isCompressionSatisfying(long rawSize,
long encodedSize)
Before writing the first page we will verify if the encoding is worth it.
|
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
|
boolean |
shouldFallBack()
In the case of a dictionary based encoding we will fallback if the dictionary becomes too big
|
createDictionaryPage, writeBoolean, writeByte, writeBytes, writeDouble, writeFloat, writeInteger, writeLongprotected final Encoding encodingForDictionaryPage
protected final int maxDictionaryByteSize
protected boolean dictionaryTooBig
protected int dictionaryByteSize
protected int lastUsedDictionaryByteSize
protected int lastUsedDictionarySize
protected IntList encodedValues
protected DictionaryPage dictPage(ValuesWriter dictionaryEncoder)
public boolean shouldFallBack()
RequiresFallbackshouldFallBack in interface RequiresFallbackpublic boolean isCompressionSatisfying(long rawSize,
long encodedSize)
RequiresFallbackisCompressionSatisfying in interface RequiresFallbackrawSize - the size if encoded with plainencodedSize - the size as encoded by the current encodingpublic void fallBackAllValuesTo(ValuesWriter writer)
RequiresFallbackfallBackAllValuesTo in interface RequiresFallbackwriter - the new encoder to write the current values toprotected abstract void fallBackDictionaryEncodedData(ValuesWriter writer)
public long getBufferedSize()
ValuesWritergetBufferedSize in class ValuesWriterpublic long getAllocatedSize()
ValuesWriter#getBufferedMemorySize )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 © 2015 The Apache Software Foundation. All rights reserved.