@InterfaceAudience.Public
@InterfaceStability.Evolving
public interface SessionConfiguration
Modifier and Type | Interface and Description |
---|---|
static class |
SessionConfiguration.FlushMode |
Modifier and Type | Method and Description |
---|---|
int |
countPendingErrors()
Return the number of errors which are pending.
|
SessionConfiguration.FlushMode |
getFlushMode()
Get the current flush mode.
|
RowErrorsAndOverflowStatus |
getPendingErrors()
Return any errors from previous calls.
|
long |
getTimeoutMillis()
Get the current timeout.
|
boolean |
hasPendingOperations()
Check if there are operations that haven't been completely applied.
|
boolean |
isClosed()
Returns true if this session has already been closed.
|
boolean |
isIgnoreAllDuplicateRows()
Tells if the session is currently ignoring row errors when the whole list returned by a tablet
server is of the AlreadyPresent type.
|
boolean |
isIgnoreAllNotFoundRows()
Tells if the session is currently ignoring row errors when the whole list returned by a tablet
server is of the NotFound type.
|
void |
setErrorCollectorSpace(int size)
Set the number of errors that can be collected.
|
void |
setExternalConsistencyMode(ExternalConsistencyMode consistencyMode)
Set the new external consistency mode for this session.
|
void |
setFlushInterval(int interval)
Set the flush interval, which will be used for the next scheduling decision.
|
void |
setFlushMode(SessionConfiguration.FlushMode flushMode)
Set the new flush mode for this session.
|
void |
setIgnoreAllDuplicateRows(boolean ignoreAllDuplicateRows)
Configures the option to ignore all the row errors if they are all of the AlreadyPresent type.
|
void |
setIgnoreAllNotFoundRows(boolean ignoreAllNotFoundRows)
Configures the option to ignore all the row errors if they are all of the NotFound type.
|
void |
setMutationBufferLowWatermark(float mutationBufferLowWatermarkPercentage)
Deprecated.
The low watermark no longer has any effect.
|
void |
setMutationBufferSpace(int size)
Set the number of operations that can be buffered.
|
void |
setTimeoutMillis(long timeout)
Sets the timeout for the next applied operations.
|
SessionConfiguration.FlushMode getFlushMode()
AUTO_FLUSH_SYNC
by defaultvoid setFlushMode(SessionConfiguration.FlushMode flushMode)
flushMode
- new flush mode, can be the same as the previous one.IllegalArgumentException
- if the buffer isn't empty.void setMutationBufferSpace(int size)
size
- number of ops.IllegalArgumentException
- if the buffer isn't empty.void setMutationBufferLowWatermark(float mutationBufferLowWatermarkPercentage)
mutationBufferLowWatermarkPercentage
- a new low watermark as a percentage,
has to be between 0 and 1 (inclusive). A value of 1 disables
the low watermark since it's the same as the high oneIllegalArgumentException
- if the buffer isn't empty or if the watermark isn't between
0 and 1void setFlushInterval(int interval)
interval
- interval in milliseconds.long getTimeoutMillis()
void setTimeoutMillis(long timeout)
timeout
- Timeout in milliseconds.boolean isClosed()
boolean hasPendingOperations()
void setExternalConsistencyMode(ExternalConsistencyMode consistencyMode)
consistencyMode
- new external consistency mode, can the same as the previous one.IllegalArgumentException
- if the buffer isn't empty.boolean isIgnoreAllDuplicateRows()
void setIgnoreAllDuplicateRows(boolean ignoreAllDuplicateRows)
Disabled by default.
ignoreAllDuplicateRows
- true if this session should enforce this, else falseboolean isIgnoreAllNotFoundRows()
void setIgnoreAllNotFoundRows(boolean ignoreAllNotFoundRows)
Disabled by default.
ignoreAllNotFoundRows
- true if this session should enforce this, else falsevoid setErrorCollectorSpace(int size)
size
- number of errors.int countPendingErrors()
AUTO_FLUSH_BACKGROUND
mode.RowErrorsAndOverflowStatus getPendingErrors()
Clears the pending errors.