Class: ActiveRecord::Materialized::ReconcileResult
- Inherits:
-
Data
- Object
- Data
- ActiveRecord::Materialized::ReconcileResult
- Defined in:
- lib/activerecord/materialized/reconcile_result.rb
Overview
The outcome of a Reconciler run: which partitions were found divergent and repaired with scoped maintenance, and whether the run was deferred because a refresh was already in flight (in which case nothing was changed — the next scheduled tick reconciles).
Instance Attribute Summary collapse
-
#deferred ⇒ Object
readonly
Returns the value of attribute deferred.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#repaired_keys ⇒ Object
readonly
Returns the value of attribute repaired_keys.
-
#view_name ⇒ Object
readonly
Returns the value of attribute view_name.
Instance Method Summary collapse
- #failed? ⇒ Boolean
-
#initialize(view_name:, mode:, repaired_keys:, deferred: false, error: nil) ⇒ ReconcileResult
constructor
A new instance of ReconcileResult.
-
#repaired? ⇒ Boolean
Repaired real drift this run — divergence was found and applied, not deferred.
- #repaired_partition_count ⇒ Object
Constructor Details
#initialize(view_name:, mode:, repaired_keys:, deferred: false, error: nil) ⇒ ReconcileResult
Returns a new instance of ReconcileResult.
20 |
# File 'lib/activerecord/materialized/reconcile_result.rb', line 20 def initialize(view_name:, mode:, repaired_keys:, deferred: false, error: nil) = super |
Instance Attribute Details
#deferred ⇒ Object (readonly)
Returns the value of attribute deferred
9 10 11 |
# File 'lib/activerecord/materialized/reconcile_result.rb', line 9 def deferred @deferred end |
#error ⇒ Object (readonly)
Returns the value of attribute error
9 10 11 |
# File 'lib/activerecord/materialized/reconcile_result.rb', line 9 def error @error end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode
9 10 11 |
# File 'lib/activerecord/materialized/reconcile_result.rb', line 9 def mode @mode end |
#repaired_keys ⇒ Object (readonly)
Returns the value of attribute repaired_keys
9 10 11 |
# File 'lib/activerecord/materialized/reconcile_result.rb', line 9 def repaired_keys @repaired_keys end |
#view_name ⇒ Object (readonly)
Returns the value of attribute view_name
9 10 11 |
# File 'lib/activerecord/materialized/reconcile_result.rb', line 9 def view_name @view_name end |
Instance Method Details
#failed? ⇒ Boolean
31 32 33 |
# File 'lib/activerecord/materialized/reconcile_result.rb', line 31 def failed? !error.nil? end |
#repaired? ⇒ Boolean
Repaired real drift this run — divergence was found and applied, not deferred.
27 28 29 |
# File 'lib/activerecord/materialized/reconcile_result.rb', line 27 def repaired? repaired_keys.any? && !deferred end |
#repaired_partition_count ⇒ Object
22 23 24 |
# File 'lib/activerecord/materialized/reconcile_result.rb', line 22 def repaired_partition_count repaired_keys.size end |