Class ConfigurationImpl
- java.lang.Object
-
- org.opendaylight.controller.cluster.datastore.config.ConfigurationImpl
-
- All Implemented Interfaces:
Configuration
public class ConfigurationImpl extends Object implements Configuration
-
-
Constructor Summary
Constructors Constructor Description ConfigurationImpl(String moduleShardsConfigPath, String modulesConfigPath)
ConfigurationImpl(ModuleShardConfigProvider provider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMemberReplicaForShard(String shardName, MemberName newMemberName)
Adds the given member as the new replica for the given shardName.void
addModuleShardConfiguration(ModuleShardConfiguration config)
Adds a new configuration for a module and shard.Set<String>
getAllShardNames()
Returns all the configured shard names.Collection<MemberName>
getMembersFromShardName(String shardName)
Returns the member replicas for the given shard name.Collection<String>
getMemberShardNames(MemberName memberName)
Returns all the shard names that belong on the member by the given name.String
getModuleNameFromNameSpace(String nameSpace)
Returns the module name for the given namespace name or null if not found.String
getShardNameForModule(String moduleName)
Returns the first shard name corresponding to the given module name or null if none is configured.ShardStrategy
getStrategyForModule(String moduleName)
Returns the ShardStrategy for the given module name or null if the module is not found.Collection<MemberName>
getUniqueMemberNamesForAllShards()
Returns a unique set of all member names configured for all shards.boolean
isShardConfigured(String shardName)
void
removeMemberReplicaForShard(String shardName, MemberName newMemberName)
Removes the given member as a replica for the given shardName.
-
-
-
Constructor Detail
-
ConfigurationImpl
public ConfigurationImpl(String moduleShardsConfigPath, String modulesConfigPath)
-
ConfigurationImpl
public ConfigurationImpl(ModuleShardConfigProvider provider)
-
-
Method Detail
-
getMemberShardNames
public Collection<String> getMemberShardNames(MemberName memberName)
Description copied from interface:Configuration
Returns all the shard names that belong on the member by the given name.- Specified by:
getMemberShardNames
in interfaceConfiguration
-
getModuleNameFromNameSpace
public String getModuleNameFromNameSpace(String nameSpace)
Description copied from interface:Configuration
Returns the module name for the given namespace name or null if not found.- Specified by:
getModuleNameFromNameSpace
in interfaceConfiguration
-
getStrategyForModule
public ShardStrategy getStrategyForModule(String moduleName)
Description copied from interface:Configuration
Returns the ShardStrategy for the given module name or null if the module is not found.- Specified by:
getStrategyForModule
in interfaceConfiguration
-
getShardNameForModule
public String getShardNameForModule(String moduleName)
Description copied from interface:Configuration
Returns the first shard name corresponding to the given module name or null if none is configured.- Specified by:
getShardNameForModule
in interfaceConfiguration
-
getMembersFromShardName
public Collection<MemberName> getMembersFromShardName(String shardName)
Description copied from interface:Configuration
Returns the member replicas for the given shard name.- Specified by:
getMembersFromShardName
in interfaceConfiguration
-
getAllShardNames
public Set<String> getAllShardNames()
Description copied from interface:Configuration
Returns all the configured shard names.- Specified by:
getAllShardNames
in interfaceConfiguration
-
getUniqueMemberNamesForAllShards
public Collection<MemberName> getUniqueMemberNamesForAllShards()
Description copied from interface:Configuration
Returns a unique set of all member names configured for all shards.- Specified by:
getUniqueMemberNamesForAllShards
in interfaceConfiguration
-
addModuleShardConfiguration
public void addModuleShardConfiguration(ModuleShardConfiguration config)
Description copied from interface:Configuration
Adds a new configuration for a module and shard.- Specified by:
addModuleShardConfiguration
in interfaceConfiguration
-
isShardConfigured
public boolean isShardConfigured(String shardName)
- Specified by:
isShardConfigured
in interfaceConfiguration
-
addMemberReplicaForShard
public void addMemberReplicaForShard(String shardName, MemberName newMemberName)
Description copied from interface:Configuration
Adds the given member as the new replica for the given shardName.- Specified by:
addMemberReplicaForShard
in interfaceConfiguration
-
removeMemberReplicaForShard
public void removeMemberReplicaForShard(String shardName, MemberName newMemberName)
Description copied from interface:Configuration
Removes the given member as a replica for the given shardName.- Specified by:
removeMemberReplicaForShard
in interfaceConfiguration
-
-