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.voidaddPrefixShardConfiguration(PrefixShardConfiguration config)Adds a new configuration for a shard based on prefix.Map<DOMDataTreeIdentifier,PrefixShardConfiguration>getAllPrefixShardConfigurations()Returns the configuration for all configured prefix shards.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.StringgetShardNameForPrefix(DOMDataTreeIdentifier prefix)Return the shard name corresponding to the prefix, 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.ShardStrategygetStrategyForPrefix(DOMDataTreeIdentifier prefix)Returns the ShardStrategy for the given prefix or null if the prefix 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.voidremovePrefixShardConfiguration(DOMDataTreeIdentifier prefix)Removes a shard configuration for the specified prefix.
-
-
-
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
-
getShardNameForPrefix
public String getShardNameForPrefix(DOMDataTreeIdentifier prefix)
Description copied from interface:ConfigurationReturn the shard name corresponding to the prefix, or null if none is configured.- Specified by:
getShardNameForPrefixin 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
-
addPrefixShardConfiguration
public void addPrefixShardConfiguration(PrefixShardConfiguration config)
Description copied from interface:ConfigurationAdds a new configuration for a shard based on prefix.- Specified by:
addPrefixShardConfigurationin interfaceConfiguration
-
removePrefixShardConfiguration
public void removePrefixShardConfiguration(DOMDataTreeIdentifier prefix)
Description copied from interface:ConfigurationRemoves a shard configuration for the specified prefix.- Specified by:
removePrefixShardConfigurationin interfaceConfiguration
-
getAllPrefixShardConfigurations
public Map<DOMDataTreeIdentifier,PrefixShardConfiguration> getAllPrefixShardConfigurations()
Description copied from interface:ConfigurationReturns the configuration for all configured prefix shards.- Specified by:
getAllPrefixShardConfigurationsin interfaceConfiguration- Returns:
- An immutable copy of the currently configured prefix shards.
-
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
-
getStrategyForPrefix
public ShardStrategy getStrategyForPrefix(DOMDataTreeIdentifier prefix)
Description copied from interface:ConfigurationReturns the ShardStrategy for the given prefix or null if the prefix is not found.- Specified by:
getStrategyForPrefixin interfaceConfiguration
-
-