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.

Principle:Apache Flink Hybrid Source Initialization

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


Knowledge Sources
Domains Stream_Processing, Source_Architecture
Last Updated 2026-02-09 00:00 GMT

Overview

An initialization mechanism that creates the hybrid sources enumerator and reader wrappers, bootstrapping the first source in the chain via FLIP-27 source framework hooks.

Description

Hybrid Source Initialization creates the coordination infrastructure for source switching. The HybridSourceSplitEnumerator wraps individual source enumerators behind a SplitEnumeratorContextProxy that translates between hybrid-level splits and source-specific splits. The HybridSourceReader starts in an uninitialized state (currentSourceIndex = -1) and waits for a SwitchSourceEvent to activate its first reader.

The enumerator bootstraps by calling switchEnumerator() during start(), which creates the first sources enumerator and begins split discovery.

Usage

This principle is internal to the HybridSource framework. Users trigger it by calling env.fromSource(hybridSource, ...).

Theoretical Basis

// Abstract initialization
function initializeHybridSource():
    enumerator = new HybridSourceSplitEnumerator(sources, startIndex=0)
    reader = new HybridSourceReader(readerContext)  // sourceIndex = -1

    // On enumerator.start():
    enumerator.switchEnumerator()  // activates source[0]
    enumerator.sendSwitchEvent(source[0]) to all readers

    // On reader.handleSourceEvents(SwitchSourceEvent):
    reader.setCurrentReader(0)  // creates source[0]'s reader

Related Pages

Implemented By

Page Connections

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