public class LocalAppendableColumn<DATA_TYPE> extends BaseAppendableColumn<DATA_TYPE> implements TableTransactionProcessor, BufferedAppendableColumn<DATA_TYPE>
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 LocalAppendableColumn.force() (which may proceed concurrently).
LocalAppendableColumn.release() or LocalAppendableColumn.close() must only be called after all other operations besides LocalAppendableColumn.force() are
completed, in any thread. The expectation is that after an error in writing applications will LocalAppendableColumn.release()
scarce resources, or after successful writing applications will LocalAppendableColumn.close() the column.
Note that code assumes correct usage, and omits validation for alignment issues that would occur with incorrect usage.
name, type| Modifier and Type | Method and Description |
|---|---|
void |
abortTransaction()
Abort the current pending transaction.
|
void |
addByte(byte value)
Append a byte to this column.
|
void |
addBytes(byte[] values,
int startIndex,
int length)
Add byte values from an array.
|
void |
addBytes(ByteBuffer inputBuffer)
Add byte values from a ByteBuffer, starting at buffer.position() and continuing to buffer.limit().
|
void |
addChar(char value)
Append a char to this column.
|
void |
addChars(char[] values,
int startIndex,
int length)
Add char values from an array.
|
void |
addDouble(double value)
Append a double to this column.
|
void |
addDoubles(double[] values,
int startIndex,
int length)
Add double values from an array.
|
void |
addFloat(float value)
Append a float to this column.
|
void |
addFloats(float[] values,
int startIndex,
int length)
Add float values from an array.
|
void |
addInt(int value)
Append a int to this column.
|
void |
addInts(int[] values,
int startIndex,
int length)
Add int values from an array.
|
void |
addLong(long value)
Append a long to this column.
|
void |
addLongs(long[] values,
int startIndex,
int length)
Add long values from an array.
|
void |
addShort(short value)
Append a short to this column.
|
void |
addShorts(short[] values,
int startIndex,
int length)
Add short values from an array.
|
void |
close()
Flush all appended data to the underlying store, release any resources held, and force all appended data to
be persisted to permanent storage.
|
void |
finishTransaction()
Finish the current pending transaction.
|
void |
flush()
Write all appended data to the underlying store and prepare for subsequent writes.
|
void |
force()
Force all flushed data to be persisted to permanent storage.
|
boolean |
inTransaction() |
void |
release()
Release any resources held.
|
void |
setValueToRangeMap(Map<DATA_TYPE,long[]> valueToRangeMap) |
void |
startTransaction()
Begin a new transaction.
|
String |
toString() |
add, add, addBoolean, addBooleans, checkArrayAddBounds, encodeDateTime, encodeExternalizable, encodeSerializable, getAddHelper, getName, getTypeclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitprepareCheckpointadd, add, addBoolean, addBooleans, addFromArray, addFromBoxedValue, addFromBoxedValue, addFromColumnSource, addFromColumnSource, addFromColumnSource, addFromColumnSource, addFromDataColumn, getAddHelper, getName, getTypepublic void setValueToRangeMap(@NotNull
Map<DATA_TYPE,long[]> valueToRangeMap)
valueToRangeMap - Map from unique, boxed column values to long[2] position ranges.public void force()
BufferedAppendableBufferedAppendable.prepareCheckpoint().
Does not imply BufferedAppendable.flush(), as this is a distinct operation in all implementations.
May be called concurrently by threads other than the "writing thread".force in interface AppendableColumn<DATA_TYPE>force in interface BufferedAppendablepublic void close()
BufferedAppendableBufferedAppendable.force() operations. A BufferedAppendable.release() is appropriate afterwards, especially on error.close in interface AppendableColumn<DATA_TYPE>close in interface BufferedAppendablepublic void flush()
BufferedAppendableBufferedAppendable.force().flush in interface BufferedAppendablepublic void release()
BufferedAppendableBufferedAppendable.force() operations.release in interface BufferedAppendablepublic boolean inTransaction()
inTransaction in interface TableTransactionProcessorpublic void startTransaction()
TableTransactionProcessorstartTransaction in interface TableTransactionProcessorpublic void abortTransaction()
TableTransactionProcessorAbort the current pending transaction.
This should not be called if there is no current transaction.
abortTransaction in interface TableTransactionProcessorpublic void finishTransaction()
TableTransactionProcessorFinish the current pending transaction.
This makes the rows that were part of the transaction eligible to be made visible and durable, but does not in itself make them visible or durable.
This should not be called if there is no current transaction.
finishTransaction in interface TableTransactionProcessorpublic void addByte(byte value)
AppendableColumnaddByte in interface AppendableColumn<DATA_TYPE>value - The value to appendpublic void addChar(char value)
AppendableColumnaddChar in interface AppendableColumn<DATA_TYPE>value - The value to appendpublic void addDouble(double value)
AppendableColumnaddDouble in interface AppendableColumn<DATA_TYPE>value - The value to appendpublic void addFloat(float value)
AppendableColumnaddFloat in interface AppendableColumn<DATA_TYPE>value - The value to appendpublic void addInt(int value)
AppendableColumnaddInt in interface AppendableColumn<DATA_TYPE>value - The value to appendpublic void addLong(long value)
AppendableColumnaddLong in interface AppendableColumn<DATA_TYPE>value - The value to appendpublic void addShort(short value)
AppendableColumnaddShort in interface AppendableColumn<DATA_TYPE>value - The value to appendpublic void addBytes(@NotNull
byte[] values,
int startIndex,
int length)
AppendableColumnaddBytes in interface AppendableColumn<DATA_TYPE>values - The array of valuesstartIndex - The index of the first value to addlength - The total number of values to addpublic void addBytes(@NotNull
ByteBuffer inputBuffer)
AppendableColumnaddBytes in interface AppendableColumn<DATA_TYPE>inputBuffer - The bufferpublic void addChars(@NotNull
char[] values,
int startIndex,
int length)
AppendableColumnaddChars in interface AppendableColumn<DATA_TYPE>values - The array of valuesstartIndex - The index of the first value to addlength - The total number of values to addpublic void addDoubles(@NotNull
double[] values,
int startIndex,
int length)
AppendableColumnaddDoubles in interface AppendableColumn<DATA_TYPE>values - The array of valuesstartIndex - The index of the first value to addlength - The total number of values to addpublic void addFloats(@NotNull
float[] values,
int startIndex,
int length)
AppendableColumnaddFloats in interface AppendableColumn<DATA_TYPE>values - The array of valuesstartIndex - The index of the first value to addlength - The total number of values to addpublic void addInts(@NotNull
int[] values,
int startIndex,
int length)
AppendableColumnaddInts in interface AppendableColumn<DATA_TYPE>values - The array of valuesstartIndex - The index of the first value to addlength - The total number of values to addpublic void addLongs(@NotNull
long[] values,
int startIndex,
int length)
AppendableColumnaddLongs in interface AppendableColumn<DATA_TYPE>values - The array of valuesstartIndex - The index of the first value to addlength - The total number of values to addpublic void addShorts(@NotNull
short[] values,
int startIndex,
int length)
AppendableColumnaddShorts in interface AppendableColumn<DATA_TYPE>values - The array of valuesstartIndex - The index of the first value to addlength - The total number of values to add