kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 3b9d21af8dc8b8e191052fa49732181a56b63da60b5ed909660946f2ba4bdad1 |
|---|---|
| Author | Andrew Tolbert <andrew.tolbert@datastax.com> · 2016-07-18 12:07 -05:00 |
| Committer | Andrew Tolbert <andrew.tolbert@datastax.com> · 2016-10-04 14:26 -05:00 |
| Parents | f9f8a2691c42 |
1 file changed
modified driver-core/src/test/java/com/datastax/driver/core/WarningsTest.java +8 −7
| @@ -25,11 +25,6 @@ | ||
| 25 | 25 | |
| 26 | 26 | public class WarningsTest extends CCMTestsSupport { |
| 27 | 27 | |
| 28 | - /** | |
| 29 | - * This is Cassandra's default value, found in o.a.c.config.Config | |
| 30 | - */ | |
| 31 | - private static final int BATCH_SIZE_WARN_THRESHOLD_IN_BYTES = 5 * 1024; | |
| 32 | - | |
| 33 | 28 | @Override |
| 34 | 29 | public void onTestContextInitialized() { |
| 35 | 30 | execute("CREATE TABLE foo(k int primary key, v text)"); |
| @@ -38,8 +33,14 @@ | ||
| 38 | 33 | @CassandraVersion(major = 2.2) |
| 39 | 34 | @Test(groups = "short") |
| 40 | 35 | public void should_expose_warnings_on_execution_info() { |
| 41 | - ResultSet rs = session().execute(String.format("BEGIN UNLOGGED BATCH INSERT INTO foo (k, v) VALUES (1, '%s') APPLY BATCH", | |
| 42 | - Strings.repeat("1", BATCH_SIZE_WARN_THRESHOLD_IN_BYTES))); | |
| 36 | + // the default batch size warn threshold is 5 * 1024 bytes, but after CASSANDRA-10876 there must be | |
| 37 | + // multiple mutations in a batch to trigger this warning so the batch includes 2 different inserts. | |
| 38 | + ResultSet rs = session().execute(String.format("BEGIN UNLOGGED BATCH\n" + | |
| 39 | + "INSERT INTO foo (k, v) VALUES (1, '%s')\n" + | |
| 40 | + "INSERT INTO foo (k, v) VALUES (2, '%s')\n" + | |
| 41 | + "APPLY BATCH", | |
| 42 | + Strings.repeat("1", 2 * 1024), | |
| 43 | + Strings.repeat("1", 3 * 1024))); | |
| 43 | 44 | |
| 44 | 45 | List<String> warnings = rs.getExecutionInfo().getWarnings(); |
| 45 | 46 | assertThat(warnings).hasSize(1); |