Jonathan Hart | 74c8313 | 2015-02-02 18:37:57 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Open Networking Laboratory |
| 3 | * |
| 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 | */ |
| 16 | package org.onosproject.store.intent.impl; |
| 17 | |
Brian O'Connor | 5eb77c8 | 2015-03-02 18:09:39 -0800 | [diff] [blame^] | 18 | import org.onosproject.cluster.NodeId; |
Jonathan Hart | 5ec32ba | 2015-02-05 13:33:58 -0800 | [diff] [blame] | 19 | import org.onosproject.net.intent.Key; |
| 20 | |
Jonathan Hart | 74c8313 | 2015-02-02 18:37:57 -0800 | [diff] [blame] | 21 | /** |
| 22 | * Service for interacting with the partition-to-instance assignments. |
| 23 | */ |
| 24 | public interface PartitionService { |
| 25 | |
| 26 | /** |
| 27 | * Returns whether the given intent key is in a partition owned by this |
| 28 | * instance or not. |
| 29 | * |
| 30 | * @param intentKey intent key to query |
| 31 | * @return true if the key is owned by this instance, otherwise false |
| 32 | */ |
Jonathan Hart | 5ec32ba | 2015-02-05 13:33:58 -0800 | [diff] [blame] | 33 | boolean isMine(Key intentKey); |
Jonathan Hart | 74c8313 | 2015-02-02 18:37:57 -0800 | [diff] [blame] | 34 | |
Brian O'Connor | 5eb77c8 | 2015-03-02 18:09:39 -0800 | [diff] [blame^] | 35 | /** |
| 36 | * Returns the leader for a particular key. |
| 37 | * |
| 38 | * @param intentKey intent key to query |
| 39 | * @return the leader node |
| 40 | */ |
| 41 | NodeId getLeader(Key intentKey); |
| 42 | |
Jonathan Hart | 74c8313 | 2015-02-02 18:37:57 -0800 | [diff] [blame] | 43 | // TODO add API for rebalancing partitions |
| 44 | } |