Class StreamManager

java.lang.Object
dev.frostlake.stream.StreamManager

public class StreamManager extends Object
Manages streams and tracks changes to tables
  • Constructor Details

    • StreamManager

      public StreamManager(Catalog catalog)
  • Method Details

    • trackInsert

      public void trackInsert(String qualifiedTableName, Row row)
      Track an INSERT operation
    • capturingStreams

      public List<Stream> capturingStreams(String qualifiedTableName)
      The streams capturing qualifiedTableName, resolved ONCE for a bulk apply — commit used to re-walk every schema's streams per committed ROW. An empty answer lets the caller skip old-image copies and record construction entirely.
    • trackInsert

      public void trackInsert(List<Stream> capturing, String qualifiedTableName, Row row)
      trackInsert(String, Row) over a PRE-RESOLVED capture list (bulk commit apply).
    • trackUpdate

      public void trackUpdate(List<Stream> capturing, String qualifiedTableName, Row oldRow, Row newRow)
      trackUpdate(String, Row, Row) over a PRE-RESOLVED capture list (bulk commit apply).
    • trackDelete

      public void trackDelete(List<Stream> capturing, String qualifiedTableName, Row row)
      trackDelete(String, Row) over a PRE-RESOLVED capture list (bulk commit apply).
    • trackUpdate

      public void trackUpdate(String qualifiedTableName, Row oldRow, Row newRow)
      Track an UPDATE operation
    • trackDelete

      public void trackDelete(String qualifiedTableName, Row row)
      Track a DELETE operation
    • seedInitialRows

      public void seedInitialRows(Stream stream, String qualifiedTableName, List<Row> rows)
      Seed a freshly created SHOW_INITIAL_ROWS stream with the source table's existing rows as INSERT records, so the stream's first read returns the current table contents (Snowflake semantics). Subsequent reads after consumption then return only new changes as usual.
    • onTableDropped

      public void onTableDropped(String qualifiedTableName)
      Forget a table's change-tracking row-id counter when the table is dropped, so rowIdCounters does not grow without bound as tables are created and dropped over the engine's lifetime. Keyed by the fully-qualified name, normalized to upper case to match the write path (getNextRowId(java.lang.String)).
    • onSchemaDropped

      public void onSchemaDropped(String databaseName, String schemaName)
      Forget the counters of every table in a dropped schema (DROP SCHEMA cascades to its tables).
    • onDatabaseDropped

      public void onDatabaseDropped(String databaseName)
      Forget the counters of every table in a dropped database (DROP DATABASE cascades).