Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Add .PutKVPairs() method to KVStore interface #1274

Merged
merged 4 commits into from
Nov 24, 2020

Conversation

timvaillancourt
Copy link
Contributor

@timvaillancourt timvaillancourt commented Nov 23, 2020

Related issue: #1273

Description

This PR adds the .PutKVPairs() function to the KVStore interface (from go/kv/kv.go) to allow decisions around updating multiple KVs to be pushed down to the various KV store implementations. This new method replaces the single-KVPair method .PutKVPair() from go/kv/kv.go

The following files were updated to use .PutKVPairs() vs single-KVPair updates:

  1. go/logic/command_applier.go
  2. go/logic/orchestrator.go
  3. go/logic/topology_recovery.go

For now the .PutKVPairs() function in each KVStore is just doing a plain-loop over .PutKeyValue(). In the near-future this method will be used to implement atomic multi-KVPair updates for the Consul KV store (#1273) and potentially the Internal/ZooKeeper store, too

cc @shlomi-noach

Copy link
Collaborator

@shlomi-noach shlomi-noach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition of PutKVPairs() is good and makes sense. See inline a comment on how PutKVPairs() is used within orchestrator.go

go/logic/orchestrator.go Outdated Show resolved Hide resolved
@timvaillancourt
Copy link
Contributor Author

Updated PR based on @shlomi-noach's suggestions

Copy link
Collaborator

@shlomi-noach shlomi-noach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good with minor suggested change.

go/logic/orchestrator.go Outdated Show resolved Hide resolved
Co-authored-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
@shlomi-noach shlomi-noach merged commit a322db4 into openark:master Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants