class TrinoEngineConfigsController
Manages the singleton engine configuration: how the ephemeral Trino engine is materialised on the next start (single-node vs coordinator + workers) and the CPU/memory of each node. Each action authorizes with Pundit.
Public Instance Methods
Source
# File app/controllers/trino_engine_configs_controller.rb, line 6 def show authorize TrinoEngineConfig @config = TrinoEngineConfig.instance end
Shows the engine configuration form.
Source
# File app/controllers/trino_engine_configs_controller.rb, line 14 def update authorize TrinoEngineConfig @config = TrinoEngineConfig.instance was_up = TrinoEngineState.first&.status == "up" if @config.update(config_params) apply_to_running_cluster! if was_up key = was_up ? "trino_engine_config.notices.updated_and_applied" : "trino_engine_config.notices.updated" redirect_to trino_engine_config_path, notice: t(key) else render :show, status: :unprocessable_content end end
Updates the engine configuration and redirects back, or re-renders on error. When the engine is currently running, the new settings are applied to the live cluster immediately (worker replicas, node resources, coordinator env).