Class GeneratorDataSourceConnector

java.lang.Object
com.darkcollective.relix.processor.generator.GeneratorDataSourceConnector
All Implemented Interfaces:
DataSourceConnector, AutoCloseable

public final class GeneratorDataSourceConnector extends Object implements DataSourceConnector
A DataSourceConnector that serves generator relations — leaves whose rows are produced by engine code.

For a relation declared as source R from generator { name: "Range", … }, this resolves the relation's GeneratorSourceConfig (from SemanticModel.sources()), looks up the named Generator in the GeneratorRegistry, and returns its lazy Stream<Row>. Argument validation is the generator's responsibility and surfaces here at open time.

  • Constructor Details

    • GeneratorDataSourceConnector

      public GeneratorDataSourceConnector(SemanticModel model, GeneratorRegistry registry)
      Parameters:
      model - the semantic model whose sources declare each generator relation
      registry - the catalogue of built-in generators
  • Method Details

    • open

      public Stream<Row> open(String relationName, Schema schema)
      Description copied from interface: DataSourceConnector
      Opens a stream of rows for the named relation.
      Specified by:
      open in interface DataSourceConnector
      Parameters:
      relationName - the canonical (lower-cased) relation name
      schema - the expected schema; may be used to map source columns to the correct positions and types
      Returns:
      a stream of rows; the caller is responsible for closing it