Package com.illumon.iris.db.v2.sources
Class EmptyToNullStringRegionedColumnSource<STRING_LIKE_TYPE extends CharSequence>
java.lang.Object
com.illumon.iris.db.v2.sources.AbstractColumnSource<STRING_LIKE_TYPE>
com.illumon.iris.db.v2.sources.EmptyToNullStringRegionedColumnSource<STRING_LIKE_TYPE>
- All Implemented Interfaces:
ChunkSource<Attributes.Values>
,ChunkSource.WithPrev<Attributes.Values>
,DefaultChunkSource<Attributes.Values>
,DefaultChunkSource.WithPrev<Attributes.Values>
,FillContextMaker
,GetContextMaker
,ColumnSource<STRING_LIKE_TYPE>
,ColumnSourceGetDefaults.ForObject<STRING_LIKE_TYPE>
,ElementSource<STRING_LIKE_TYPE>
,MutableColumnSource<STRING_LIKE_TYPE>
,MutableColumnSourceGetDefaults.ForObject<STRING_LIKE_TYPE>
,Releasable
,TupleExporter<STRING_LIKE_TYPE>
,TupleSource<STRING_LIKE_TYPE>
,Serializable
public class EmptyToNullStringRegionedColumnSource<STRING_LIKE_TYPE extends CharSequence> extends AbstractColumnSource<STRING_LIKE_TYPE> implements MutableColumnSourceGetDefaults.ForObject<STRING_LIKE_TYPE>
Regioned ColumnSource that replaces empty CharSequences with null.
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class com.illumon.iris.db.v2.sources.AbstractColumnSource
AbstractColumnSource.DefaultedImmutable<DATA_TYPE>, AbstractColumnSource.DefaultedMutable<DATA_TYPE>, AbstractColumnSource.IsSerializable
Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource
ChunkSource.FillContext, ChunkSource.GetContext, ChunkSource.WithPrev<ATTR extends Attributes.Any>
Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource
DefaultChunkSource.SupportsContiguousGet<ATTR extends Attributes.Any>, DefaultChunkSource.WithPrev<ATTR extends Attributes.Any>
-
Field Summary
Fields inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource
DEFAULT_FILL_INSTANCE, ZERO_LENGTH_CHUNK_SOURCE_ARRAY
Fields inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource.WithPrev
ZERO_LENGTH_CHUNK_SOURCE_WITH_PREV_ARRAY
Fields inherited from interface com.illumon.iris.db.v2.sources.ColumnSource
ZERO_LENGTH_COLUMN_SOURCE_ARRAY
-
Constructor Summary
Constructors Constructor Description EmptyToNullStringRegionedColumnSource(ColumnSource<STRING_LIKE_TYPE> innerSource, Runnable callback)
Wrap inner source with a column source that replaces empty values with null. -
Method Summary
Modifier and Type Method Description STRING_LIKE_TYPE
get(long index)
Get the value from the source.GroupingBuilder
getGroupingBuilder()
Get aGroupingBuilder
to construct grouping tables for this column.STRING_LIKE_TYPE
getPrev(long index)
Get the previous value at the index.boolean
isImmutable()
Determine if this column source is immutable, meaning that the values at a given index key never change.void
releaseCachedResources()
Release any resources held for caching purposes.static <STRING_LIKE_TYPE extends CharSequence>
STRING_LIKE_TYPEreplaceEmptyWithNull(boolean isCompressed, STRING_LIKE_TYPE inputValue)
Methods inherited from class com.illumon.iris.db.v2.sources.AbstractColumnSource
allowsReinterpret, defaultFillChunk, doReinterpret, fillChunk, fillPrevChunk, getComponentType, getGroupingProvider, getNativeType, getType, hasGrouping, isSerializable, match, reinterpret, setGroupingProvider
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource
fillChunk, getChunkType
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource.WithPrev
fillPrevChunk
Methods inherited from interface com.illumon.iris.db.v2.sources.ColumnSource
allowsReinterpret, cast, createPreviousTuple, createTuple, createTupleFromValues, exportElement, exportElement, exportToExternalKey, getColumnSources, getComponentType, getGroupingProvider, getNativeType, getPrevSource, getType, hasGrouping, match, reinterpret, setGroupingProvider, startTrackingPrevValues
Methods inherited from interface com.illumon.iris.db.v2.sources.ColumnSourceGetDefaults.ForObject
getBoolean, getByte, getChar, getDouble, getFloat, getInt, getLong, getShort
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource
getChunk, getChunk, getChunkByFilling, makeFillContext, makeGetContext
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource.WithPrev
getPrevChunk, getPrevChunk, getPrevChunkByFilling
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.FillContextMaker
makeFillContext
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.GetContextMaker
makeGetContext
Methods inherited from interface com.illumon.iris.db.v2.sources.MutableColumnSourceGetDefaults.ForObject
getPrevBoolean, getPrevByte, getPrevChar, getPrevDouble, getPrevFloat, getPrevInt, getPrevLong, getPrevShort
Methods inherited from interface com.illumon.iris.db.v2.tuples.TupleExporter
exportElementReinterpreted
Methods inherited from interface com.illumon.iris.db.v2.tuples.TupleSource
createTupleFromReinterpretedValues
-
Constructor Details
-
EmptyToNullStringRegionedColumnSource
public EmptyToNullStringRegionedColumnSource(@NotNull ColumnSource<STRING_LIKE_TYPE> innerSource, @Nullable Runnable callback)Wrap inner source with a column source that replaces empty values with null. Callback will be invoked on the first occasion for remapping (modulo race conditions which may permit it to be invoked more than once).- Parameters:
innerSource
- The inner sourcecallback
- The callback
-
-
Method Details
-
get
Description copied from interface:ElementSource
Get the value from the source. This may return boxed values for basic types.- Specified by:
get
in interfaceElementSource<STRING_LIKE_TYPE extends CharSequence>
- Parameters:
index
- the location in index space to get the value from.- Returns:
- the value at the index, potentially null.
-
getPrev
Description copied from interface:ElementSource
Get the previous value at the index. Previous values are used during anLTM
update
cycle to process changes in data. Duringnormal
operation previous values will be identical tocurrent
values.- Specified by:
getPrev
in interfaceElementSource<STRING_LIKE_TYPE extends CharSequence>
- Parameters:
index
- the location in index space to get the value from.- Returns:
- the previous value at the index, or null.
-
isImmutable
public boolean isImmutable()Description copied from interface:ColumnSource
Determine if this column source is immutable, meaning that the values at a given index key never change.- Specified by:
isImmutable
in interfaceColumnSource<STRING_LIKE_TYPE extends CharSequence>
- Specified by:
isImmutable
in interfaceMutableColumnSource<STRING_LIKE_TYPE extends CharSequence>
- Returns:
- true if the values at a given index of the column source never change, false otherwise
-
releaseCachedResources
public void releaseCachedResources()Description copied from interface:ColumnSource
Release any resources held for caching purposes. Implementations need not guarantee that concurrent accesses are correct, as the purpose of this method is to ensure cleanup for column sources that will no longer be used.- Specified by:
releaseCachedResources
in interfaceColumnSource<STRING_LIKE_TYPE extends CharSequence>
- Specified by:
releaseCachedResources
in interfaceReleasable
-
replaceEmptyWithNull
public static <STRING_LIKE_TYPE extends CharSequence> STRING_LIKE_TYPE replaceEmptyWithNull(boolean isCompressed, STRING_LIKE_TYPE inputValue) -
getGroupingBuilder
Description copied from interface:ColumnSource
Get aGroupingBuilder
to construct grouping tables for this column. UseColumnSource.hasGrouping()
to determine if this column has a grouping.- Specified by:
getGroupingBuilder
in interfaceColumnSource<STRING_LIKE_TYPE extends CharSequence>
- Overrides:
getGroupingBuilder
in classAbstractColumnSource<STRING_LIKE_TYPE extends CharSequence>
- Returns:
- a
GroupingBuilder
if this column supports grouping.
-