Elffuss BraidHub

kikocis/java-driver public

Avoid multi query pagination with C* 3.0 and fetchSize = 1.
Changesete732fdbdeb44d707e9b2ca795079a2651c434b466ed295138afd6d05c2b8a7a3
AuthorAlexandre Dutra <alexandre.dutra@datastax.com> · 2015-08-12 21:54 +02:00
Committerolim7t <omichallat+github@gmail.com> · 2015-08-19 19:47 +02:00
Parentsd7f0623b9f4f

Browse the files at this changeset

1 file changed

modified driver-core/src/test/java/com/datastax/driver/core/CustomPayloadTest.java +5 −8
@@ -180,17 +180,14 @@
180180 */
181181 @Test(groups = "short")
182182 public void should_echo_custom_payload_when_paginating() throws Exception {
183- session.execute("INSERT INTO t1 (c1) VALUES (1)");
184- session.execute("INSERT INTO t1 (c1) VALUES (2)");
185- Statement statement = session.newSimpleStatement("SELECT c2 FROM t1 where c1 IN (1,2)");
183+ session.execute("INSERT INTO t1 (c1, c2) VALUES (1, 'a')");
184+ session.execute("INSERT INTO t1 (c1, c2) VALUES (1, 'b')");
185+ Statement statement = session.newSimpleStatement("SELECT c2 FROM t1 where c1 = 1");
186186 statement.setFetchSize(1);
187187 statement.setOutgoingPayload(payload1);
188188 ResultSet rows = session.execute(statement);
189189 rows.all();
190- for (ExecutionInfo info : rows.getAllExecutionInfo()) {
191- Map<String, ByteBuffer> actual = info.getIncomingPayload();
192- assertThat(actual).isEqualTo(payload1);
193- }
190+ assertThat(rows.getAllExecutionInfo()).extracting("incomingPayload").containsOnly(payload1);
194191 }
195192
196193 // TODO retries, spec execs
@@ -298,7 +295,7 @@
298295
299296 @Override
300297 protected Collection<String> getTableDefinitions() {
301- return Collections.singletonList("CREATE TABLE t1 (c1 int PRIMARY KEY, c2 text)");
298+ return Collections.singletonList("CREATE TABLE t1 (c1 int, c2 text, PRIMARY KEY (c1, c2))");
302299 }
303300
304301 }