Class BinaryStoreAggregatorWriterStandard
java.lang.Object
com.illumon.iris.binarystore.AbstractBinaryStoreWriter<BinaryRowV2>
com.illumon.iris.binarystore.BinaryStoreWriterV2
com.illumon.iris.db.v2.logaggregator.BinaryStoreAggregatorWriterBase
com.illumon.iris.db.v2.logaggregator.BinaryStoreAggregatorWriterStandard
- All Implemented Interfaces:
ChannelManager,ChannelManagerStandard,Entry,Record,Row,TableWriter<BinaryRowV2>
public class BinaryStoreAggregatorWriterStandard
extends BinaryStoreAggregatorWriterBase
implements ChannelManagerStandard
Write binary rows to a log aggregation service. This implementation is for column partition values that are not
determined by row-level data. They may still change, for example based on the current date.
After construction, this will contain an authenticated and accepted connection to the LAS for the given identifiers. If the channel connection is broken, attempts will be made to reconnect. Once either the client or server requests/indicates termination, or the client initiates a terminating command, the connection will be permanently closed.
This object is expected to be used by a single thread. Synchronization is to ensure that multiple commands don't occur at the same time, and to ensure that we don't close and check connections at the same time.
After construction, this will contain an authenticated and accepted connection to the LAS for the given identifiers. If the channel connection is broken, attempts will be made to reconnect. Once either the client or server requests/indicates termination, or the client initiates a terminating command, the connection will be permanently closed.
This object is expected to be used by a single thread. Synchronization is to ensure that multiple commands don't occur at the same time, and to ensure that we don't close and check connections at the same time.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.illumon.iris.binarystore.BinaryStoreWriterV2
BinaryStoreWriterV2.DeferrableRowPartitionNested classes/interfaces inherited from interface com.illumon.iris.binarystore.Record
Record.RecordSetter<T extends RecordData> -
Field Summary
Fields inherited from class com.illumon.iris.binarystore.BinaryStoreWriterV2
log, primaryRecordWriter, primaryRowWriterFields inherited from interface com.illumon.iris.binarystore.TableWriter
NULL_SETTER -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Send CLIENT_FINISHED message, poll for an ACK and close the channel.protected com.illumon.iris.db.v2.logaggregator.BinaryStoreAggregatorWriterStandard.LogAggregatorRecordWriterMake sure all the record writers for this class prepend a LAS message header.protected com.illumon.iris.db.v2.logaggregator.BinaryStoreAggregatorWriterStandard.LogAggregatorRowWritercreateBinaryRow(String[] columnNames, SupportedType[] columnTypes, Object[] typeMetadata) Make sure all the row writers for this class prepend a LAS message header.voidflush()Flushes data out.voidFlush all of the deferred rows in the input collection to the underlying stream.Open a channel to the Log Aggregator Service and initialize it with table identifiers and binary header.com.illumon.iris.db.v2.logaggregator.BinaryStoreAggregatorWriterStandard.LogAggregatorRecordWriterGet new writer for Record entries.voidinit()protected ExpirationManager<String>makeColumnPartitionFactory(String columnPartition, ZoneId zoneid) Injection point for testing.voidSend a command message to the Log Aggregator, requesting that the current partition be deleted.Methods inherited from class com.illumon.iris.db.v2.logaggregator.BinaryStoreAggregatorWriterBase
getTransactionSizeLimitMethods inherited from class com.illumon.iris.binarystore.BinaryStoreWriterV2
computeHeaderBuffer, flushDeferredRows, getColumnNames, getColumnPartitionValue, getColumnTypes, getRecordSetter, getRecordSetter, getRowWriter, getSetter, makeCurrentDatePartitionedBinaryStoreWriter, makeMultiPartitionFileManagerBinaryStoreWriter, makeSpecifiedPartitionBinaryStoreWriter, setColumnPartitionValue, setFlags, setRecordData, writeDeferredRow, writeMulti, writeRecord, writeRowMethods inherited from class com.illumon.iris.binarystore.AbstractBinaryStoreWriter
setChannelManager, supportAllTypesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.illumon.iris.binarystore.TableWriter
getSetter
-
Method Details
-
createBinaryRow
protected com.illumon.iris.db.v2.logaggregator.BinaryStoreAggregatorWriterStandard.LogAggregatorRowWriter createBinaryRow(String[] columnNames, SupportedType[] columnTypes, Object[] typeMetadata) Make sure all the row writers for this class prepend a LAS message header.- Overrides:
createBinaryRowin classBinaryStoreWriterV2
-
createBinaryRecord
protected com.illumon.iris.db.v2.logaggregator.BinaryStoreAggregatorWriterStandard.LogAggregatorRecordWriter createBinaryRecord()Make sure all the record writers for this class prepend a LAS message header.- Overrides:
createBinaryRecordin classBinaryStoreWriterV2- Returns:
- a new BinaryRecordV2 record writer
-
getRecordWriter
public com.illumon.iris.db.v2.logaggregator.BinaryStoreAggregatorWriterStandard.LogAggregatorRecordWriter getRecordWriter()Description copied from interface:TableWriterGet new writer for Record entries. This is likely to be newly created, so callers should cache this value. In practice, implementers generally cache the result of the first call to this method as a primary writer.- Specified by:
getRecordWriterin interfaceTableWriter<BinaryRowV2>- Overrides:
getRecordWriterin classBinaryStoreWriterV2- Returns:
- a Record, likely newly created
-
init
- Overrides:
initin classBinaryStoreWriterV2- Throws:
IOException
-
getChannel
Open a channel to the Log Aggregator Service and initialize it with table identifiers and binary header. This getChannel implementation only works for standard-column-partition-determination instances.- Specified by:
getChannelin interfaceChannelManagerStandard- Returns:
- non-null, open channel to the server, else an exception
- Throws:
IOException- if the call encounters an error
-
close
Send CLIENT_FINISHED message, poll for an ACK and close the channel.- Specified by:
closein interfaceChannelManager- Specified by:
closein interfaceTableWriter<BinaryRowV2>- Overrides:
closein classAbstractBinaryStoreWriter<BinaryRowV2>- Throws:
IOException- problem closing the writer.
-
flush
Description copied from interface:TableWriterFlushes data out.- Specified by:
flushin interfaceChannelManager- Specified by:
flushin interfaceTableWriter<BinaryRowV2>- Overrides:
flushin classAbstractBinaryStoreWriter<BinaryRowV2>- Throws:
IOException- problem flushing data out.
-
sendDeletePartition
Send a command message to the Log Aggregator, requesting that the current partition be deleted. The connection will be closed by the server, no further data or commands are allowed.- Throws:
IOException
-
makeColumnPartitionFactory
protected ExpirationManager<String> makeColumnPartitionFactory(String columnPartition, ZoneId zoneid) Injection point for testing.- Parameters:
columnPartition- the column partition passed into the caller, or null if the partition should be determined by the datezoneid- the ZoneId needed to create a DailyExpiration- Returns:
- an ExpirationManager appropriate to the member variables
-
flushDeferredRows
Description copied from class:BinaryStoreWriterV2Flush all of the deferred rows in the input collection to the underlying stream.- Overrides:
flushDeferredRowsin classBinaryStoreWriterV2- Parameters:
part- The collection of deferred rows for the partitionVlaue- Throws:
IOException- if an error occurs during writing. Rows may be partially written, however there are no guarantees that the rows were written completely.
-