Class: ActiveRecord::Materialized::DataVerificationResult
- Inherits:
-
Data
- Object
- Data
- ActiveRecord::Materialized::DataVerificationResult
- Defined in:
- lib/activerecord/materialized/data_verification_result.rb
Overview
The outcome of a DataVerifier run: the partition keys whose materialized contents diverge from the source relation, plus how much was checked.
Instance Attribute Summary collapse
-
#checked_partition_count ⇒ Object
readonly
Returns the value of attribute checked_partition_count.
-
#extra_keys ⇒ Object
readonly
Returns the value of attribute extra_keys.
-
#mismatched_keys ⇒ Object
readonly
Returns the value of attribute mismatched_keys.
-
#missing_keys ⇒ Object
readonly
Returns the value of attribute missing_keys.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#total_partition_count ⇒ Object
readonly
Returns the value of attribute total_partition_count.
-
#view_name ⇒ Object
readonly
Returns the value of attribute view_name.
Class Method Summary collapse
-
.empty(view_name:, mode:) ⇒ Object
A clean result covering nothing — for a view that isn't materialized yet.
Instance Method Summary collapse
-
#divergent_keys ⇒ Object
Every diverging partition key, however it diverged — the set a reconciliation re-maintains (see Reconciler).
- #drifted? ⇒ Boolean
Instance Attribute Details
#checked_partition_count ⇒ Object (readonly)
Returns the value of attribute checked_partition_count
7 8 9 |
# File 'lib/activerecord/materialized/data_verification_result.rb', line 7 def checked_partition_count @checked_partition_count end |
#extra_keys ⇒ Object (readonly)
Returns the value of attribute extra_keys
7 8 9 |
# File 'lib/activerecord/materialized/data_verification_result.rb', line 7 def extra_keys @extra_keys end |
#mismatched_keys ⇒ Object (readonly)
Returns the value of attribute mismatched_keys
7 8 9 |
# File 'lib/activerecord/materialized/data_verification_result.rb', line 7 def mismatched_keys @mismatched_keys end |
#missing_keys ⇒ Object (readonly)
Returns the value of attribute missing_keys
7 8 9 |
# File 'lib/activerecord/materialized/data_verification_result.rb', line 7 def missing_keys @missing_keys end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode
7 8 9 |
# File 'lib/activerecord/materialized/data_verification_result.rb', line 7 def mode @mode end |
#total_partition_count ⇒ Object (readonly)
Returns the value of attribute total_partition_count
7 8 9 |
# File 'lib/activerecord/materialized/data_verification_result.rb', line 7 def total_partition_count @total_partition_count end |
#view_name ⇒ Object (readonly)
Returns the value of attribute view_name
7 8 9 |
# File 'lib/activerecord/materialized/data_verification_result.rb', line 7 def view_name @view_name end |
Class Method Details
.empty(view_name:, mode:) ⇒ Object
A clean result covering nothing — for a view that isn't materialized yet.
23 24 25 26 27 28 |
# File 'lib/activerecord/materialized/data_verification_result.rb', line 23 def self.empty(view_name:, mode:) new( view_name: view_name, mode: mode, total_partition_count: 0, checked_partition_count: 0, missing_keys: [], extra_keys: [], mismatched_keys: [] ) end |
Instance Method Details
#divergent_keys ⇒ Object
Every diverging partition key, however it diverged — the set a reconciliation re-maintains (see Reconciler).
36 37 38 |
# File 'lib/activerecord/materialized/data_verification_result.rb', line 36 def divergent_keys (missing_keys + extra_keys + mismatched_keys).uniq end |
#drifted? ⇒ Boolean
30 31 32 |
# File 'lib/activerecord/materialized/data_verification_result.rb', line 30 def drifted? missing_keys.any? || extra_keys.any? || mismatched_keys.any? end |