public abstract class BaseHoodieQueueBasedExecutor<I,O,E> extends Object implements HoodieExecutor<E>
I from multiple HoodieProducers
into the HoodieMessageQueueI into an (optional) HoodieConsumer
from the internal HoodieMessageQueue (when no consumer is provided records are
simply accumulated into internal queue)| Modifier and Type | Field and Description |
|---|---|
protected Option<HoodieConsumer<O,E>> |
consumer |
protected HoodieMessageQueue<I,O> |
queue |
| Constructor and Description |
|---|
BaseHoodieQueueBasedExecutor(List<HoodieProducer<I>> producers,
Option<HoodieConsumer<O,E>> consumer,
HoodieMessageQueue<I,O> queue,
Runnable preExecuteRunnable) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination()
Allows to gracefully await the termination of the executor
|
protected abstract void |
doConsume(HoodieMessageQueue<I,O> queue,
HoodieConsumer<O,E> consumer) |
protected void |
doProduce(HoodieMessageQueue<I,O> queue,
HoodieProducer<I> producer) |
E |
execute()
Main API to run both production and consumption.
|
boolean |
isRunning() |
protected void |
setUp() |
void |
shutdownNow()
Shuts executor down immediately, cleaning up any allocated resources
|
CompletableFuture<Void> |
startProducingAsync()
Start producing
|
protected final HoodieMessageQueue<I,O> queue
protected final Option<HoodieConsumer<O,E>> consumer
public BaseHoodieQueueBasedExecutor(List<HoodieProducer<I>> producers, Option<HoodieConsumer<O,E>> consumer, HoodieMessageQueue<I,O> queue, Runnable preExecuteRunnable)
protected void doProduce(HoodieMessageQueue<I,O> queue, HoodieProducer<I> producer)
protected abstract void doConsume(HoodieMessageQueue<I,O> queue, HoodieConsumer<O,E> consumer)
protected void setUp()
public final CompletableFuture<Void> startProducingAsync()
public final boolean awaitTermination()
HoodieExecutorawaitTermination in interface HoodieExecutor<E>public final void shutdownNow()
HoodieExecutorshutdownNow in interface HoodieExecutor<E>public boolean isRunning()
public E execute()
execute in interface HoodieExecutor<E>Copyright © 2024 The Apache Software Foundation. All rights reserved.