Class LogAggregatorWriterStandard
java.lang.Object
com.illumon.iris.db.v2.logaggregator.LogAggregatorWriterStandard
- All Implemented Interfaces:
io.deephaven.enterprise.binlog.channels.ChannelManager,io.deephaven.enterprise.binlog.channels.ChannelManagerStandard,io.deephaven.enterprise.binlog.support.SinglePartitionBufferWriter
public class LogAggregatorWriterStandard
extends Object
implements io.deephaven.enterprise.binlog.channels.ChannelManagerStandard, io.deephaven.enterprise.binlog.support.SinglePartitionBufferWriter
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.
-
Constructor Summary
ConstructorsConstructorDescriptionLogAggregatorWriterStandard(com.fishlib.io.logger.Logger log, InetSocketAddress serverAddress, String namespace, String tableName, TableIdentifier.NamespaceSet namespaceSet, String internalPartition, String columnPartition, TokenFactoryFactory tokenFactorySource) LogAggregatorWriterStandard(com.fishlib.io.logger.Logger log, InetSocketAddress serverAddress, String namespace, String tableName, TableIdentifier.NamespaceSet namespaceSet, String internalPartition, String columnPartition, ZoneId zoneId, TokenFactoryFactory tokenFactorySource, BiFunction<String, ZoneId, io.deephaven.enterprise.binlog.channels.ExpirationManager<String>> columnPartitionFactory) Create a BinaryStoreAggregatorWriterStandard for the specified time zone. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Send CLIENT_FINISHED message, poll for an ACK and close the channel.voidflush()Open a channel to the Log Aggregator Service and initialize it with table identifiers and binary header.protected static io.deephaven.enterprise.binlog.channels.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.voidsetHeader(ByteBuffer headerBuffer) voidwriteDataToPartition(ByteBuffer bufferToWrite)
-
Constructor Details
-
LogAggregatorWriterStandard
public LogAggregatorWriterStandard(@NotNull com.fishlib.io.logger.Logger log, @NotNull InetSocketAddress serverAddress, @NotNull String namespace, @NotNull String tableName, @NotNull TableIdentifier.NamespaceSet namespaceSet, @NotNull String internalPartition, @NotNull String columnPartition, TokenFactoryFactory tokenFactorySource) throws IOException Delegate toLogAggregatorWriterStandard(Logger, InetSocketAddress, String, String, TableLocationIdentifier.NamespaceSet, String, String, ZoneId, TokenFactoryFactory, BiFunction)using the default time zone.- Parameters:
log- the Logger instanceserverAddress- the LAS server's addressnamespace- the namespacetableName- the table namenamespaceSet- the namespace setinternalPartition- the internal partitioncolumnPartition- the column partition; if NULL_PARTITION is specified, then the current date column partition factory will be used to determine column partition valuestokenFactorySource- a token source for authentication- Throws:
IOException- from initialization
-
LogAggregatorWriterStandard
public LogAggregatorWriterStandard(@NotNull com.fishlib.io.logger.Logger log, @NotNull InetSocketAddress serverAddress, @NotNull String namespace, @NotNull String tableName, @NotNull TableIdentifier.NamespaceSet namespaceSet, @NotNull String internalPartition, @NotNull String columnPartition, ZoneId zoneId, TokenFactoryFactory tokenFactorySource, @Nullable BiFunction<String, ZoneId, io.deephaven.enterprise.binlog.channels.ExpirationManager<String>> columnPartitionFactory) Create a BinaryStoreAggregatorWriterStandard for the specified time zone. This is for a specific table location (i.e. namespace/table name/namespace set/internal partition), with column partition values either specified explicitly or determined by a current-date column partition factory.- Parameters:
log- the Logger instanceserverAddress- the LAS server's addressnamespace- the namespacetableName- the table namenamespaceSet- the namespace setinternalPartition- the internal partitioncolumnPartition- the column partition; if NULL_PARTITION is specified, then the current date column partition factory will be used to determine column partition valueszoneId- the time zone ID for standard partition determination, or null to use the system default zonetokenFactorySource- a token source for authentication- Throws:
IOException- from initialization
-
-
Method Details
-
setHeader
- Specified by:
setHeaderin interfaceio.deephaven.enterprise.binlog.support.SinglePartitionBufferWriter- 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 interfaceio.deephaven.enterprise.binlog.channels.ChannelManagerStandard- Returns:
- non-null, open channel to the server, else an exception
- Throws:
IOException
-
close
Send CLIENT_FINISHED message, poll for an ACK and close the channel.- Specified by:
closein interfaceio.deephaven.enterprise.binlog.channels.ChannelManager- Specified by:
closein interfaceio.deephaven.enterprise.binlog.support.SinglePartitionBufferWriter- Throws:
IOException
-
flush
- Specified by:
flushin interfaceio.deephaven.enterprise.binlog.channels.ChannelManager- Throws:
IOException
-
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 static io.deephaven.enterprise.binlog.channels.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
-
writeDataToPartition
- Specified by:
writeDataToPartitionin interfaceio.deephaven.enterprise.binlog.support.SinglePartitionBufferWriter- Throws:
IOException
-