X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fconfig%2FConfiguration.java;h=d5878c643153bb08b1ce2d881d15481dc0e0b190;hb=2a035cba6169185444e7074952b5a2f5cebb3bb1;hp=dea77f5e34ed0cc46306bd108f5fcc6ed0580c11;hpb=b34452ce75563e360ae1d02a9f2aa6223d6208c3;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/config/Configuration.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/config/Configuration.java index dea77f5e34..d5878c6431 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/config/Configuration.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/config/Configuration.java @@ -9,17 +9,20 @@ package org.opendaylight.controller.cluster.datastore.config; import java.util.Collection; +import java.util.Map; import java.util.Set; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import org.opendaylight.controller.cluster.access.concepts.MemberName; import org.opendaylight.controller.cluster.datastore.shardstrategy.ShardStrategy; +import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier; public interface Configuration { /** * Returns all the shard names that belong on the member by the given name. */ - @Nonnull Collection getMemberShardNames(@Nonnull String memberName); + @Nonnull Collection getMemberShardNames(@Nonnull MemberName memberName); /** * Returns the module name for the given namespace name or null if not found. @@ -31,10 +34,15 @@ public interface Configuration { */ @Nullable String getShardNameForModule(@Nonnull String moduleName); + /** + * Return the shard name corresponding to the prefix, or null if none is configured. + */ + @Nullable String getShardNameForPrefix(@Nonnull DOMDataTreeIdentifier prefix); + /** * Returns the member replicas for the given shard name. */ - @Nonnull Collection getMembersFromShardName(@Nonnull String shardName); + @Nonnull Collection getMembersFromShardName(@Nonnull String shardName); /** * Returns the ShardStrategy for the given module name or null if the module is not found. @@ -51,13 +59,45 @@ public interface Configuration { */ void addModuleShardConfiguration(@Nonnull ModuleShardConfiguration config); + /** + * Adds a new configuration for a shard based on prefix. + */ + void addPrefixShardConfiguration(@Nonnull PrefixShardConfiguration config); + + /** + * Removes a shard configuration for the specified prefix. + */ + void removePrefixShardConfiguration(@Nonnull DOMDataTreeIdentifier prefix); + + /** + * Returns the configuration for all configured prefix shards. + * + * @return An immutable copy of the currently configured prefix shards. + */ + Map getAllPrefixShardConfigurations(); + /** * Returns a unique set of all member names configured for all shards. */ - Collection getUniqueMemberNamesForAllShards(); + Collection getUniqueMemberNamesForAllShards(); /* * Verifies if the given module shard in available in the cluster */ boolean isShardConfigured(String shardName); + + /** + * Adds the given member as the new replica for the given shardName. + */ + void addMemberReplicaForShard(String shardName, MemberName memberName); + + /** + * Removes the given member as a replica for the given shardName. + */ + void removeMemberReplicaForShard(String shardName, MemberName memberName); + + /** + * Returns the ShardStrategy for the given prefix or null if the prefix is not found. + */ + @Nullable ShardStrategy getStrategyForPrefix(@Nonnull DOMDataTreeIdentifier prefix); }