2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.cluster.sharding;
10 import com.google.common.annotations.Beta;
11 import java.util.Collection;
12 import java.util.concurrent.CompletionStage;
13 import org.opendaylight.controller.cluster.access.concepts.MemberName;
14 import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
15 import org.opendaylight.mdsal.dom.api.DOMDataTreeShardingConflictException;
18 * A factory that handles addition of new clustered shard's based on a prefix. This factory is a QoL class that handles
19 * all the boilerplate that comes with registration of a new clustered shard into the system and creating the backend
20 * shard/replicas that come along with it.
23 @Deprecated(forRemoval = true)
24 public interface DistributedShardFactory {
26 * Register a new shard that is rooted at the desired prefix with replicas on the provided members.
27 * Note to register a shard without replicas you still need to provide at least one Member for the shard.
29 * @param prefix Shard root
30 * @param replicaMembers Members that this shard is replicated on, has to have at least one Member even if the shard
31 * should not be replicated.
32 * @return A future that will be completed with a DistributedShardRegistration once the backend and frontend shards
34 * @throws DOMDataTreeShardingConflictException If the initial check for a conflict on the local node fails, the
35 * sharding configuration won't be updated if this exception is thrown.
37 CompletionStage<DistributedShardRegistration>
38 createDistributedShard(DOMDataTreeIdentifier prefix, Collection<MemberName> replicaMembers)
39 throws DOMDataTreeShardingConflictException;