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
Modifier and TypeClassDescriptionclass
TableLoggerImpl2.BaseSetter<T2 extends TableLoggerImpl2<T>.BaseSetter<T2>>
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected boolean
protected final AtomicInteger
protected TableWriter
Fields inherited from interface io.deephaven.tablelogger.TableLogger
DEFAULT_INTRADAY_LOGGER_FLAGS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
close()
Close the logger and any writer in use.protected abstract T
protected final void
final void
init
(TableWriter tableWriter, int queueSize) final boolean
isClosed()
protected final boolean
final void
shutdown()
Write all enqueued elements to theTableWriter
and prevent further writes.protected abstract String
protected final void
verifyCondition
(boolean condition, String message) Check the condition and throw an IllegalStateException if it is not met.final void
waitDone()
Wait for all currently populated rows to be written.final boolean
waitDone
(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:
init
in 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:TableLogger
Write all enqueued elements to theTableWriter
and 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:
shutdown
in 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:TableLogger
Close 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:
close
in interfaceTableLogger
- Throws:
IOException
- if an error occurred closing the logger.
-
isClosed
public final boolean isClosed()- Specified by:
isClosed
in interfaceTableLogger
-