Class ProcessMetricsLoggerCoreV2
- All Implemented Interfaces:
io.deephaven.enterprise.binlog.support.LoggerInfo
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byteFlag indicating that this row is the end of a transaction.static final byteFlag indicating that this row is neither the beginning nor end of a transaction.static final byteFlag indicating that this row is the beginning and end of a transaction.static final byteFlag indicating that this row is the beginning of a transaction.protected io.deephaven.enterprise.binlog.support.MultiPartitionBufferWriter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ByteBufferallocateBuffer(int size) Allocate a buffer for logging.voidclose()Closes the underlying writer for this logger.booleanprotected intinitialBufferSize(String Name, String Interval, String Type) Compute the initial size of the buffer for logging the row.initLog(io.deephaven.enterprise.binlog.support.MultiPartitionBufferWriter multiPartitionBufferWriter, String AuthenticatedUser, String EffectiveUser, String ProcessInfoId) Initialize a logger for the DbInternal.ProcessMetricsLogCoreV2 table, with log format 1.voidlog(String Date, byte flags, long Timestamp, String Name, String Interval, String Type, long N, long Sum, long Last, long Min, long Max, long Avg, long Sum2, long Stdev) Logs a row, using the writer passed in to theinitLog(io.deephaven.enterprise.binlog.support.MultiPartitionBufferWriter, java.lang.String, java.lang.String, java.lang.String)method.intmakeHeaderBuffer(String AuthenticatedUser, String EffectiveUser, String ProcessInfoId) Create a long-lived header buffer.makeRowBuffer(byte flags, long Timestamp, String Name, String Interval, String Type, long N, long Sum, long Last, long Min, long Max, long Avg, long Sum2, long Stdev) Allocates and populates a row buffer for the given inputs.populateHeaderBuffer(String AuthenticatedUser, String EffectiveUser, String ProcessInfoId) Populate a header buffer.populateRowBuffer(ByteBuffer outputBuffer, byte flags, long Timestamp, String Name, String Interval, String Type, long N, long Sum, long Last, long Min, long Max, long Avg, long Sum2, long Stdev) Populates the outputBuffer with the parameter values.voidreleaseBuffer(ByteBuffer buffer) Release a buffer previously allocated for logging the row.voidsetMaxEntrySize(int maxEntrySize) Sets The maximum size of a binary log entry.voidsetStringEstimateMultiplier(double stringEstimateMultiplier) Sets For strings that do not use a simple encoding, how many bytes (multiplied by length) should be initially allocated for each string?booleantoString()
-
Field Details
-
FLAG_NONE
public static final byte FLAG_NONEFlag indicating that this row is neither the beginning nor end of a transaction.- See Also:
-
FLAG_START
public static final byte FLAG_STARTFlag indicating that this row is the beginning of a transaction.- See Also:
-
FLAG_END
public static final byte FLAG_ENDFlag indicating that this row is the end of a transaction.- See Also:
-
FLAG_SINGLE_ROW
public static final byte FLAG_SINGLE_ROWFlag indicating that this row is the beginning and end of a transaction.- See Also:
-
writer
protected io.deephaven.enterprise.binlog.support.MultiPartitionBufferWriter writerThe writer used by thelog(java.lang.String, byte, long, java.lang.String, java.lang.String, java.lang.String, long, long, long, long, long, long, long, long)method. This must be set byinitLog(io.deephaven.enterprise.binlog.support.MultiPartitionBufferWriter, java.lang.String, java.lang.String, java.lang.String)before calling the log method.
-
-
Constructor Details
-
ProcessMetricsLoggerCoreV2
public ProcessMetricsLoggerCoreV2()
-
-
Method Details
-
initialBufferSize
Compute the initial size of the buffer for logging the row. If the buffer is not large enough, then it can be exponentially increased up until the maximum size. The initial size takes into account all fixed fields for the row, and then quickly estimates without actually encoding variable length fields. -
allocateBuffer
Allocate a buffer for logging.This method is protected so that it can be overridden by sub-classes, which may elect to use pooling or another allocation strategy. The buffers returned from this method must be released using
releaseBuffer(java.nio.ByteBuffer)after they are done being used. The logger implementations may retain a buffer for the life of the logger if it will be reused (e.g., header buffers are used across files and connections). -
releaseBuffer
Release a buffer previously allocated for logging the row.This method is protected so that it can be overridden by sub-classes, which may elect to use pooling or another allocation strategy. The logger implementations may retain a buffer for the life of the logger if it will be reused (e.g., header buffers are used across files and connections).
-
setStringEstimateMultiplier
public void setStringEstimateMultiplier(double stringEstimateMultiplier) Sets For strings that do not use a simple encoding, how many bytes (multiplied by length) should be initially allocated for each string? -
setMaxEntrySize
public void setMaxEntrySize(int maxEntrySize) Sets The maximum size of a binary log entry. This defaults to the value of BinaryStoreV2Constants.MAX_ENTRY_SIZE (1048576) at logger generation time. You must ensure that the loggers value is less than or equal to the value of the running system, or it the Data Import Server may not make progress consuming the generated binary log. -
initLog
public ProcessMetricsLoggerCoreV2 initLog(io.deephaven.enterprise.binlog.support.MultiPartitionBufferWriter multiPartitionBufferWriter, String AuthenticatedUser, String EffectiveUser, String ProcessInfoId) throws IOException Initialize a logger for the DbInternal.ProcessMetricsLogCoreV2 table, with log format 1.- Parameters:
multiPartitionBufferWriter- the writer for this logger, required for callinglog(java.lang.String, byte, long, java.lang.String, java.lang.String, java.lang.String, long, long, long, long, long, long, long, long)- Throws:
IOException
-
log
public void log(String Date, byte flags, long Timestamp, String Name, String Interval, String Type, long N, long Sum, long Last, long Min, long Max, long Avg, long Sum2, long Stdev) throws IOException Logs a row, using the writer passed in to theinitLog(io.deephaven.enterprise.binlog.support.MultiPartitionBufferWriter, java.lang.String, java.lang.String, java.lang.String)method.- Parameters:
flags- the flags for this row, which start and end transactions- Throws:
IOException
-
close
Closes the underlying writer for this logger.- Throws:
IOException
-
makeRowBuffer
public ByteBuffer makeRowBuffer(byte flags, long Timestamp, String Name, String Interval, String Type, long N, long Sum, long Last, long Min, long Max, long Avg, long Sum2, long Stdev) throws IOException Allocates and populates a row buffer for the given inputs.The buffer is allocated with allocateBuffer based on a size estimate, and exponentially doubled up until the value of maxEntrySize. The caller is responsible for calling releaseBuffer after the buffer is no longer necessary.
- Parameters:
flags- the flags for this row, which start and end transactions- Throws:
IOException
-
populateRowBuffer
public ByteBuffer populateRowBuffer(ByteBuffer outputBuffer, byte flags, long Timestamp, String Name, String Interval, String Type, long N, long Sum, long Last, long Min, long Max, long Avg, long Sum2, long Stdev) Populates the outputBuffer with the parameter values. The outputBuffer must be sufficiently sized to contain the output.- Parameters:
flags- the flags for this row, which start and end transactions
-
makeHeaderBuffer
public ByteBuffer makeHeaderBuffer(String AuthenticatedUser, String EffectiveUser, String ProcessInfoId) Create a long-lived header buffer.The header buffer includes all column definitions, constant columns and the application version.
The returned buffer is duplicated after calling
populateHeaderBuffer(java.lang.String, java.lang.String, java.lang.String), and is owned by the caller. It should not be passed to makeHeaderBuffer. -
populateHeaderBuffer
public ByteBuffer populateHeaderBuffer(String AuthenticatedUser, String EffectiveUser, String ProcessInfoId) Populate a header buffer.The header buffer includes all column definitions, constant columns and the application version.
The returned buffer is allocated with allocateBuffer, the caller is responsible for calling releaseBuffer after the buffer is done being used.
-
systemNamespace
public boolean systemNamespace()- Specified by:
systemNamespacein interfaceio.deephaven.enterprise.binlog.support.LoggerInfo
-
namespaceSet
- Specified by:
namespaceSetin interfaceio.deephaven.enterprise.binlog.support.LoggerInfo
-
dynamicPartitions
public boolean dynamicPartitions()- Specified by:
dynamicPartitionsin interfaceio.deephaven.enterprise.binlog.support.LoggerInfo
-
tableName
- Specified by:
tableNamein interfaceio.deephaven.enterprise.binlog.support.LoggerInfo
-
namespace
- Specified by:
namespacein interfaceio.deephaven.enterprise.binlog.support.LoggerInfo
-
logFormat
public int logFormat()- Specified by:
logFormatin interfaceio.deephaven.enterprise.binlog.support.LoggerInfo
-
toString
-