class FakeTrinoProvisioner
In-memory provisioner for development and tests. Immediately “exists” and healthy after create!, and always idle, so the whole engine state machine runs without a cluster.
Public Class Methods
Source
# File app/services/fake_trino_provisioner.rb, line 6 def initialize @exists = false @healthy = false end
Starts with the engine absent and unhealthy.
Public Instance Methods
Source
# File app/services/fake_trino_provisioner.rb, line 44 def active_queries = []
No queries on the fake engine.
@return [Array] always empty
Source
# File app/services/fake_trino_provisioner.rb, line 55 def cancel_query(query_id) = true
Cancelling on the fake engine is always a no-op success.
@param query_id [String] ignored @return [Boolean] always true
Source
# File app/services/fake_trino_provisioner.rb, line 58 def create! @exists = true @healthy = true end
Marks the fake engine as existing and healthy.
Source
# File app/services/fake_trino_provisioner.rb, line 64 def destroy! @exists = false @healthy = false end
Marks the fake engine as gone and unhealthy.
Source
# File app/services/fake_trino_provisioner.rb, line 14 def exists? = @exists
Whether the fake engine “exists”.
@return [Boolean] true after create! has been called
Source
# File app/services/fake_trino_provisioner.rb, line 19 def healthy? = @healthy
Whether the fake engine is “healthy”.
@return [Boolean] true after create! has been called
Source
# File app/services/fake_trino_provisioner.rb, line 39 def idle? = true
The fake engine is always idle.
@return [Boolean] always true
Source
# File app/services/fake_trino_provisioner.rb, line 29 def replicas = @exists ? 1 : 0
Desired replicas of the fake engine.
@return [Integer] 1 after create!, 0 after destroy!
Source
# File app/services/fake_trino_provisioner.rb, line 24 def rollout_complete? = @exists
Whether the fake rollout is complete.
@return [Boolean] true once the engine exists
Source
# File app/services/fake_trino_provisioner.rb, line 49 def safe_active_queries = []
Best-effort alias for the display path — same empty list on the fake.
@return [Array] always empty
Source
# File app/services/fake_trino_provisioner.rb, line 34 def target = "fake/trino"
The addressed “Deployment” of the fake engine.
@return [String] a stand-in namespace-qualified name
Source
# File app/services/fake_trino_provisioner.rb, line 72 def wait_gone!(timeout:) end
No-op: the fake engine disappears instantly.
@param timeout [ActiveSupport::Duration] ignored