Skip to content

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:

ensureConsumedPast

void ensureConsumedPast(
  long seqNum,
  Duration timeout)

See CommandStore

Used when:

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:

Fetching New Commands

List<QueuedCommand> getNewCommands(
  Duration timeout)

Fetches QueuedCommands (e.g., from a CommandTopic)

See CommandStore

Used when:

waitForCommandConsumer

void waitForCommandConsumer()

See CommandStore

Used when:

Implementations