@InterfaceAudience.Public @InterfaceStability.Evolving public static enum SessionConfiguration.FlushMode extends Enum<SessionConfiguration.FlushMode>
Enum Constant and Description |
---|
AUTO_FLUSH_BACKGROUND
KuduSession.apply() calls will return immediately, but the writes
will be sent in the background, potentially batched together with other writes from
the same session. |
AUTO_FLUSH_SYNC
Each
KuduSession.apply() call will return only after being
flushed to the server automatically. |
MANUAL_FLUSH
KuduSession.apply() calls will return immediately, but the writes
will not be sent until the user calls KuduSession.flush() . |
Modifier and Type | Method and Description |
---|---|
static SessionConfiguration.FlushMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SessionConfiguration.FlushMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SessionConfiguration.FlushMode AUTO_FLUSH_SYNC
KuduSession.apply()
call will return only after being
flushed to the server automatically. No batching will occur.
In this mode, the KuduSession.flush()
call never has any effect, since each
KuduSession.apply()
has already flushed the buffer before
returning.
This is the default flush mode.
public static final SessionConfiguration.FlushMode AUTO_FLUSH_BACKGROUND
KuduSession.apply()
calls will return immediately, but the writes
will be sent in the background, potentially batched together with other writes from
the same session. If there is not sufficient buffer space, then
KuduSession.apply()
may block for buffer space to be available.
Because writes are applied in the background, any errors will be stored
in a session-local buffer. Call countPendingErrors()
or
getPendingErrors()
to retrieve them.
Note: The AUTO_FLUSH_BACKGROUND
mode may result in
out-of-order writes to Kudu. This is because in this mode multiple write
operations may be sent to the server in parallel.
See KUDU-1767 for more
information.
The KuduSession.flush()
call can be used to block until the buffer is empty.
public static final SessionConfiguration.FlushMode MANUAL_FLUSH
KuduSession.apply()
calls will return immediately, but the writes
will not be sent until the user calls KuduSession.flush()
. If the buffer runs past
the configured space limit, then KuduSession.apply()
will return
an error.public static SessionConfiguration.FlushMode[] values()
for (SessionConfiguration.FlushMode c : SessionConfiguration.FlushMode.values()) System.out.println(c);
public static SessionConfiguration.FlushMode valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2018 The Apache Software Foundation. All rights reserved.