frankgh commented on code in PR #2546:
URL: https://github.com/apache/cassandra/pull/2546#discussion_r1294922836
##########
test/distributed/org/apache/cassandra/distributed/impl/AbstractCluster.java:
##########
@@ -199,16 +201,38 @@ public AbstractBuilder(Factory<I, C, B> factory)
withSharedClasses(SHARED_PREDICATE);
}
+ @SuppressWarnings("unchecked")
+ private B self()
+ {
+ return (B) this;
+ }
+
public B withNodeProvisionStrategy(INodeProvisionStrategy.Strategy
nodeProvisionStrategy)
{
this.nodeProvisionStrategy = nodeProvisionStrategy;
- return (B) this;
+ return self();
}
public B withShutdownExecutor(ShutdownExecutor shutdownExecutor)
{
this.shutdownExecutor = shutdownExecutor;
- return (B) this;
+ return self();
+ }
+
+ /**
+ * When {@code dynamicPortAllocation} is {@code true}, it will ask
{@link INodeProvisionStrategy} to provision
+ * available storage, native and JMX ports in the given interface.
When {@code dynamicPortAllocation} is
+ * {@code false} (the default behavior), it will use statically
allocated ports based on the number of
+ * interfaces available and the node number.
+ *
+ * @param dynamicPortAllocation {@code true} for dynamic port
allocation, {@code false} for static port
+ * allocation
+ * @return a reference to this Builder
+ */
+ public B withDynamicPortAllocation(boolean dynamicPortAllocation)
Review Comment:
another option is to provide a new interface `PortAllocationStrategy` and
we'd have default implementations as well as the
`DynamicPortAllocationStrategy`. I didn't go with this approach because I don't
foresee a different port allocation strategy other than the default and dynamic
in the near future.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]