Class BinaryLoggerSinkBuilder
In all cases, this factory will determine the internal partition (or a prefix thereof, if log-format suffixing is
set) through getInternalPartitionForLogs(LoggerInfo, boolean).
If binary log files are being written directly (the LAS is not used), the process name will be prefixed to the internal partition name to help distinguish them.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetInternalPartitionForLogs(io.deephaven.enterprise.binlog.support.LoggerInfo loggerInfo, boolean includePid) Determine an appropriate internal partition that can be used for writing logs.io.deephaven.enterprise.binlog.support.MultiPartitionBufferWritermakeMultiPartitionSink(com.fishlib.configuration.Configuration configuration, com.fishlib.io.logger.Logger log, io.deephaven.enterprise.binlog.support.LoggerInfo loggerInfo) Create a multi-partition log sink and initialize it according to the specified parameters on this builder.io.deephaven.enterprise.binlog.support.SinglePartitionBufferWritermakeSinglePartitionSink(com.fishlib.configuration.Configuration configuration, com.fishlib.io.logger.Logger log, io.deephaven.enterprise.binlog.support.LoggerInfo loggerInfo) Create a single partition log sink and initialize it according to the specified parameters on this builder.setColumnPartitionValue(String columnPartitionValue) Set the column partition value to be used.setForceUseLas(boolean forceUseLas) Set whether to always use the log aggregator service (LAS).setInternalPartitionSuffix(String internalPartitionSuffix) Set a suffix for the internal partition, defaults to no value.setLogDirectory(String logDirectory) Set an output directory for the binary logs.setNamespace(String namespace) Set the namespace for the new logger if the logger's default should not be used.setNamespaceSet(TableIdentifier.NamespaceSet namespaceSet) Set theTableIdentifier.NamespaceSet(USER or SYSTEM) for the logger.setProcessName(String processName) Set property prefix to be used for log creation and initialization.setSuffixInternalPartitionWithLogFormat(boolean suffixInternalPartitionWithLogFormat) Set whether to suffix internal partitions with the log format.setTableName(String tableName) Set the table name for the new logger, if the logger's default should not be used.setTimeZoneName(String timeZoneName) Set the name of the time zone to be used to determine column partition values and file name date-time stamps.
-
Constructor Details
-
BinaryLoggerSinkBuilder
public BinaryLoggerSinkBuilder()Construct a builder for newIntradayLoggers.
-
-
Method Details
-
setProcessName
Set property prefix to be used for log creation and initialization. Required.- Parameters:
processName- Property prefix to be used for log creation and initialization- Returns:
- This builder.
-
setNamespaceSet
Set theTableIdentifier.NamespaceSet(USER or SYSTEM) for the logger. Defaults toTableIdentifier.NamespaceSet.SYSTEM.- Parameters:
namespaceSet- TheTableIdentifier.NamespaceSetfor the logger- Returns:
- This builder.
-
setNamespace
Set the namespace for the new logger if the logger's default should not be used. Optional.- Parameters:
namespace- The namespace for the new logger- Returns:
- This builder.
-
setTableName
Set the table name for the new logger, if the logger's default should not be used. Optional.- Parameters:
tableName- The table name for the new logger- Returns:
- This builder.
-
setTimeZoneName
Set the name of the time zone to be used to determine column partition values and file name date-time stamps. Optional.If none is provided the system default will be used.
This is ignored for non-dynamic loggers using the log aggregator service.
Superceded when a column partition function or a column partition value is set and used.
- Parameters:
timeZoneName- The time zone name- Returns:
- This builder.
-
setColumnPartitionValue
Set the column partition value to be used. Optional.- Parameters:
columnPartitionValue- The column partition value- Returns:
- This builder.
-
setForceUseLas
Set whether to always use the log aggregator service (LAS). Defaults to false. Optional.- Parameters:
forceUseLas- Whether to force use of the log aggregator service (LAS)- Returns:
- This builder.
-
setSuffixInternalPartitionWithLogFormat
public BinaryLoggerSinkBuilder setSuffixInternalPartitionWithLogFormat(boolean suffixInternalPartitionWithLogFormat) Set whether to suffix internal partitions with the log format. Defaults to false. Optional.Example: If the internal partition would normally have been "ABC" and the logger format is version 4, the actual partition used would be: "ABC-4".
- Parameters:
suffixInternalPartitionWithLogFormat- Whether to suffix the internal partition with logger format- Returns:
- This builder.
-
setInternalPartitionSuffix
Set a suffix for the internal partition, defaults to no value. Optional.The suffix is applied after the computed internal partition, but before the log format (if suffixInternalPartitionWithLogFormat is true).
Example: If the internal partition would normally have been "ABC", the internal partition suffix is "DEF", and the logger format is version 4, the actual partition used would be: "ABC-DEF-4". If the log format suffix is not set, then the actual partition would be "ABC-DEF".
- Parameters:
internalPartitionSuffix- the suffix for the computed internal partition- Returns:
- This builder.
-
setLogDirectory
Set an output directory for the binary logs.If not set, calls ConfigurationUtils.getBinaryLogDir to determine the directory based on Configuration properties.
- Parameters:
logDirectory- the directory to write to- Returns:
- this builder
-
makeMultiPartitionSink
public io.deephaven.enterprise.binlog.support.MultiPartitionBufferWriter makeMultiPartitionSink(@NotNull com.fishlib.configuration.Configuration configuration, @NotNull com.fishlib.io.logger.Logger log, @NotNull io.deephaven.enterprise.binlog.support.LoggerInfo loggerInfo) throws IOException Create a multi-partition log sink and initialize it according to the specified parameters on this builder.The logger must support dynamic partitions, otherwise call
makeSinglePartitionSink(Configuration, Logger, LoggerInfo).- If a columnPartitionValue is provided, it will be used for all rows, regardless of any specified dynamic partition properties or provided columnPartitionFunction.
- If a columnPartition is not provided, then the logger must provide the partition for each row.
- The rows are written directly to binary log files unless the properties specify to use the log aggregator service (processName.useLogAggregatorService=true or loggerClass.processName.useLogAggregatorService=true) or forceUseLas is true.
- Parameters:
configuration-Configurationinstance for property lookuplog- a textLoggerto be used duringIntradayLoggerinitializationloggerInfo- aLoggerInfothat describes the logger to be created.- Returns:
- An initialized
MultiPartitionBufferWriter. - Throws:
IOException- when the log sink cannot be initialized
-
makeSinglePartitionSink
public io.deephaven.enterprise.binlog.support.SinglePartitionBufferWriter makeSinglePartitionSink(@NotNull com.fishlib.configuration.Configuration configuration, @NotNull com.fishlib.io.logger.Logger log, @NotNull io.deephaven.enterprise.binlog.support.LoggerInfo loggerInfo) throws IOException Create a single partition log sink and initialize it according to the specified parameters on this builder.The logger may support dynamic partitions, otherwise call
makeMultiPartitionSink(Configuration, Logger, LoggerInfo).- If a columnPartitionValue is provided, it is be used for all rows, regardless of any specified dynamic partition properties or provided columnPartitionFunction.
- If a columnPartition is not provided, then each row is logged to a partition based on the time that the logger passes the buffer to the sink (this may not align with the data).
- The rows are written directly to binary log files unless the properties specify to use the log aggregator service (processName.useLogAggregatorService=true or loggerClass.processName.useLogAggregatorService=true) or forceUseLas is true.
- Parameters:
configuration-Configurationinstance for property lookuplog- a textLoggerto be used duringIntradayLoggerinitializationloggerInfo- aLoggerInfothat describes the logger to be created.- Returns:
- An initialized
SinglePartitionBufferWriter. - Throws:
IOException- when the log sink cannot be initialized
-
getInternalPartitionForLogs
@NotNull public String getInternalPartitionForLogs(io.deephaven.enterprise.binlog.support.LoggerInfo loggerInfo, boolean includePid) Determine an appropriate internal partition that can be used for writing logs.- Parameters:
loggerInfo- information about the logger we are generating an internal partition for- Returns:
- the internal partition as described above.
-