- //format and pattern should be in sync
- private final String format = "%s-shard-%s-%s";
- private static final Pattern pattern = Pattern.compile("(\\S+)-shard-(\\S+)-(\\S+)");
+ ShardIdentifier(final String shardName, final MemberName memberName, final String type) {
+ this.shardName = requireNonNull(shardName, "shardName should not be null");
+ this.memberName = requireNonNull(memberName, "memberName should not be null");
+ this.type = requireNonNull(type, "type should not be null");
+
+ fullName = memberName.getName() + "-shard-" + shardName + "-" + type;
+ }