inhindsight / hindsight

Apache License 2.0
12 stars 8 forks source link

Refactors to view state management #222

Closed jdenen closed 4 years ago

jdenen commented 4 years ago

This is the first PR of many to change how services manage view state.

Currently, we rewrite a LOT of the same boilerplate across services to persist/update/delete view states. And we put all that code in different files. And there's small inconsistencies between them.

Management.ViewState

This PR adds Management.ViewState which mixes in to modules that encapsulate the view state of a single collection. So, one event object type == one Management.ViewState-using collection module.

Gather

This PR includes changes to Gather to use the new view state stuff. This also changes how it handles extract_end and dataset_delete events to work with the new functions.

This PR only includes changes to Gather, since each service can be updated independently.

Postgres

I don't anticipate any real conflicts with #205, but I will be transitioning to Management.ViewState before I merge that PR.