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 voidaddMemberReplicaForShard(String shardName, MemberName newMemberName)Adds the given member as the new replica for the given shardName.voidaddModuleShardConfiguration(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.StringgetModuleNameFromNameSpace(String nameSpace)Returns the module name for the given namespace name or null if not found.StringgetShardNameForModule(String moduleName)Returns the first shard name corresponding to the given module name or null if none is configured.ShardStrategygetStrategyForModule(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.booleanisShardConfigured(String shardName)voidremoveMemberReplicaForShard(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:ConfigurationReturns all the shard names that belong on the member by the given name.- Specified by:
getMemberShardNamesin interfaceConfiguration
-
getModuleNameFromNameSpace
public String getModuleNameFromNameSpace(String nameSpace)
Description copied from interface:ConfigurationReturns the module name for the given namespace name or null if not found.- Specified by:
getModuleNameFromNameSpacein interfaceConfiguration
-
getStrategyForModule
public ShardStrategy getStrategyForModule(String moduleName)
Description copied from interface:ConfigurationReturns the ShardStrategy for the given module name or null if the module is not found.- Specified by:
getStrategyForModulein interfaceConfiguration
-
getShardNameForModule
public String getShardNameForModule(String moduleName)
Description copied from interface:ConfigurationReturns the first shard name corresponding to the given module name or null if none is configured.- Specified by:
getShardNameForModulein interfaceConfiguration
-
getMembersFromShardName
public Collection<MemberName> getMembersFromShardName(String shardName)
Description copied from interface:ConfigurationReturns the member replicas for the given shard name.- Specified by:
getMembersFromShardNamein interfaceConfiguration
-
getAllShardNames
public Set<String> getAllShardNames()
Description copied from interface:ConfigurationReturns all the configured shard names.- Specified by:
getAllShardNamesin interfaceConfiguration
-
getUniqueMemberNamesForAllShards
public Collection<MemberName> getUniqueMemberNamesForAllShards()
Description copied from interface:ConfigurationReturns a unique set of all member names configured for all shards.- Specified by:
getUniqueMemberNamesForAllShardsin interfaceConfiguration
-
addModuleShardConfiguration
public void addModuleShardConfiguration(ModuleShardConfiguration config)
Description copied from interface:ConfigurationAdds a new configuration for a module and shard.- Specified by:
addModuleShardConfigurationin interfaceConfiguration
-
isShardConfigured
public boolean isShardConfigured(String shardName)
- Specified by:
isShardConfiguredin interfaceConfiguration
-
addMemberReplicaForShard
public void addMemberReplicaForShard(String shardName, MemberName newMemberName)
Description copied from interface:ConfigurationAdds the given member as the new replica for the given shardName.- Specified by:
addMemberReplicaForShardin interfaceConfiguration
-
removeMemberReplicaForShard
public void removeMemberReplicaForShard(String shardName, MemberName newMemberName)
Description copied from interface:ConfigurationRemoves the given member as a replica for the given shardName.- Specified by:
removeMemberReplicaForShardin interfaceConfiguration
-
-