void doInitialQueries() { executor.executeAsync(); }
SinglePartitionReadLifecycle(SinglePartitionReadCommand command, ConsistencyLevel consistency, long queryStartNanoTime) { this.command = command; this.executor = AbstractReadExecutor.getReadExecutor(command, consistency, queryStartNanoTime); this.consistency = consistency; this.queryStartNanoTime = queryStartNanoTime; }
protected void makeDataRequests(Iterable<InetAddress> endpoints) { makeRequests(command, endpoints); }
assert !command.isDigestQuery(); AbstractReadExecutor exec = AbstractReadExecutor.getReadExecutor(command, consistencyLevel); exec.executeAsync(); readExecutors[i] = exec; exec.maybeTryAdditionalReplicas(); Row row = exec.get(); if (row != null) ReadCallback<ReadResponse, Row> repairHandler = new ReadCallback<>(resolver, ConsistencyLevel.ALL, exec.getContactedReplicas().size(), exec.command, Keyspace.open(exec.command.getKeyspace()), for (InetAddress endpoint : exec.getContactedReplicas())
void awaitResultsAndRetryOnDigestMismatch() throws ReadFailureException, ReadTimeoutException { try { result = executor.get(); } catch (DigestMismatchException ex) { Tracing.trace("Digest mismatch: {}", ex); ReadRepairMetrics.repairedBlocking.mark(); // Do a full data read to resolve the correct response (and repair node that need be) Keyspace keyspace = Keyspace.open(command.metadata().ksName); DataResolver resolver = new DataResolver(keyspace, command, ConsistencyLevel.ALL, executor.handler.endpoints.size(), queryStartNanoTime); repairHandler = new ReadCallback(resolver, ConsistencyLevel.ALL, executor.getContactedReplicas().size(), command, keyspace, executor.handler.endpoints, queryStartNanoTime); for (InetAddress endpoint : executor.getContactedReplicas()) { MessageOut<ReadCommand> message = command.createMessage(MessagingService.instance().getVersion(endpoint)); Tracing.trace("Enqueuing full data read to {}", endpoint); MessagingService.instance().sendRRWithFailure(message, endpoint, repairHandler); } } }
void maybeTryAdditionalReplicas() { executor.maybeTryAdditionalReplicas(); }
private void makeRequests(ReadCommand readCommand, Iterable<InetAddress> endpoints) { MessageOut<ReadCommand> message = null; boolean hasLocalEndpoint = false; for (InetAddress endpoint : endpoints) { if (isLocalRequest(endpoint)) { hasLocalEndpoint = true; continue; } if (traceState != null) traceState.trace("reading {} from {}", readCommand.isDigestQuery() ? "digest" : "data", endpoint); logger.trace("reading {} from {}", readCommand.isDigestQuery() ? "digest" : "data", endpoint); if (message == null) message = readCommand.createMessage(); MessagingService.instance().sendRR(message, endpoint, handler); } // We delay the local (potentially blocking) read till the end to avoid stalling remote requests. if (hasLocalEndpoint) { logger.trace("reading {} locally", readCommand.isDigestQuery() ? "digest" : "data"); StageManager.getStage(Stage.READ).maybeExecuteImmediately(new LocalReadRunnable(command, handler)); } }
void awaitResultsAndRetryOnDigestMismatch() throws ReadFailureException, ReadTimeoutException { try { result = executor.get(); } catch (DigestMismatchException ex) { Tracing.trace("Digest mismatch: {}", ex); ReadRepairMetrics.repairedBlocking.mark(); // Do a full data read to resolve the correct response (and repair node that need be) Keyspace keyspace = Keyspace.open(command.metadata().ksName); DataResolver resolver = new DataResolver(keyspace, command, ConsistencyLevel.ALL, executor.handler.endpoints.size(), queryStartNanoTime); repairHandler = new ReadCallback(resolver, ConsistencyLevel.ALL, executor.getContactedReplicas().size(), command, keyspace, executor.handler.endpoints, queryStartNanoTime); for (InetAddress endpoint : executor.getContactedReplicas()) { MessageOut<ReadCommand> message = command.createMessage(MessagingService.instance().getVersion(endpoint)); Tracing.trace("Enqueuing full data read to {}", endpoint); MessagingService.instance().sendRRWithFailure(message, endpoint, repairHandler); } } }
void maybeTryAdditionalReplicas() { executor.maybeTryAdditionalReplicas(); }
void awaitResultsAndRetryOnDigestMismatch() throws ReadFailureException, ReadTimeoutException { try { result = executor.get(); } catch (DigestMismatchException ex) { Tracing.trace("Digest mismatch: {}", ex); ReadRepairMetrics.repairedBlocking.mark(); // Do a full data read to resolve the correct response (and repair node that need be) Keyspace keyspace = Keyspace.open(command.metadata().ksName); DataResolver resolver = new DataResolver(keyspace, command, ConsistencyLevel.ALL, executor.handler.endpoints.size(), queryStartNanoTime); repairHandler = new ReadCallback(resolver, ConsistencyLevel.ALL, executor.getContactedReplicas().size(), command, keyspace, executor.handler.endpoints, queryStartNanoTime); for (InetAddress endpoint : executor.getContactedReplicas()) { MessageOut<ReadCommand> message = command.createMessage(MessagingService.instance().getVersion(endpoint)); Tracing.trace("Enqueuing full data read to {}", endpoint); MessagingService.instance().sendRRWithFailure(message, endpoint, repairHandler); } } }
protected void makeDataRequests(Iterable<InetAddress> endpoints) { makeRequests(command, endpoints); }
SinglePartitionReadLifecycle(SinglePartitionReadCommand command, ConsistencyLevel consistency, long queryStartNanoTime) { this.command = command; this.executor = AbstractReadExecutor.getReadExecutor(command, consistency, queryStartNanoTime); this.consistency = consistency; this.queryStartNanoTime = queryStartNanoTime; }
void doInitialQueries() { executor.executeAsync(); }
void maybeTryAdditionalReplicas() { executor.maybeTryAdditionalReplicas(); }
protected void makeDataRequests(Iterable<InetAddress> endpoints) { makeRequests(command, endpoints); }
SinglePartitionReadLifecycle(SinglePartitionReadCommand command, ConsistencyLevel consistency, long queryStartNanoTime) { this.command = command; this.executor = AbstractReadExecutor.getReadExecutor(command, consistency, queryStartNanoTime); this.consistency = consistency; this.queryStartNanoTime = queryStartNanoTime; }
void doInitialQueries() { executor.executeAsync(); }
protected void makeDataRequests(Iterable<InetAddress> endpoints) { makeRequests(command, endpoints); }
protected void makeDigestRequests(Iterable<InetAddress> endpoints) { makeRequests(command.copyAsDigestQuery(), endpoints); }
protected void makeDigestRequests(Iterable<InetAddress> endpoints) { makeRequests(command.copyAsDigestQuery(), endpoints); }