blob: 7cabb3d4dbbbee6a7bf683bb9fc2e3002fee1601 [file] [log] [blame]
Madan Jampani25461112015-02-17 14:17:29 -08001/*
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
Madan Jampanif4c88502016-01-21 12:35:36 -080017package org.onosproject.store.primitives.impl;
Madan Jampani94c23532015-02-05 17:40:01 -080018
19/**
20 * Partitioner is responsible for mapping keys to individual database partitions.
21 *
22 * @param <K> key type.
23 */
24public interface Partitioner<K> {
25
26 /**
27 * Returns the database partition.
Madan Jampani7804c992015-07-20 13:20:19 -070028 * @param mapName map name
Madan Jampani94c23532015-02-05 17:40:01 -080029 * @param key key
30 * @return Database partition
31 */
Madan Jampani7804c992015-07-20 13:20:19 -070032 Database getPartition(String mapName, K key);
Madan Jampani94c23532015-02-05 17:40:01 -080033}