dcapwell commented on code in PR #3597:
URL: https://github.com/apache/cassandra/pull/3597#discussion_r1815567765
##########
test/distributed/org/apache/cassandra/fuzz/topology/TopologyMixupTestBase.java:
##########
@@ -464,19 +490,46 @@ public String ipAddress(int nodeNum)
result.asserts().success();
logger.info("CMS reconfigure: {}", result.getStdout());
}
- preActions.add(new Runnable()
- {
+ commandsTransformers.add(new BiFunction<State<S>,
Gen<Command<State<S>, Void, ?>>, Gen<Command<State<S>, Void, ?>>>() {
// in order to remove this action, an anonymous class is
needed so "this" works, lambda "this" is the parent class
@Override
- public void run()
- {
- if (topologyHistory.up().length == TARGET_RF)
- {
+ public Gen<Command<State<S>, Void, ?>> apply(State<S> state,
Gen<Command<State<S>, Void, ?>> commandGen) {
+ if (topologyHistory.up().length < TARGET_RF)
+ return commandGen;
+ SimpleCommand<State<S>> reconfig = new
SimpleCommand<>("nodetool cms reconfigure " + TARGET_RF, ignore -> {
NodeToolResult result =
cluster.get(1).nodetoolResult("cms", "reconfigure",
Integer.toString(TARGET_RF));
result.asserts().success();
logger.info("CMS reconfigure: {}", result.getStdout());
- preActions.remove(this);
- }
+ });
+ SimpleCommand<State<S>> fixDistributedSchemas = new
SimpleCommand<>("Set system distributed keyspaces to RF=" + TARGET_RF, ignore ->
+ fixDistributedSchemas(cluster));
+ SimpleCommand<State<S>> fixTestKeyspace = new
SimpleCommand<>("Set " + KEYSPACE + " keyspace to RF=" + TARGET_RF, s -> {
+ cluster.schemaChange("ALTER KEYSPACE " + KEYSPACE + "
WITH replication = {'class': 'SimpleStrategy', 'replication_factor': " +
TARGET_RF + "}");
+ rf = new
TokenPlacementModel.SimpleReplicationFactor(TARGET_RF);
+ });
+ var self = this;
Review Comment:
Self is smaller ;)
--
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]