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 a bunch of 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)state of a replica is changed | 
| 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 states.json
 is updated | 
public void persist(String znode, SolrZkClient zkClient) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic 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 states.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.