mirror of https://github.com/apache/cassandra
Add support for skip read validation flag for cassandra-stress
patch by Noam Hasson; reviewed by jasobrown for CASSANDRA-13772
This commit is contained in:
parent
8d98a99231
commit
6b7d73a496
|
|
@ -196,11 +196,14 @@ public abstract class CqlOperation<V> extends PredefinedOperation
|
|||
|
||||
public boolean validate(ByteBuffer[][] result)
|
||||
{
|
||||
if (result.length != expect.size())
|
||||
return false;
|
||||
for (int i = 0 ; i < result.length ; i++)
|
||||
if (expect.get(i) != null && !expect.get(i).equals(Arrays.asList(result[i])))
|
||||
if (!settings.errors.skipReadValidation)
|
||||
{
|
||||
if (result.length != expect.size())
|
||||
return false;
|
||||
for (int i = 0; i < result.length; i++)
|
||||
if (expect.get(i) != null && !expect.get(i).equals(Arrays.asList(result[i])))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,11 +33,13 @@ public class SettingsErrors implements Serializable
|
|||
|
||||
public final boolean ignore;
|
||||
public final int tries;
|
||||
public final boolean skipReadValidation;
|
||||
|
||||
public SettingsErrors(Options options)
|
||||
{
|
||||
ignore = options.ignore.setByUser();
|
||||
this.tries = Math.max(1, Integer.parseInt(options.retries.value()) + 1);
|
||||
skipReadValidation = options.skipReadValidation.setByUser();
|
||||
}
|
||||
|
||||
// Option Declarations
|
||||
|
|
@ -46,11 +48,11 @@ public class SettingsErrors implements Serializable
|
|||
{
|
||||
final OptionSimple retries = new OptionSimple("retries=", "[0-9]+", "9", "Number of tries to perform for each operation before failing", false);
|
||||
final OptionSimple ignore = new OptionSimple("ignore", "", null, "Do not fail on errors", false);
|
||||
|
||||
final OptionSimple skipReadValidation = new OptionSimple("skip-read-validation", "", null, "Skip read validation and message output", false);
|
||||
@Override
|
||||
public List<? extends Option> options()
|
||||
{
|
||||
return Arrays.asList(retries, ignore);
|
||||
return Arrays.asList(retries, ignore, skipReadValidation);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue