import javax.annotation.Nullable;
import org.opendaylight.controller.cluster.access.concepts.MemberName;
import org.opendaylight.controller.cluster.datastore.shardstrategy.ShardStrategy;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
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 YangInstanceIdentifier prefix);
+
/**
* Returns the member replicas for the given shard name.
*/
*/
void addModuleShardConfiguration(@Nonnull ModuleShardConfiguration config);
+ /**
+ * Adds a new configuration for a shard based on prefix.
+ */
+ void addPrefixShardConfiguration(@Nonnull PrefixShardConfiguration config);
+
/**
* Returns a unique set of all member names configured for all shards.
*/
* 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 YangInstanceIdentifier prefix);
}