/** Ensures that a custom payload is propagated throughout pages. */ @Test(groups = "short") public void should_echo_custom_payload_when_paginating() throws Exception { session().execute("INSERT INTO t1 (c1, c2) VALUES (1, 'a')"); session().execute("INSERT INTO t1 (c1, c2) VALUES (1, 'b')"); Statement statement = new SimpleStatement("SELECT c2 FROM t1 where c1 = 1"); statement.setFetchSize(1); statement.setOutgoingPayload(payload1); ResultSet rows = session().execute(statement); rows.all(); assertThat(rows.getAllExecutionInfo()).extracting("incomingPayload").containsOnly(payload1); }
@Override public List<ExecutionInfo> getAllExecutionInfo() { return _delegate.getAllExecutionInfo(); } }
@Override public List<ExecutionInfo> getAllExecutionInfo() { return _delegate.getAllExecutionInfo(); } }
@Override public List<ExecutionInfo> getAllExecutionInfo() { return this.resultSet.getAllExecutionInfo(); } }
@Override public List<ExecutionInfo> getAllExecutionInfo() { return rs.getAllExecutionInfo(); }
/** * Validates that for each page the {@link ExecutionInfo} will have a different tracing ID. * * @test_category tracing * @expected_result {@link ResultSet} where all the {@link ExecutionInfo} will contains a * different tracing ID and that the events can be retrieved for the last query. */ @Test(groups = "short") public void should_have_a_different_tracingId_for_each_page() { SimpleStatement st = new SimpleStatement(String.format("SELECT v FROM test WHERE k='%s'", KEY)); ResultSet result = session().execute(st.setFetchSize(40).enableTracing()); result.all(); // sleep 10 seconds to make sure the trace will be complete Uninterruptibles.sleepUninterruptibly(10, TimeUnit.SECONDS); List<ExecutionInfo> executions = result.getAllExecutionInfo(); UUID previousTraceId = null; for (ExecutionInfo executionInfo : executions) { QueryTrace queryTrace = executionInfo.getQueryTrace(); assertThat(queryTrace).isNotNull(); assertThat(queryTrace.getTraceId()).isNotEqualTo(previousTraceId); previousTraceId = queryTrace.getTraceId(); } assertThat(result.getExecutionInfo().getQueryTrace().getEvents()).isNotNull().isNotEmpty(); }
@Override public ImmutableList<ExecutionInfo> getAllExecutionInfo() { return ImmutableList.copyOf(rs.getAllExecutionInfo()); }
@Override public ImmutableList<ExecutionInfo> getAllExecutionInfo() { return ImmutableList.copyOf(rs.getAllExecutionInfo()); }
@Override public ImmutableList<ExecutionInfo> getAllExecutionInfo() { return ImmutableList.copyOf(rs.getAllExecutionInfo()); }
@Override public ImmutableList<ExecutionInfo> getAllExecutionInfo() { return ImmutableList.copyOf(rs.getAllExecutionInfo()); }
@Override public ImmutableList<ExecutionInfo> getAllExecutionInfo() { return ImmutableList.copyOf(rs.getAllExecutionInfo()); }
@Override public ImmutableList<ExecutionInfo> getAllExecutionInfo() { return ImmutableList.copyOf(rs.getAllExecutionInfo()); }
WriteResult(ResultSet resultSet) { this.executionInfo = resultSet.getAllExecutionInfo(); this.wasApplied = resultSet.wasApplied(); int limit = resultSet.getAvailableWithoutFetching(); List<Row> rows = new ArrayList<>(limit); for (int count = 0; count < limit; count++) { rows.add(resultSet.one()); } this.rows = Collections.unmodifiableList(rows); }
private void rsetBegin(MappedSchemaObject<?> entity, ResultSet resultSet, String readModify) { StringBuilder execInfo = new StringBuilder(); for (ExecutionInfo executionInfo : resultSet.getAllExecutionInfo()) { if (executionInfo == null) continue;
protected void postStatementExecution(CassandraCqlStatement parsedStmt, ResultSet rs) { if (LOG_LEVEL.compareTo(Level.DEBUG) >= 0 && rs != null) { List<ExecutionInfo> list = rs.getAllExecutionInfo(); int size = list == null ? 0 : list.size(); if (size > 0) { int index = 1; for (ExecutionInfo info : rs.getAllExecutionInfo()) { Logger.debug(getExecutionInfoAsString(info, index, size)); QueryTrace q = info.getQueryTrace(); if (parsedStmt.getConfiguration().tracingEnabled() && q != null) { Logger.debug(getQueryTraceAsString(q, index, size)); } index++; } Logger.debug("Executed successfully with results: {}", !rs.isExhausted()); } } replaceCurrentResultSet(parsedStmt, rs); }
/** Ensures that a custom payload is propagated throughout pages. */ @Test(groups = "short") public void should_echo_custom_payload_when_paginating() throws Exception { session().execute("INSERT INTO t1 (c1, c2) VALUES (1, 'a')"); session().execute("INSERT INTO t1 (c1, c2) VALUES (1, 'b')"); Statement statement = new SimpleStatement("SELECT c2 FROM t1 where c1 = 1"); statement.setFetchSize(1); statement.setOutgoingPayload(payload1); ResultSet rows = session().execute(statement); rows.all(); assertThat(rows.getAllExecutionInfo()).extracting("incomingPayload").containsOnly(payload1); }
/** * Validates that for each page the {@link ExecutionInfo} will have a different tracing ID. * * @test_category tracing * @expected_result {@link ResultSet} where all the {@link ExecutionInfo} will contains a * different tracing ID and that the events can be retrieved for the last query. */ @Test(groups = "short") public void should_have_a_different_tracingId_for_each_page() { SimpleStatement st = new SimpleStatement(String.format("SELECT v FROM test WHERE k='%s'", KEY)); ResultSet result = session().execute(st.setFetchSize(40).enableTracing()); result.all(); // sleep 10 seconds to make sure the trace will be complete Uninterruptibles.sleepUninterruptibly(10, TimeUnit.SECONDS); List<ExecutionInfo> executions = result.getAllExecutionInfo(); UUID previousTraceId = null; for (ExecutionInfo executionInfo : executions) { QueryTrace queryTrace = executionInfo.getQueryTrace(); assertThat(queryTrace).isNotNull(); assertThat(queryTrace.getTraceId()).isNotEqualTo(previousTraceId); previousTraceId = queryTrace.getTraceId(); } assertThat(result.getExecutionInfo().getQueryTrace().getEvents()).isNotNull().isNotEmpty(); }