2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.cluster.datastore.jmx.mbeans.shardmanager;
11 import java.util.List;
13 public interface ShardManagerInfoMBean {
16 * @return a list of all the local shard names
18 List<String> getLocalShards();
22 * @return true if all local shards are in sync with their corresponding leaders
24 boolean getSyncStatus();
27 * Switch the Raft Behavior of all the local shards to the newBehavior
29 * @param newBehavior should be either Leader/Follower only
30 * @param term when switching to the Leader specifies for which term the Shard would be the Leader. Any modifications
31 * made to state will be written with this term. This term will then be used by the Raft replication
32 * implementation to decide which modifications should stay and which ones should be removed. Ideally
33 * the term provided when switching to a new Leader should always be higher than the previous term.
35 void switchAllLocalShardsState(String newBehavior, long term);
38 * Switch the Raft Behavior of the shard specified by shardName to the newBehavior
40 * @param shardName a shard that is local to this shard manager
41 * @param newBehavior should be either Leader/Follower only
42 * @param term when switching to the Leader specifies for which term the Shard would be the Leader. Any modifications
43 * made to state will be written with this term. This term will then be used by the Raft replication
44 * implementation to decide which modifications should stay and which ones should be removed. Ideally
45 * the term provided when switching to a new Leader should always be higher than the previous term.
47 void switchShardState(String shardName, String newBehavior, long term);