Refactors other KV Store functions to address name collision between item operations and set operations
Motivation and Context
The backend infra used by the KV store feature (primarily DynamoDB, but in the future Redis or other similar systems) support more operations than setting and getting records, so this is a starting point for adding more support to that part of the project. Stating the obvious, this makes it possible to store items as a set / unique list in a KV store; this adds another capability to track state (as indexed values). It's worth mentioning that sets are unordered lists containing unique items.
This required a rename of the existing KV store functions:
kv_store_get is now kv_store_item_get
kv_store_set is now kv_store_item_set
The rename isn't breaking, but references in substation.libsonnet were changed from kv_store.get() and kv_store.set() to kv_store.iget() and kv_store.iset(). This gives us more room to add more KV store functions in the future, like:
kv_store_set_delete (delete item from a set)
kv_store_list_add (add an item to an ordered list)
kv_store_item_delete (delete item from store)
kv_store_number_add (add to a number in a store)
kv_store_number_increment (increase a number in a store)
How Has This Been Tested?
Integration tested using the new example.
End to end testing in AWS is in progress.
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
[x] My code follows the code style of this project.
[x] My change requires a change to the documentation.
Description
examples/config/transform/enrich/kvstore_set_add
internal/kv
Motivation and Context
The backend infra used by the KV store feature (primarily DynamoDB, but in the future Redis or other similar systems) support more operations than setting and getting records, so this is a starting point for adding more support to that part of the project. Stating the obvious, this makes it possible to store items as a set / unique list in a KV store; this adds another capability to track state (as indexed values). It's worth mentioning that sets are unordered lists containing unique items.
This required a rename of the existing KV store functions:
kv_store_get
is nowkv_store_item_get
kv_store_set
is nowkv_store_item_set
The rename isn't breaking, but references in
substation.libsonnet
were changed fromkv_store.get()
andkv_store.set()
tokv_store.iget()
andkv_store.iset()
. This gives us more room to add more KV store functions in the future, like:kv_store_set_delete
(delete item from a set)kv_store_list_add
(add an item to an ordered list)kv_store_item_delete
(delete item from store)kv_store_number_add
(add to a number in a store)kv_store_number_increment
(increase a number in a store)How Has This Been Tested?
Types of changes
Checklist: