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.shardmanager;
11 import java.util.List;
13 public interface ShardManagerInfoMBean {
15 * Returns the list of all the local shard names.
17 * @return a list of all the local shard names
19 List<String> getLocalShards();
22 * Returns the overall sync status for all shards.
24 * @return true if all local shards are in sync with their corresponding leaders
26 boolean getSyncStatus();
29 * Returns the name of the local member.
31 * @return the local member name
33 String getMemberName();
36 * Switches the raft behavior of all the local shards to the newBehavior.
38 * @param newBehavior should be either Leader/Follower only
39 * @param term when switching to the Leader specifies for which term the Shard would be the Leader. Any
40 * modifications made to state will be written with this term. This term will then be used by the Raft
41 * replication implementation to decide which modifications should stay and which ones should be
42 * removed. Ideally the term provided when switching to a new Leader should always be higher than the
45 void switchAllLocalShardsState(String newBehavior, long term);
48 * Switches the raft behavior of the shard specified by shardName to the newBehavior.
50 * @param shardName a shard that is local to this shard manager
51 * @param newBehavior should be either Leader/Follower only
52 * @param term when switching to the Leader specifies for which term the Shard would be the Leader. Any
53 * modifications made to state will be written with this term. This term will then be used by the Raft
54 * replication implementation to decide which modifications should stay and which ones should be
55 * removed. Ideally the term provided when switching to a new Leader should always be higher than the
58 void switchShardState(String shardName, String newBehavior, long term);