@Override
public Collection<MemberName> getMembersFromShardName(final String shardName) {
- Preconditions.checkNotNull(shardName, "shardName should not be null");
+ checkNotNullShardName(shardName);
for (ModuleConfig moduleConfig: moduleConfigMap.values()) {
ShardConfig shardConfig = moduleConfig.getShardConfig(shardName);
return Collections.emptyList();
}
+ private static void checkNotNullShardName(final String shardName) {
+ Preconditions.checkNotNull(shardName, "shardName should not be null");
+ }
+
@Override
public Set<String> getAllShardNames() {
return allShardNames;
@Override
public boolean isShardConfigured(String shardName) {
- Preconditions.checkNotNull(shardName, "shardName should not be null");
+ checkNotNullShardName(shardName);
return allShardNames.contains(shardName);
}
@Override
public void addMemberReplicaForShard(String shardName, MemberName newMemberName) {
- Preconditions.checkNotNull(shardName, "shardName should not be null");
+ checkNotNullShardName(shardName);
Preconditions.checkNotNull(newMemberName, "MemberName should not be null");
for (ModuleConfig moduleConfig: moduleConfigMap.values()) {
@Override
public void removeMemberReplicaForShard(String shardName, MemberName newMemberName) {
- Preconditions.checkNotNull(shardName, "shardName should not be null");
+ checkNotNullShardName(shardName);
Preconditions.checkNotNull(newMemberName, "MemberName should not be null");
for (ModuleConfig moduleConfig: moduleConfigMap.values()) {