Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Risingwavelabs Risingwave CdcEngineRunner Interface

From Leeroopedia
Revision as of 16:30, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Risingwavelabs_Risingwave_CdcEngineRunner_Interface.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Metadata

Property Value
File java/connector-node/connector-api/src/main/java/com/risingwave/connector/api/source/CdcEngineRunner.java
Language Java
Module connector-api
Package com.risingwave.connector.api.source
Classes CdcEngineRunner (interface)
Lines 27

Overview

CdcEngineRunner is an interface that defines the lifecycle management contract for a CDC engine. It separates the concerns of engine execution management from the engine implementation itself, providing methods to start, stop, and query the running state of a CdcEngine, as well as to retrieve the underlying engine instance.

Implementations of this interface are responsible for managing the thread or execution context in which the CdcEngine runs, handling startup/shutdown sequencing, and monitoring the engine's health.

Code Reference

Source Location

java/connector-node/connector-api/src/main/java/com/risingwave/connector/api/source/CdcEngineRunner.java

Signature

public interface CdcEngineRunner {
    boolean start() throws Exception;

    void stop() throws Exception;

    CdcEngine getEngine();

    boolean isRunning();
}

Imports

No external imports beyond the package-local CdcEngine reference.

I/O Contract

start

Direction Type Description
Output boolean Returns true if the engine was started successfully, false otherwise

May throw Exception if an error occurs during startup. Implementations typically submit the CdcEngine (which is a Runnable) to an executor service.

stop

Direction Type Description
Output None Stops the running CDC engine and releases associated resources

May throw Exception if an error occurs during shutdown.

getEngine

Direction Type Description
Output CdcEngine The underlying CDC engine managed by this runner

Provides access to the engine instance, allowing callers to retrieve the output channel or engine ID.

isRunning

Direction Type Description
Output boolean true if the engine is currently running, false otherwise

Usage Examples

// Create and start a CDC engine runner
CdcEngineRunner runner = createRunner(sourceConfig);

try {
    boolean started = runner.start();
    if (!started) {
        throw new RuntimeException("Failed to start CDC engine");
    }

    // Access the underlying engine for its output channel
    CdcEngine engine = runner.getEngine();
    BlockingQueue<ConnectorServiceProto.GetEventStreamResponse> output =
            engine.getOutputChannel();

    // Monitor engine status
    while (runner.isRunning()) {
        ConnectorServiceProto.GetEventStreamResponse event = output.poll(1, TimeUnit.SECONDS);
        if (event != null) {
            responseObserver.onNext(event);
        }
    }
} finally {
    runner.stop();
}

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment