CommandQueue¶
CommandQueue
is an abstraction of command queues that DistributingExecutor uses to execute statements.
Contract (Subset)¶
Creating Transactional Kafka Producer¶
Producer<CommandId, Command> createTransactionalProducer()
Creates a KafkaProducer
(Apache Kafka)
See CommandStore
Used when:
DistributingExecutor
is requested to execute a statement
ensureConsumedPast¶
void ensureConsumedPast(
long seqNum,
Duration timeout)
See CommandStore
Used when:
CommandStore
is requested to waitForCommandConsumerDefaultCommandQueueSync
is requested towaitFor
CommandStoreUtil
is requested to waitForCommandSequenceNumber
enqueueCommand¶
QueuedCommandStatus enqueueCommand(
CommandId commandId,
Command command,
Producer<CommandId, Command> transactionalProducer)
Sends a command to the command topic (using a transactional KafkaProducer) for execution
See CommandStore
Used when:
DistributingExecutor
is requested to execute a statement
Fetching New Commands¶
List<QueuedCommand> getNewCommands(
Duration timeout)
Fetches QueuedCommand
s (e.g., from a CommandTopic)
See CommandStore
Used when:
CommandRunner
is requested to fetchAndRunCommands
waitForCommandConsumer¶
void waitForCommandConsumer()
See CommandStore
Used when:
DistributingExecutor
is requested to execute a statement