X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fmessages%2FCreateShard.java;h=6b4fd7c204a194d1c2edf7f80ede8557e16a6eb7;hb=8ec73bf853a9b6708b455c0321a585992e02b125;hp=11f3f13ec41f3e17b44ef26a16e60bb22fa6e950;hpb=635b5b19764c8c99267f35690ca68b02cf1aea3a;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CreateShard.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CreateShard.java index 11f3f13ec4..6b4fd7c204 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CreateShard.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CreateShard.java @@ -8,11 +8,11 @@ package org.opendaylight.controller.cluster.datastore.messages; import com.google.common.base.Preconditions; -import java.util.Collection; import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opendaylight.controller.cluster.datastore.DatastoreContext; -import org.opendaylight.controller.cluster.datastore.ShardPropsCreator; +import org.opendaylight.controller.cluster.datastore.Shard; +import org.opendaylight.controller.cluster.datastore.config.ModuleShardConfiguration; /** * A message sent to the ShardManager to dynamically create a new shard. @@ -20,48 +20,41 @@ import org.opendaylight.controller.cluster.datastore.ShardPropsCreator; * @author Thomas Pantelis */ public class CreateShard { - private final String shardName; - private final Collection memberNames; - private final ShardPropsCreator shardPropsCreator; + private final ModuleShardConfiguration moduleShardConfig; + private final Shard.AbstractBuilder shardBuilder; private final DatastoreContext datastoreContext; /** * Constructor. * - * @param shardName the name of the new shard. - * @param memberNames the names of all the member replicas. + * @param moduleShardConfig the configuration of the new shard. * @param shardPropsCreator used to obtain the Props for creating the shard actor instance. * @param datastoreContext the DatastoreContext for the new shard. If null, the default is used. */ - public CreateShard(@Nonnull String shardName, @Nonnull Collection memberNames, - @Nonnull ShardPropsCreator shardPropsCreator, @Nullable DatastoreContext datastoreContext) { - this.shardName = Preconditions.checkNotNull(shardName); - this.memberNames = Preconditions.checkNotNull(memberNames); - this.shardPropsCreator = Preconditions.checkNotNull(shardPropsCreator); + public CreateShard(@Nonnull ModuleShardConfiguration moduleShardConfig, + @Nonnull Shard.AbstractBuilder shardBuilder, @Nullable DatastoreContext datastoreContext) { + this.moduleShardConfig = Preconditions.checkNotNull(moduleShardConfig); + this.shardBuilder = Preconditions.checkNotNull(shardBuilder); this.datastoreContext = datastoreContext; } - @Nonnull public String getShardName() { - return shardName; + @Nonnull + public ModuleShardConfiguration getModuleShardConfig() { + return moduleShardConfig; } - @Nonnull public Collection getMemberNames() { - return memberNames; + @Nonnull + public Shard.AbstractBuilder getShardBuilder() { + return shardBuilder; } - @Nonnull public ShardPropsCreator getShardPropsCreator() { - return shardPropsCreator; - } - - @Nullable public DatastoreContext getDatastoreContext() { + @Nullable + public DatastoreContext getDatastoreContext() { return datastoreContext; } @Override public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("CreateShard [shardName=").append(shardName).append(", memberNames=").append(memberNames) - .append("]"); - return builder.toString(); + return "CreateShard [moduleShardConfig=" + moduleShardConfig + ", shardPropsCreator=" + shardBuilder + "]"; } }