@@ -0,0 +1,2283 @@
+package org.radargun.stages.monitor;%0A%0Aimport org.radargun.DistStageAck;%0Aimport org.radargun.config.Property;%0Aimport org.radargun.config.Stage;%0Aimport org.radargun.stages.AbstractDistStage;%0Aimport org.radargun.traits.Clustered;%0Aimport org.radargun.traits.InjectTrait;%0A%0A/**%0A * This stage needs to be defined twice:%0A *%0A *     %3Ccluster-split-verify /%3E%0A *     ... other stages ...%0A *     %3Ccluster-split-verify verify=%22true%22 /%3E%0A *%0A * First run will record the cluster size, and the second will verify that that the size didn't change%0A * during the time.%0A */%0A@Stage(doc = %22Verifies that there weren't any changes to the cluster size during testing.%22)%0Apublic class ClusterSplitVerifyStage extends AbstractDistStage %7B%0A%0A   public static final String CLUSTER_SIZE_AT_START = %22CLUSTER_SIZE_AT_START%22;%0A   public static final String MEMBERSHIP_HISTORY_SIZE_AT_START = %22MEMBERSHIP_HISTORY_SIZE_AT_START%22;%0A%0A   @Property(doc = %22Set to true in 2nd definition of the stage in benchmark to verify that no splits occurred. Default is false.%22)%0A   private boolean verify = false;%0A%0A   @InjectTrait%0A   private Clustered clustered;%0A%0A   @Override%0A   public DistStageAck executeOnSlave() %7B%0A      if (!verify) %7B%0A         int clusterSizeAtTestStart = clustered.getMembers().size();%0A         int membershipHistorySizeAtStart = clustered.getMembershipHistory().size();%0A         slaveState.put(CLUSTER_SIZE_AT_START, clusterSizeAtTestStart);%0A         slaveState.put(MEMBERSHIP_HISTORY_SIZE_AT_START, membershipHistorySizeAtStart);%0A      %7D else %7B%0A         int clusterSizeAtTestStart = (int) slaveState.get(CLUSTER_SIZE_AT_START);%0A         int membershipHistorySizeAtStart = (int) slaveState.get(MEMBERSHIP_HISTORY_SIZE_AT_START);%0A         for (int i = membershipHistorySizeAtStart; i %3C clustered.getMembershipHistory().size(); i++) %7B%0A            int clusterSizeDuringTest = clustered.getMembershipHistory().get(i).members.size();%0A            if (clusterSizeDuringTest != clusterSizeAtTestStart) %7B%0A               return errorResponse(%22Cluster size at the beginning of the test was %22 + clusterSizeAtTestStart + %22 but changed to %22 + clusterSizeDuringTest +%0A                  %22 during the test! Perhaps a split occured, or a new node joined?%22);%0A            %7D%0A         %7D%0A      %7D%0A      return successfulResponse();%0A   %7D%0A%0A%7D%0A

Add a stage that verifies that cluster size haven't changed during testing