public static class PublisherOptions.Builder
extends java.lang.Object
| Constructor and Description |
|---|
PublisherOptions.Builder() |
| Modifier and Type | Method and Description |
|---|---|
PublisherOptions |
create()
Create
PublisherOptions object using the values currently set. |
PublisherOptions.Builder |
setAccessMode(SDK.AccessMode mode)
Set the access mode to use for the publisher.
|
PublisherOptions.Builder |
setAsyncPublishing(boolean async)
If set to false a publish wait for servers response after each send.
|
PublisherOptions.Builder |
setBlockingMode(PublisherOptions.BlockingMode mode)
Sets the blocking mode to use.
|
PublisherOptions.Builder |
setBufferSize(int bufferSize)
Sets buffer size to use.
|
PublisherOptions.Builder |
setDispatcher(Dispatcher dispatcher) |
PublisherOptions.Builder |
setExitOnClose(boolean exitOnClose)
Should the server shutdown if this connection closes.
|
PublisherOptions.Builder |
setExitOnTimeout(int millis)
Should the server shutdown if this connection times out.
|
PublisherOptions.Builder |
setFinalizerOnTimeout(int millis,
java.lang.String timeoutFinalizer)
Set the command to run if this connection times out
|
PublisherOptions.Builder |
setHighPerformance()
A utility function that configures a Publisher for high performance.
|
PublisherOptions.Builder |
setUpdater(Updater updater) |
public PublisherOptions.Builder setHighPerformance()
public PublisherOptions.Builder setAccessMode(SDK.AccessMode mode)
Default mode is SDK.AccessMode.DIRECT.
mode - public PublisherOptions.Builder setDispatcher(Dispatcher dispatcher)
public PublisherOptions.Builder setUpdater(Updater updater)
public PublisherOptions.Builder setBlockingMode(PublisherOptions.BlockingMode mode)
Default is PublisherOptions.BlockingMode.NONE
mode - blocking mode to usepublic PublisherOptions.Builder setAsyncPublishing(boolean async)
Default is true
async - whether to sync with the server on each server write.public PublisherOptions.Builder setExitOnTimeout(int millis)
Default is 0 - no timeout
millis - timeout interval. Value of zero or less disables timeoutpublic PublisherOptions.Builder setExitOnClose(boolean exitOnClose)
Default is false
exitOnClose - public PublisherOptions.Builder setFinalizerOnTimeout(int millis, java.lang.String timeoutFinalizer)
Default is 0 - no timeout
millis - timeout interval. 0 or less disables finalizer from runningtimeoutFinalizer - public PublisherOptions.Builder setBufferSize(int bufferSize)
Publisher will queue up internally. If buffering is enabled
Publisher creates an internal publishing thread which formats and sends the data
over the socket. Potentially this configuration leads to best throughput characteristics.
Buffering can be combined with an auto blocking mode PublisherOptions.BlockingMode.AUTOBLOCKING.
In auto blocking modes, data rows are blocked automatically by the Publisher and sent over the wire.
It should be noted that buffering should not be used if it is important to track the records
that have been sent to the server. Because records are buffered internally, currently there is no
way for the client program to determine how many records have been successfully delivered. In
failover situations, a client program may query the server to determine which records have
been committed and start publishing from that point. If needed Publisher#publish(MessageWriter)
call may be used to sync up with the records queued so far.
The buffer is shared among all the MessageWriters that are retrieved from the
Publisher
Note - buffering cannot be enabled in CALLBACK mode. By default buffering is disabled.
bufferSize - buffer size to use. A size of 0 turns off buffering which is the default.public PublisherOptions create()
PublisherOptions object using the values currently set.PublisherOptions object