- final TransactionIdentifier transactionId, final CompositeDataTreeCohort userCohorts) {
- this.dataTree = Preconditions.checkNotNull(dataTree);
- this.transaction = Preconditions.checkNotNull(transaction);
- this.transactionId = Preconditions.checkNotNull(transactionId);
- this.userCohorts = Preconditions.checkNotNull(userCohorts);
+ final TransactionIdentifier transactionId, final CompositeDataTreeCohort userCohorts,
+ final Optional<SortedSet<String>> participatingShardNames) {
+ this.dataTree = requireNonNull(dataTree);
+ this.transaction = requireNonNull(transaction);
+ this.transactionId = requireNonNull(transactionId);
+ this.userCohorts = requireNonNull(userCohorts);
+ this.participatingShardNames = requireNonNull(participatingShardNames).orElse(null);
+ }
+
+ SimpleShardDataTreeCohort(final ShardDataTree dataTree, final DataTreeModification transaction,
+ final TransactionIdentifier transactionId, final Exception nextFailure) {
+ this.dataTree = requireNonNull(dataTree);
+ this.transaction = requireNonNull(transaction);
+ this.transactionId = requireNonNull(transactionId);
+ this.userCohorts = null;
+ this.participatingShardNames = null;
+ this.nextFailure = requireNonNull(nextFailure);