public enum QueryPolicy extends Enum<QueryPolicy>
Enum Constant and Description |
---|
ANY_LOCAL
Query committed Raft state locally on any Raft group member.
|
LEADER_LOCAL
Query committed Raft state locally only on Raft group leader.
|
LINEARIZABLE
Query Raft state in a linearizable manner, either by appending
a log entry to Raft log or using the algorithm defined in
6.4 Processing read-only queries more efficiently
section of Raft dissertation.
|
Modifier and Type | Method and Description |
---|---|
static QueryPolicy |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static QueryPolicy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final QueryPolicy LEADER_LOCAL
If the leader is split from the group and a new leader is elected already, stale values can be read until it realizes the split.
This policy is likely to hit more recent data when compared to
ANY_LOCAL
.
public static final QueryPolicy ANY_LOCAL
Reading stale value is possible when a follower lags behind the leader or is split from rest of the group.
LEADER_LOCAL
should be preferred if it's important to read
up-to-date data mostly.
public static final QueryPolicy LINEARIZABLE
public static QueryPolicy[] values()
for (QueryPolicy c : QueryPolicy.values()) System.out.println(c);
public static QueryPolicy 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 © 2022 Hazelcast, Inc.. All Rights Reserved.