blob: 14781593c9be8cd98cb7a6aac32b2bc569f9105c [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 /**
Madan Jampani837a3632016-01-21 16:47:26 -080045 * Returns the identifiers of all partitions.
46 *
47 * @return set of partition identifiers
48 */
49 Set<PartitionId> getAllPartitionIds();
Madan Jampani837a3632016-01-21 16:47:26 -080050}