public class PerReplicaStatesOps extends Object
Modifier and Type | Method and Description |
---|---|
static PerReplicaStatesOps |
addReplica(String replica,
Replica.State state,
boolean isLeader,
PerReplicaStates rs) |
static PerReplicaStatesOps |
deleteReplica(String replica,
PerReplicaStates rs)
Delete a replica entry from per-replica states
|
static PerReplicaStatesOps |
downReplicas(List<String> replicas,
PerReplicaStates rs)
Mark the given replicas as DOWN
|
static PerReplicaStatesOps |
flipLeader(Set<String> allReplicas,
String next,
PerReplicaStates rs)
Flip the leader replica to a new one
|
static PerReplicaStatesOps |
flipState(String replica,
Replica.State newState,
PerReplicaStates rs)
Change the state of a replica
|
List<PerReplicaStates.Operation> |
get() |
List<PerReplicaStates.Operation> |
get(PerReplicaStates rs) |
PerReplicaStates |
getPerReplicaStates() |
boolean |
isPreOp()
To be executed before collection state.json is persisted
|
static PerReplicaStatesOps |
modifyCollection(DocCollection coll,
boolean enable,
PerReplicaStates rs)
Switch a collection from/to perReplicaState=true
|
void |
persist(String znode,
SolrZkClient zkClient)
This is a persist operation with retry if a write fails due to stale state
|
String |
toString() |
static PerReplicaStatesOps |
touchChildren()
Just creates and deletes a dummy entry so that the
Stat.getCversion() of state.json
is updated |
public void persist(String znode, SolrZkClient zkClient) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public PerReplicaStates getPerReplicaStates()
public static PerReplicaStatesOps flipState(String replica, Replica.State newState, PerReplicaStates rs)
newState
- the new statepublic static PerReplicaStatesOps modifyCollection(DocCollection coll, boolean enable, PerReplicaStates rs)
public static PerReplicaStatesOps flipLeader(Set<String> allReplicas, String next, PerReplicaStates rs)
allReplicas
- allReplicas of the shardnext
- next leaderpublic static PerReplicaStatesOps deleteReplica(String replica, PerReplicaStates rs)
replica
- name of the replica to be deletedpublic static PerReplicaStatesOps addReplica(String replica, Replica.State state, boolean isLeader, PerReplicaStates rs)
public static PerReplicaStatesOps downReplicas(List<String> replicas, PerReplicaStates rs)
public static PerReplicaStatesOps touchChildren()
Stat.getCversion()
of state.json
is updatedpublic List<PerReplicaStates.Operation> get()
public List<PerReplicaStates.Operation> get(PerReplicaStates rs)
public boolean isPreOp()
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.