unknowntpo commented on code in PR #22371:
URL: https://github.com/apache/kafka/pull/22371#discussion_r3389087371
##########
storage/src/test/java/org/apache/kafka/tiered/storage/TieredStorageTestBuilder.java:
##########
@@ -318,6 +322,40 @@ public List<TieredStorageTestAction> complete() {
return actions;
}
+ /**
+ * Builds an executable test plan from the actions described so far.
+ */
+ public TieredStorageTestPlan build() {
+ return new TieredStorageTestPlan(complete());
+ }
+
+ public static final class TieredStorageTestPlan {
+
+ private final List<TieredStorageTestAction> actions;
+
+ private TieredStorageTestPlan(List<TieredStorageTestAction> actions) {
+ this.actions = List.copyOf(actions);
Review Comment:
I think it is still useful here because the plan should capture the actions
at build time. Without `List.copyOf`, the plan would keep a live view of the
builder's mutable action list. I agree later
builder mutation is unlikely in normal test usage, but the copy makes the
snapshot semantics explicit.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]