*/
public class PrimaryShardInfo {
private final ActorSelection primaryShardActor;
+ private final short primaryShardVersion;
private final Optional<DataTree> localShardDataTree;
- public PrimaryShardInfo(@Nonnull ActorSelection primaryShardActor, @Nonnull Optional<DataTree> localShardDataTree) {
+ public PrimaryShardInfo(@Nonnull ActorSelection primaryShardActor, short primaryShardVersion,
+ @Nonnull Optional<DataTree> localShardDataTree) {
this.primaryShardActor = Preconditions.checkNotNull(primaryShardActor);
+ this.primaryShardVersion = primaryShardVersion;
this.localShardDataTree = Preconditions.checkNotNull(localShardDataTree);
}
return primaryShardActor;
}
+ /**
+ * Returns the version of the primary shard.
+ */
+ public short getPrimaryShardVersion() {
+ return primaryShardVersion;
+ }
+
/**
* Returns an Optional whose value contains the primary shard's DataTree if the primary shard is local
* to the caller. Otherwise the Optional value is absent.