blob: a392e20b205f7d8bb30c730a5f60469b2c105428 [file] [log] [blame]
Madan Jampani837a3632016-01-21 16:47:26 -08001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
Madan Jampani837a3632016-01-21 16:47:26 -08003 *
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.store.primitives;
17
18import java.util.Set;
19
20import org.onosproject.cluster.NodeId;
21import org.onosproject.cluster.PartitionId;
22import org.onosproject.event.ListenerService;
23
24/**
25 * Service used for accessing information about storage partitions.
26 */
27public interface PartitionService extends ListenerService<PartitionEvent, PartitionEventListener> {
28
29 /**
30 * Returns the total number of partitions.
31 *
32 * @return number of partitions
33 */
34 int getNumberOfPartitions();
35
36 /**
37 * Returns the set of controller nodes configured to be members of a partition.
38 *
39 * @param partitionId partition identifier
40 * @return set of node identifiers
41 */
42 Set<NodeId> getConfiguredMembers(PartitionId partitionId);
43
44 /**
45 * Returns the set of controller nodes that are the current active members of a partition.
46 *
47 * @param partitionId partition identifier
48 * @return set of node identifiers
Jordan Halterman00e92da2018-05-22 23:05:52 -070049 * @deprecated since 1.14
Madan Jampani837a3632016-01-21 16:47:26 -080050 */
Jordan Halterman00e92da2018-05-22 23:05:52 -070051 @Deprecated
Madan Jampani837a3632016-01-21 16:47:26 -080052 Set<NodeId> getActiveMembersMembers(PartitionId partitionId);
53
54 /**
55 * Returns the identifiers of all partitions.
56 *
57 * @return set of partition identifiers
58 */
59 Set<PartitionId> getAllPartitionIds();
60
61 /**
62 * Returns a DistributedPrimitiveCreator that can create primitives hosted on a partition.
63 *
64 * @param partitionId partition identifier
65 * @return distributed primitive creator
Jordan Halterman00e92da2018-05-22 23:05:52 -070066 * @deprecated since 1.14
Madan Jampani837a3632016-01-21 16:47:26 -080067 */
Jordan Halterman00e92da2018-05-22 23:05:52 -070068 @Deprecated
Madan Jampani837a3632016-01-21 16:47:26 -080069 DistributedPrimitiveCreator getDistributedPrimitiveCreator(PartitionId partitionId);
70}