blob: 33bc68f79ec5a02764e31f1b1907d2591411ce41 [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
Jordan Halterman00e92da2018-05-22 23:05:52 -070038 * @deprecated since 1.14
Jordan Halterman07f052b2017-10-08 14:22:41 -070039 */
Jordan Halterman00e92da2018-05-22 23:05:52 -070040 @Deprecated
Jordan Halterman07f052b2017-10-08 14:22:41 -070041 Version getVersion();
42
43 /**
Madan Jampaniab7e7cd2016-01-14 14:02:32 -080044 * Returns the controller nodes that are members of this partition.
Madan Jampaniec1df022015-10-13 21:23:03 -070045 * @return collection of controller node identifiers
46 */
Madan Jampaniab7e7cd2016-01-14 14:02:32 -080047 Collection<NodeId> getMembers();
48}