blob: ebff406417c8e5cf71998d413470545f08c13b28 [file] [log] [blame]
Madan Jampaniec1df022015-10-13 21:23:03 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
Madan Jampaniec1df022015-10-13 21:23:03 -07003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.cluster;
17
18import java.util.Collection;
Madan Jampaniec1df022015-10-13 21:23:03 -070019
Jordan Halterman07f052b2017-10-08 14:22:41 -070020import org.onosproject.core.Version;
21
Madan Jampaniec1df022015-10-13 21:23:03 -070022/**
Madan Jampaniab7e7cd2016-01-14 14:02:32 -080023 * A partition or shard is a group of controller nodes that are work together to maintain state.
24 * A ONOS cluster is typically made of of one or partitions over which the the data is partitioned.
Madan Jampaniec1df022015-10-13 21:23:03 -070025 */
Madan Jampaniab7e7cd2016-01-14 14:02:32 -080026public interface Partition {
Madan Jampaniec1df022015-10-13 21:23:03 -070027
28 /**
Madan Jampaniab7e7cd2016-01-14 14:02:32 -080029 * Returns the partition identifier.
30 * @return partition identifier
Madan Jampaniec1df022015-10-13 21:23:03 -070031 */
Madan Jampaniab7e7cd2016-01-14 14:02:32 -080032 PartitionId getId();
Madan Jampaniec1df022015-10-13 21:23:03 -070033
34 /**
Jordan Halterman07f052b2017-10-08 14:22:41 -070035 * Returns the partition version.
36 *
37 * @return the partition version
38 */
39 Version getVersion();
40
41 /**
Madan Jampaniab7e7cd2016-01-14 14:02:32 -080042 * Returns the controller nodes that are members of this partition.
Madan Jampaniec1df022015-10-13 21:23:03 -070043 * @return collection of controller node identifiers
44 */
Madan Jampaniab7e7cd2016-01-14 14:02:32 -080045 Collection<NodeId> getMembers();
46}