Class JGroupsRaftCommandOptions.ReadBuilder
java.lang.Object
org.jgroups.raft.command.JGroupsRaftCommandOptions.ReadBuilder
- Enclosing interface:
JGroupsRaftCommandOptions
Builder for read command options.
- Since:
- 2.0
- Author:
- José Bolina
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the read command options.ignoreReturnValue(boolean ignore) Sets whether to ignore the return value of the read operation.linearizable(boolean linearizable) Sets whether the read operation should be linearizable.
-
Constructor Details
-
ReadBuilder
public ReadBuilder()
-
-
Method Details
-
ignoreReturnValue
Sets whether to ignore the return value of the read operation.- Parameters:
ignore-trueto ignore return values,falseotherwise- Returns:
- this builder
-
linearizable
Sets whether the read operation should be linearizable.When
true, the read goes through the consensus protocol ensuring linearizable consistency. Whenfalse, the read is executed locally and may return stale data but with better performance.- Parameters:
linearizable-truefor linearizable reads,falsefor local reads- Returns:
- this builder
-
build
Builds the read command options.- Returns:
- the configured read options
-