Package com.illumon.iris.db.util.logging
Class RemoteTableAppender
java.lang.Object
com.illumon.iris.db.util.logging.RemoteTableAppender
- All Implemented Interfaces:
AutoCloseable
public class RemoteTableAppender extends Object implements AutoCloseable
API to add or replace table data.
-
Constructor Summary
Constructors Constructor Description RemoteTableAppender(com.fishlib.io.logger.Logger log, TableDefinition tableDefinition, String namespace, String tableName, String columnPartitionValue)
Delegates toRemoteTableAppender(Logger, TableDefinition, String, String, String, String, int)
with the default internal partition table logger queue size.RemoteTableAppender(com.fishlib.io.logger.Logger log, TableDefinition tableDefinition, String namespace, String tableName, String columnPartitionValue, int tableLoggerQueueSize)
Delegate toRemoteTableAppender(Logger, TableDefinition, String, String, String, String, int)
with the default internal partition value.RemoteTableAppender(com.fishlib.io.logger.Logger log, TableDefinition tableDefinition, String namespace, String tableName, String internalPartitionValue, String columnPartitionValue)
Delegate toRemoteTableAppender(Logger, TableDefinition, String, String, String, String, int)
with the default table logger size.RemoteTableAppender(com.fishlib.io.logger.Logger log, TableDefinition tableDefinition, String namespace, String tableName, String internalPartitionValue, String columnPartitionValue, int tableLoggerQueueSize)
Create a connection for the given 4-tuple and table definition. -
Method Summary
Modifier and Type Method Description void
append(Table t)
Append the given table to the partition.void
append(Table t, long offset, long length)
Append the subset of the given table to the partition.void
appendAtomic(Table t)
Append the given table to the partition, keeping all rows sequential.void
appendAtomic(Table t, long offset, long length)
Append the subset of the given table to the partition, keeping all rows sequential.void
close()
Close this RemoteTableAppender and its network connection.void
flush()
Request and confirm that all data send so far has been processed by the remote service.void
removePartition()
Delete the table location represented by this connection.void
shutdown()
Close this RemoteTableAppender and its network connection.
-
Constructor Details
-
RemoteTableAppender
public RemoteTableAppender(@NotNull com.fishlib.io.logger.Logger log, @NotNull TableDefinition tableDefinition, @NotNull String namespace, @NotNull String tableName, @NotNull String internalPartitionValue, @NotNull String columnPartitionValue, int tableLoggerQueueSize)Create a connection for the given 4-tuple and table definition. There are several ways to get and modify a table definition, some of which have namespace and table name set, and some which do not. These values will be ignored if present in the table definition. The columnPartition ultimately determines storage location, and it is essentially a constant column value in that respect. It is not valid to specify both a partitioning column and a column partition value, so the table definition is not allowed to have a partitioning column set.- Parameters:
log
- logging destinationtableDefinition
- the definition of the table to lognamespace
- the namespace of the tabletableName
- the name of the tableinternalPartitionValue
- internal partition valuecolumnPartitionValue
- column partition valuetableLoggerQueueSize
- size to be passed to the tableLogger initializer
-
RemoteTableAppender
public RemoteTableAppender(@NotNull com.fishlib.io.logger.Logger log, @NotNull TableDefinition tableDefinition, @NotNull String namespace, @NotNull String tableName, @NotNull String columnPartitionValue, int tableLoggerQueueSize)Delegate toRemoteTableAppender(Logger, TableDefinition, String, String, String, String, int)
with the default internal partition value. -
RemoteTableAppender
public RemoteTableAppender(@NotNull com.fishlib.io.logger.Logger log, @NotNull TableDefinition tableDefinition, @NotNull String namespace, @NotNull String tableName, @NotNull String columnPartitionValue)Delegates toRemoteTableAppender(Logger, TableDefinition, String, String, String, String, int)
with the default internal partition table logger queue size. -
RemoteTableAppender
public RemoteTableAppender(@NotNull com.fishlib.io.logger.Logger log, @NotNull TableDefinition tableDefinition, @NotNull String namespace, @NotNull String tableName, @NotNull String internalPartitionValue, @NotNull String columnPartitionValue)Delegate toRemoteTableAppender(Logger, TableDefinition, String, String, String, String, int)
with the default table logger size.
-
-
Method Details
-
append
Append the given table to the partition.- Parameters:
t
- the table- Throws:
IOException
-
appendAtomic
Append the given table to the partition, keeping all rows sequential.- Parameters:
t
- the table- Throws:
IOException
-
append
Append the subset of the given table to the partition. Rows offset to offset + length-1 will be included.- Parameters:
t
- the tableoffset
- the starting positionlength
- the number of rows to include- Throws:
IOException
-
appendAtomic
Append the subset of the given table to the partition, keeping all rows sequential. Rows offset to offset + length-1 will be included.- Parameters:
t
- the tableoffset
- the starting positionlength
- the number of rows to include- Throws:
IOException
-
close
Close this RemoteTableAppender and its network connection.- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-
flush
Request and confirm that all data send so far has been processed by the remote service.- Throws:
IOException
-
shutdown
Close this RemoteTableAppender and its network connection.- Throws:
IOException
-
removePartition
Delete the table location represented by this connection. The RemoteTableAppender and its network connection will be closed.- Throws:
IOException
-