class TrinoEngineConfig
Operator-facing configuration of the ephemeral Trino engine the application scales up to run maintenance. A single row (singleton) drives how the provisioner materialises the engine on the next start: single-node (coordinator also runs tasks) or a coordinator + separate workers, with the CPU/memory of each node, and the Iceberg connector’s retention floors.
Constants
- TOPOLOGIES
Public Class Methods
Source
# File app/models/trino_engine_config.rb, line 27 def self.defaults { topology: "cluster", worker_replicas: 2, coordinator_cpu: "2", coordinator_memory: "2Gi", worker_cpu: "1", worker_memory: "2Gi", expire_snapshots_min_retention: "7d", remove_orphan_files_min_retention: "7d" } end
The defaults used when the row does not exist yet.
@return [Hash] default attributes
Source
# File app/models/trino_engine_config.rb, line 20 def self.instance super(defaults) end
The singleton config row, created with production defaults on first access.
@return [TrinoEngineConfig] the config row
Public Instance Methods
Source
# File app/models/trino_engine_config.rb, line 68 def cluster? topology == "cluster" end
Whether the engine runs as a coordinator with separate workers.
@return [Boolean]
# File app/models/trino_engine_config.rb, line 45 def connector_retention_properties { "iceberg.expire-snapshots.min-retention" => expire_snapshots_min_retention, "iceberg.remove-orphan-files.min-retention" => remove_orphan_files_min_retention }.compact_blank end
The Iceberg connector properties these floors map to, ready to merge into the catalog projection. Keyed by the Trino property name so the projection does not have to know which column feeds which key.
@return [Hash{String => String}] the connector properties
# File app/models/trino_engine_config.rb, line 57 def retention_floor_seconds(operation) value = case operation when "expire_snapshots" then expire_snapshots_min_retention when "remove_orphan_files" then remove_orphan_files_min_retention end value.nil? ? nil : TrinoDuration.to_seconds(value) end
The configured floor, in seconds, for a maintenance operation - or nil when the operation has no floor or the value does not parse as a time duration.
@param operation [String] the maintenance operation @return [Float, nil] the floor in seconds