Class: ActiveRecord::Materialized::MaintenanceStore Private
- Inherits:
-
Object
- Object
- ActiveRecord::Materialized::MaintenanceStore
- Extended by:
- T::Sig
- Defined in:
- lib/activerecord/materialized/maintenance_store.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Persists a view’s pending maintenance (a delta or a scope) in its metadata row.
Constant Summary collapse
- Pending =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
T.type_alias { T.any(SummaryDelta, MaintenanceDelta) }
Instance Method Summary collapse
- #clear! ⇒ Object private
- #consume_pending_delta! ⇒ Object private
-
#initialize(view_class) ⇒ MaintenanceStore
constructor
private
A new instance of MaintenanceStore.
- #merge!(delta) ⇒ Object private
- #pending ⇒ Object private
- #pending_delta ⇒ Object private
Constructor Details
#initialize(view_class) ⇒ MaintenanceStore
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of MaintenanceStore.
15 16 17 |
# File 'lib/activerecord/materialized/maintenance_store.rb', line 15 def initialize(view_class) @view_class = view_class end |
Instance Method Details
#clear! ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
48 49 50 |
# File 'lib/activerecord/materialized/maintenance_store.rb', line 48 def clear! .clear_maintenance_payload! end |
#consume_pending_delta! ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
41 42 43 44 45 |
# File 'lib/activerecord/materialized/maintenance_store.rb', line 41 def consume_pending_delta! delta = pending_delta || MaintenanceDelta.full_partition clear! delta end |
#merge!(delta) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
25 26 27 |
# File 'lib/activerecord/materialized/maintenance_store.rb', line 25 def merge!(delta) .record_maintenance_payload!(T.unsafe(combine(pending, delta)).serialize) end |
#pending ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
30 31 32 33 |
# File 'lib/activerecord/materialized/maintenance_store.rb', line 30 def pending payload = .maintenance_payload SummaryDelta.deserialize(payload) || MaintenanceDelta.deserialize(payload) end |
#pending_delta ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
36 37 38 |
# File 'lib/activerecord/materialized/maintenance_store.rb', line 36 def pending_delta MaintenanceDelta.deserialize(.maintenance_payload) end |