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

Projects
None yet
4 participants
@chu11
Copy link
Contributor

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 some commits Nov 1, 2017

modules/kvs/cache: Refactor cache json functions
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.
common/libkvs/treeobj: Add treeobj_decodeb()
Add function to decode treeobj's with buffers without NUL terminating
character.
modules/kvs: Remove cache_lookup_and_get_treeobj
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

This comment has been minimized.

Copy link
Member

garlick commented Nov 2, 2017

LGTM!

@codecov-io

This comment has been minimized.

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

This comment has been minimized.

Copy link

coveralls commented Nov 2, 2017

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

4 checks passed

codecov/patch 83.78% of diff hit (target 77.87%)
Details
codecov/project 77.87% (+<.01%) compared to 54c08c1
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.006%) to 78.496%
Details

@grondo grondo referenced this pull request May 10, 2018

Closed

0.9.0 Release #1479

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.