Package io.deephaven.tablelogger
Class TableLoggerImpl2<T extends WritableRowContainer>
java.lang.Object
io.deephaven.tablelogger.TableLoggerImpl2<T>
- All Implemented Interfaces:
TableLogger
- Direct Known Subclasses:
MemoryTableLogger
public abstract class TableLoggerImpl2<T extends WritableRowContainer>
extends Object
implements TableLogger
Common parts of the generated TableLoggers.
It is "2" so that we can change the implementation details from TableLoggerImpl; and existing client code will still
compile. Otherwise, there is a chicken and egg problem, with clients not being able to run the new TableLoggerFactory
using modules that contain their logger classes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassTableLoggerImpl2.BaseSetter<T2 extends TableLoggerImpl2<T>.BaseSetter<T2>> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected final AtomicIntegerprotected TableWriterFields inherited from interface io.deephaven.tablelogger.TableLogger
DEFAULT_INTRADAY_LOGGER_FLAGS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidclose()Close the logger and any writer in use.protected abstract Tprotected final voidfinal voidinit(TableWriter tableWriter, int queueSize) final booleanisClosed()protected final booleanfinal voidshutdown()Write all enqueued elements to theTableWriterand prevent further writes.protected abstract Stringprotected final voidverifyCondition(boolean condition, String message) Check the condition and throw an IllegalStateException if it is not met.final voidwaitDone()Wait for all currently populated rows to be written.final booleanwaitDone(long millis)
-
Field Details
-
writer
-
setterPool
-
isClosed
protected volatile boolean isClosed -
isShuttingDown
protected volatile boolean isShuttingDown -
outstandingSetters
-
-
Constructor Details
-
TableLoggerImpl2
-
-
Method Details
-
init
- Specified by:
initin interfaceTableLogger- Throws:
IOException
-
createSetter
-
threadName
-
isInitialized
protected final boolean isInitialized() -
verifyCondition
Check the condition and throw an IllegalStateException if it is not met.- Parameters:
condition- the condition to checkmessage- useful information for the IllegalStateException- Throws:
IllegalStateException- if the condition is false
-
shutdown
public final void shutdown()Description copied from interface:TableLoggerWrite all enqueued elements to theTableWriterand prevent further writes. This should be invoked beforeTableLogger.close(). This must not be invoked if any threads might still try to log additional items.- Specified by:
shutdownin interfaceTableLogger
-
flush
-
waitDone
public final void waitDone()Wait for all currently populated rows to be written. -
waitDone
public final boolean waitDone(long millis) -
close
Description copied from interface:TableLoggerClose the logger and any writer in use. Users should quiesce all logging threads and invokeTableLogger.shutdown()first in order to guarantee that all pending rows have been written to storage.- Specified by:
closein interfaceTableLogger- Throws:
IOException- if an error occurred closing the logger.
-
isClosed
public final boolean isClosed()- Specified by:
isClosedin interfaceTableLogger
-