Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kvs: refactor server cache functions #1268

Merged
merged 5 commits into from
Nov 3, 2017

Conversation

chu11
Copy link
Member

@chu11 chu11 commented Nov 2, 2017

This is part one if issue #1264. A minor refactor, renaming several "json" functions to "treeobj" and adjusting the logic accordingly.

I'm splitting it up b/c the second half of #1264 is growing and seems particularly distinct.

chu11 added 5 commits November 2, 2017 16:25
Add function to decode treeobj's with buffers without NUL terminating
character.
Refactor cache_entry_get_json() and cache_entry_set_json() to
cache_entry_get_treeobj() and cache_entry_set_treeobj(), as
the cache no longer stores plain old json.

Internally, adjust code, such as using treeobj specific functions
for encoding and decoding.

Update unit tests appropriately and add new tests as needed.

Update callers as well.
The function was more widely used before, but is now only used
in two locations.  Remove function and replace with calls to other
functions.

Remove unit tests for cache_lookup_and_get_treeobj().

Adjust callers appropriately.
@garlick
Copy link
Member

garlick commented Nov 2, 2017

LGTM!

@codecov-io
Copy link

codecov-io commented Nov 2, 2017

Codecov Report

Merging #1268 into master will increase coverage by <.01%.
The diff coverage is 83.78%.

@@            Coverage Diff             @@
##           master    #1268      +/-   ##
==========================================
+ Coverage   77.87%   77.87%   +<.01%     
==========================================
  Files         154      154              
  Lines       29093    29104      +11     
==========================================
+ Hits        22656    22665       +9     
- Misses       6437     6439       +2
Impacted Files Coverage Δ
src/modules/kvs/cache.c 88.72% <100%> (ø) ⬆️
src/common/libkvs/treeobj.c 84.82% <100%> (+0.34%) ⬆️
src/modules/kvs/lookup.c 82.72% <100%> (ø) ⬆️
src/modules/kvs/kvs.c 62.62% <42.85%> (+0.25%) ⬆️
src/modules/kvs/commit.c 74.56% <81.81%> (-0.11%) ⬇️
src/common/libflux/future.c 88.31% <0%> (-0.94%) ⬇️
src/common/libkvs/kvs_txn.c 74.71% <0%> (-0.57%) ⬇️
src/common/libflux/message.c 81.01% <0%> (-0.48%) ⬇️
src/broker/overlay.c 73.88% <0%> (-0.32%) ⬇️
src/common/libflux/handle.c 83.66% <0%> (-0.25%) ⬇️
... and 8 more

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.006%) to 78.496% when pulling 67f05b1 on chu11:issue1264-part1 into 54c08c1 on flux-framework:master.

@garlick garlick merged commit 07780af into flux-framework:master Nov 3, 2017
@grondo grondo mentioned this pull request May 10, 2018
@chu11 chu11 deleted the issue1264-part1 branch June 5, 2021 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants