Package com.illumon.intradaylogger
Interface IntradayLogger
- All Known Subinterfaces:
AuditEventLogFormat1Interface,EightArgLogger<T1,,T2, T3, T4, T5, T6, T7, T8> FiveArgLogger<T1,,T2, T3, T4, T5> FourArgLogger<T1,,T2, T3, T4> MultiArgLogger,OneArgLogger<T1>,SevenArgLogger<T1,,T2, T3, T4, T5, T6, T7> SixArgLogger<T1,,T2, T3, T4, T5, T6> SQLReplicationLogger,TableLogger,ThreeArgLogger<T1,,T2, T3> TwoArgLogger<T1,T2>
- All Known Implementing Classes:
AuditEventLogFormat3Logger,BarrageSnapshotPerformanceLogger,BarrageSubscriptionPerformanceLogger,BlackScholesFormat1Logger,IntradayLoggerImpl2,ProcessEventLogFormat2Logger,ProcessEventLogIndexLogger,ProcessMetricsFormat1Logger,ProcessTelemetryFormat1Logger,ProcessTelemetryIndexLogger,QueryOperationPerformanceLogCommunityIndexFormat1Logger,QueryOperationPerformanceLogCoreV2IndexFormat1Logger,QueryOperationPerformanceLogFormat3Logger,QueryOperationPerformanceLogIndexLogger,QueryPerformanceLogCommunityIndexFormat1Logger,QueryPerformanceLogCoreV2IndexFormat1Logger,QueryPerformanceLogFormat2Logger,QueryPerformanceLogIndexLogger,ServerStateLogCommunityIndexFormat1Logger,ServerStateLogCoreV2IndexFormat1Logger,UpdatePerformanceAncestorsIndexFormat1Logger,UpdatePerformanceLogCommunityIndexFormat1Logger,UpdatePerformanceLogCoreV2IndexFormat1Logger,UpdatePerformanceLogFormat4Logger,UpdatePerformanceLogIndexLogger,WorkspaceDataFormat1Logger
public interface IntradayLogger
All generated IntradayLoggers implement this interface.
If no interface is specified in the schema file, the IntradayLogger will also implement
com.illumon.intradaylogger.OneArgLogger, com.illumon.intradaylogger.TwoArgLogger, ...,
or com.illumon.intradaylogger.MultiArgLogger which provide an actual log() call.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceTableWriterFactory to build a table writer.static classDefault methods in TableWriterFactory flow the right direction for backward compatibility, but the wrong direction for implementation simplicity. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the logger and any writer in use.default intGet the log format (also called "application version") for this logger.Get theThreadthat is responsible for writing data from this logger, i.e.voidinit(IntradayLogger.TableWriterFactory tableWriterBuilder, int queueSize) voidinit(IntradayLogger.TableWriterFactory tableWriterBuilder, int queueSize, Thread sharedWriterThread) voidvoidbooleanisClosed()default voidsetOverflowThrottle(long throttleMillis) If the throttle is set to >= 0, then a pool and queue will be used that allows overflow.voidshutdown()Write all enqueued elements to theTableWriterand prevent further writes.booleantryWrite()Attempt to write a single row to theTableWritercreated using theIntradayLogger.TableWriterFactory.default booleanThis indicates whether or not the IntradayLogger instance is currently using row-based column partition selection.voidwaitDone()Block until output queue is empty or logger isclosed.booleanwaitDone(long timeoutMillis) Block until output queue is empty, logger isclosed, or timeout expires.
-
Field Details
-
DEFAULT_INTRADAY_LOGGER_FLAGS
-
-
Method Details
-
init
- Throws:
IOException
-
init
- Throws:
IOException
-
init
- Throws:
IOException
-
init
void init(IntradayLogger.TableWriterFactory tableWriterBuilder, int queueSize, Thread sharedWriterThread) throws IOException - Throws:
IOException
-
setOverflowThrottle
default void setOverflowThrottle(long throttleMillis) If the throttle is set to >= 0, then a pool and queue will be used that allows overflow. The overflowing will be throttled by a wait of this amount of time.- Parameters:
throttleMillis- milliseconds to wait before allocating new setters
-
tryWrite
Attempt to write a single row to the
TableWritercreated using theIntradayLogger.TableWriterFactory.Implementation Note: "written" simply means that the
TableWriteraccepted the write request. It may internally buffer the row.- Returns:
- true if a row was written, false otherwise.
- Throws:
IOException- if an error occurred during the write.
-
getWriterThread
Thread getWriterThread()Get theThreadthat is responsible for writing data from this logger, i.e. the unique thread assigned to calltryWrite(). This will return null if invoked before one of theinit(java.lang.String, int)overloads.- Returns:
- The writer
Threadfor this logger, or null ifinit(java.lang.String, int)hasn't been invoked yet
-
waitDone
void waitDone()Block until output queue is empty or logger isclosed. -
waitDone
boolean waitDone(long timeoutMillis) Block until output queue is empty, logger isclosed, or timeout expires.- Parameters:
timeoutMillis- How long to wait, in milliseconds- Returns:
- True if the output queue is empty and the logger closed, else false (e.g. because the timeout expired)
-
isClosed
boolean isClosed() -
close
Close the logger and any writer in use. Users should quiesce all logging threads and invokeshutdown()first in order to guarantee that all pending rows have been written to storage.- Throws:
IOException- if an error occurred closing the logger.
-
shutdown
void shutdown()Write all enqueued elements to theTableWriterand prevent further writes. This should be invoked beforeclose(). This must not be invoked if any threads might still try to log additional items. -
usingDynamicPartitioning
default boolean usingDynamicPartitioning()This indicates whether or not the IntradayLogger instance is currently using row-based column partition selection. An instance may support row-based partition selection but not be using it based on its initialization. This method will be used by generated loggers to know whether to set each row's column partition value based on the defined formula or method.- Returns:
- true if the logger is using row-based column partition selection
-
getLogFormat
default int getLogFormat()Get the log format (also called "application version") for this logger. May be used, for example, to segment log streams into multiple partitions by log format as part of a rollout strategy for new schema versions.- Returns:
- The log format number
-