+
+ private static class ShardCreator implements Creator<Shard> {
+
+ private static final long serialVersionUID = 1L;
+
+ final ShardIdentifier name;
+ final Map<ShardIdentifier, String> peerAddresses;
+ final DatastoreContext datastoreContext;
+
+ ShardCreator(ShardIdentifier name, Map<ShardIdentifier, String> peerAddresses,
+ DatastoreContext datastoreContext) {
+ this.name = name;
+ this.peerAddresses = peerAddresses;
+ this.datastoreContext = datastoreContext;
+ }
+
+ @Override
+ public Shard create() throws Exception {
+ return new Shard(name, peerAddresses, datastoreContext);
+ }
+ }