blob: ade87714e07b23e7a0f182ad41ba0df57d14892b [file] [log] [blame]
Madan Jampaniec1df022015-10-13 21:23:03 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
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
20/**
Madan Jampaniab7e7cd2016-01-14 14:02:32 -080021 * A partition or shard is a group of controller nodes that are work together to maintain state.
22 * 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 -070023 */
Madan Jampaniab7e7cd2016-01-14 14:02:32 -080024public interface Partition {
Madan Jampaniec1df022015-10-13 21:23:03 -070025
26 /**
Madan Jampaniab7e7cd2016-01-14 14:02:32 -080027 * Returns the partition identifier.
28 * @return partition identifier
Madan Jampaniec1df022015-10-13 21:23:03 -070029 */
Madan Jampaniab7e7cd2016-01-14 14:02:32 -080030 PartitionId getId();
Madan Jampaniec1df022015-10-13 21:23:03 -070031
32 /**
Madan Jampaniab7e7cd2016-01-14 14:02:32 -080033 * Returns the controller nodes that are members of this partition.
Madan Jampaniec1df022015-10-13 21:23:03 -070034 * @return collection of controller node identifiers
35 */
Madan Jampaniab7e7cd2016-01-14 14:02:32 -080036 Collection<NodeId> getMembers();
37}