Skip to content

Conversation

HowardHinnant
Copy link
Contributor

varint is no longer used by NuDB. It is now only used by codec.h in
nodestore and so has been moved there.

varint is no longer used by NuDB.  It is now only used by codec.h in
nodestore and so has been moved there.
@nbougalis
Copy link
Contributor

nbougalis commented Aug 22, 2016

Can we edit varint.h to explain that our format is not the same as Google's varint encoding? The problem is how we encode at https://github.com/HowardHinnant/rippled/blob/a8009d6dcef42723f449048c3b0b0a1e1e836336/src/ripple/nodestore/impl/varint.h#L113-L115: we use 127 instead of 128.

I assume we can't easily fix this. If we can, we should. In that case, in addition to the above lines, the function size_varint needs updating as does the decoder read_varint.

@HowardHinnant
Copy link
Contributor Author

I've updated the comment at the top.

I found a place where we write multi-byte values, and so the difference in base shows up. My understanding is that this encoding is part of our database now, and so would be inconvenient to change.

#include <type_traits>

namespace beast {
namespace nudb {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should ripple::NodeStore::detail instead of beast::nudb::detail.

Copy link
Contributor Author

@HowardHinnant HowardHinnant Aug 22, 2016

Choose a reason for hiding this comment

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

<slaps forehead> Fix pushed.

Choose a reason for hiding this comment

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

Nik beat me to it...
The dependency on nudb/detail/stream.h (and field.h) looks a bit questionable now.
Should they be levelised out of nudb (they only appear to be used there and nodestore)?

Copy link
Contributor Author

@HowardHinnant HowardHinnant Aug 22, 2016

Choose a reason for hiding this comment

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

At the moment I don't see a better place for istream and ostream. I'm certainly open to suggestions though.

Copy link
Contributor

Choose a reason for hiding this comment

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

nudb can't include any files outside of its own directory, so no.

@codecov-io
Copy link

Current coverage is 71.58% (diff: 75.00%)

Merging #1822 into develop will decrease coverage by 0.02%

@@            develop      #1822   diff @@
==========================================
  Files           871        871          
  Lines         69787      69787          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits          49973      49958    -15   
- Misses        19814      19829    +15   
  Partials          0          0          

Sunburst

Powered by Codecov. Last update 68e123a...7938ea1

@vinniefalco
Copy link
Contributor

👍

1 similar comment
@willwray
Copy link

👍

@HowardHinnant HowardHinnant added the Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required. label Aug 23, 2016
@nbougalis nbougalis mentioned this pull request Aug 26, 2016
@nbougalis
Copy link
Contributor

Merged as 8a6c7f9

@nbougalis nbougalis closed this Aug 28, 2016
@HowardHinnant HowardHinnant deleted the varint branch March 7, 2017 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants