X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fjmx%2Fmbeans%2Fshardmanager%2FShardManagerInfoMBean.java;h=da0331eb77cfd6383bf6b602933de1dc97d8da18;hp=b64ba747827d3eb6c90d6d6b7ed043cf6986e1e1;hb=a88392383dd0f836de1a8f70cfce85ef5d7fd91f;hpb=c68d251880d95d6d2f8df70c67d2cdd3a3a47685 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/shardmanager/ShardManagerInfoMBean.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/shardmanager/ShardManagerInfoMBean.java index b64ba74782..da0331eb77 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/shardmanager/ShardManagerInfoMBean.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/shardmanager/ShardManagerInfoMBean.java @@ -11,6 +11,38 @@ package org.opendaylight.controller.cluster.datastore.jmx.mbeans.shardmanager; import java.util.List; public interface ShardManagerInfoMBean { + /** + * + * @return a list of all the local shard names + */ List getLocalShards(); + + /** + * + * @return true if all local shards are in sync with their corresponding leaders + */ boolean getSyncStatus(); + + /** + * Switch the Raft Behavior of all the local shards to the newBehavior + * + * @param newBehavior should be either Leader/Follower only + * @param term when switching to the Leader specifies for which term the Shard would be the Leader. Any modifications + * made to state will be written with this term. This term will then be used by the Raft replication + * implementation to decide which modifications should stay and which ones should be removed. Ideally + * the term provided when switching to a new Leader should always be higher than the previous term. + */ + void switchAllLocalShardsState(String newBehavior, long term); + + /** + * Switch the Raft Behavior of the shard specified by shardName to the newBehavior + * + * @param shardName a shard that is local to this shard manager + * @param newBehavior should be either Leader/Follower only + * @param term when switching to the Leader specifies for which term the Shard would be the Leader. Any modifications + * made to state will be written with this term. This term will then be used by the Raft replication + * implementation to decide which modifications should stay and which ones should be removed. Ideally + * the term provided when switching to a new Leader should always be higher than the previous term. + */ + void switchShardState(String shardName, String newBehavior, long term); }