public static final class BulkInserter.FlushOptions extends Object
BulkInserter
The default value of the 'flushInterval' is set to a negative value to indicate that
the automatic flush feature is not needed. If the default values are passed in for the
BulkInserter.FlushOptions
instance to the constructors it is mandatory to call the method
BulkInserter.flush()
or BulkInserter.close()
so that the records are actually saved to the table.BulkInserter.flush()
Modifier and Type | Field and Description |
---|---|
static boolean |
FLUSH_WHEN_FULL |
static int |
NO_PERIODIC_FLUSH |
Constructor and Description |
---|
FlushOptions()
Default constructor
|
FlushOptions(boolean flushWhenFull,
int flushInterval)
Constructor with all members
|
Modifier and Type | Method and Description |
---|---|
static BulkInserter.FlushOptions |
defaultOptions()
This method returns an instance of
BulkInserter.FlushOptions with default values. |
boolean |
equals(Object o) |
int |
getFlushInterval() |
int |
hashCode() |
boolean |
isFlushWhenFull() |
void |
setFlushInterval(int flushInterval)
Sets the flush interval
|
void |
setFlushWhenFull(boolean flushWhenFull)
Sets the flag to set whether to flush when queues are full or not
|
public static final int NO_PERIODIC_FLUSH
public static final boolean FLUSH_WHEN_FULL
public FlushOptions()
public FlushOptions(boolean flushWhenFull, int flushInterval)
flushWhenFull
- - boolean value indicating whether to flush only full queuesflushInterval
- - the time interval in seconds to execute flushpublic static BulkInserter.FlushOptions defaultOptions()
BulkInserter.FlushOptions
with default values.BulkInserter.FlushOptions
classpublic boolean isFlushWhenFull()
public void setFlushWhenFull(boolean flushWhenFull)
flushWhenFull
- - boolean value to indicate whether to flush only full queuespublic int getFlushInterval()
public void setFlushInterval(int flushInterval)
flushInterval
- - time in secondsCopyright © 2024. All rights reserved.