Class LocalAppendableColumn<DATA_TYPE>
java.lang.Object
com.illumon.iris.db.tables.appendable.BaseAppendableColumn<DATA_TYPE>
com.illumon.iris.db.tables.appendable.local.LocalAppendableColumn<DATA_TYPE>
- All Implemented Interfaces:
AppendableColumn<DATA_TYPE>,TableTransactionProcessor
- Direct Known Subclasses:
LocalAppendableColumnImpl
public abstract class LocalAppendableColumn<DATA_TYPE>
extends BaseAppendableColumn<DATA_TYPE>
implements TableTransactionProcessor
AppendableColumn for output to a local column location.
Application threads must synchronize in order to ensure mutually-exclusive concurrent access for all operations
other than AppendableColumn.force() (which may proceed concurrently).
#release() or AppendableColumn.close() must only be called after all other operations besides AppendableColumn.force() are
completed, in any thread. The expectation is that after an error in writing applications will #release()
scarce resources, or after successful writing applications will AppendableColumn.close() the column.
Note that code assumes correct usage, and omits validation for alignment issues that would occur with incorrect usage.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.illumon.iris.db.tables.appendable.BaseAppendableColumn
name, typeFields inherited from interface com.illumon.iris.db.tables.appendable.AppendableColumn
DEFAULT_CHUNK_CAPACITY -
Constructor Summary
ConstructorsConstructorDescriptionLocalAppendableColumn(String name, Class<DATA_TYPE> type) Construct a LocalAppendableColumn. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddComputed(int count, LocalAppendableColumn.ValueSupplier<DATA_TYPE> valueSupplier) Add values computed on demand from a function over an int value index.voidaddEncoded(int count, IntFunction<ByteBuffer> valueSupplier) Add pre-encoded values computed on demand from a function over an int value index.final voidaddFromObjectChunk(ObjectChunk<DATA_TYPE, ? extends Attributes.Values> source) Add all values fromsourcein the range[0, source.size()).abstract voidWhen recreating our files, we need to make sure that they exist, but we do not need to actually force them to disk durably.abstract longGet the size (in bytes) of the underlying data file region for this column.Methods inherited from class com.illumon.iris.db.tables.appendable.BaseAppendableColumn
add, add, add, addBoolean, addBoolean, addBooleans, checkArrayAddBounds, encodeExternalizable, encodeSerializable, getAddHelper, getName, getTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.illumon.iris.db.tables.appendable.AppendableColumn
addByte, addByte, addBytes, addBytes, addChar, addChar, addChars, addDouble, addDouble, addDoubles, addFloat, addFloat, addFloats, addFromArray, addFromBooleanChunk, addFromBoxedValue, addFromBoxedValue, addFromByteChunk, addFromCharChunk, addFromChunk, addFromChunkSource, addFromChunkSource, addFromChunkSource, addFromColumnSource, addFromColumnSource, addFromColumnSource, addFromColumnSource, addFromDataColumn, addFromDoubleChunk, addFromFloatChunk, addFromIntChunk, addFromLongChunk, addFromShortChunk, addInt, addInt, addInts, addLong, addLong, addLongs, addShort, addShort, addShorts, close, forceMethods inherited from interface com.illumon.iris.db.tables.appendable.TableTransactionProcessor
abortTransaction, finishTransaction, inTransaction, startTransaction
-
Constructor Details
-
LocalAppendableColumn
Construct a LocalAppendableColumn.- Parameters:
name- The column nametype- The column data type
-
-
Method Details
-
getSizeInBytes
public abstract long getSizeInBytes()Get the size (in bytes) of the underlying data file region for this column.- Returns:
- The size (in bytes) of the underlying data file region
-
ensureFileExists
public abstract void ensureFileExists()When recreating our files, we need to make sure that they exist, but we do not need to actually force them to disk durably. -
addComputed
public void addComputed(int count, @NotNull LocalAppendableColumn.ValueSupplier<DATA_TYPE> valueSupplier) throws IOException Add values computed on demand from a function over an int value index. Note that this is generally sub-optimal for columns of primitive types.- Parameters:
count- The number of values to addvalueSupplier- The value supplier, over domain[0, length)- Throws:
IOException
-
addEncoded
Add pre-encoded values computed on demand from a function over an int value index. The caller is responsible for ensuring that the encoding is correct.- Parameters:
count- The number of values to addvalueSupplier- The value supplier, over domain[0, length)
-
addFromObjectChunk
public final void addFromObjectChunk(@NotNull ObjectChunk<DATA_TYPE, ? extends Attributes.Values> source) Description copied from interface:AppendableColumnAdd all values fromsourcein the range[0, source.size()).- Specified by:
addFromObjectChunkin interfaceAppendableColumn<DATA_TYPE>- Parameters:
source- The sourceObjectChunk
-