Package net.quasardb.qdb.ts
Class AutoFlushWriter
java.lang.Object
net.quasardb.qdb.ts.Writer
net.quasardb.qdb.ts.AutoFlushWriter
- All Implemented Interfaces:
Flushable
,AutoCloseable
An implementation of a Writer that automatically flushes the local cache when
a certain threshold has been reached.
As with Writer, usage of instances of this class is not thread-safe. Use an
AutFlushWriter instance per Thread in multi-threaded situations.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.quasardb.qdb.ts.Writer
Writer.Builder, Writer.Options, Writer.PushMode
-
Field Summary
Fields inherited from class net.quasardb.qdb.ts.Writer
pointsSinceFlush
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AutoFlushWriter
(Session session, long threshold, Writer.Options options) Initialize a new auto-flushing batch writer.protected
AutoFlushWriter
(Session session, Writer.Options options) Initialize a new auto-flushing batch writer with a default threshold of 50000 rows. -
Method Summary
Methods inherited from class net.quasardb.qdb.ts.Writer
append, append, append, builder, close, finalize, flush, flush, prepareFlush, prepareFlush, size, trackMinMaxTimestamp
-
Constructor Details
-
AutoFlushWriter
Initialize a new auto-flushing batch writer with a default threshold of 50000 rows.- Parameters:
session
- Active connection with the QdbClusteroptions
- Batch writer options
-
AutoFlushWriter
Initialize a new auto-flushing batch writer.- Parameters:
session
- Active connection with the QdbClusterthreshold
- The amount of rows to keep in local buffer before automatic flushing occurs.options
- Writer options
-
-
Method Details
-
append
Description copied from class:Writer
Append a new row to the local table cache. Should be periodically flushed, unless anAutoFlushWriter
is used. This function automatically looks up a table's offset by its name. For performance reason, you are encouraged to manually invoke and cache the value of #tableIndexByName whenever possible.- Overrides:
append
in classWriter
- Parameters:
table
- Table to insert into.timestamp
- Timestamp of the rowvalues
- Values being inserted, mapped to columns by their relative offset.- Throws:
IOException
- See Also:
-