Suggestion: Add CustomDeserializer
trait for making debugging raft-rs
logs much easier
#522
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As I mentioned in the raft-rs Slack channel before, I think it would be very useful if users could see their byte slice information like Entry's
context
,data
.I think it could be possible by exposing the
CustomDeserializer
trait inraft-rs
.In this PR, I implement this thinking roughly, and I can see they are working as expected through ratify which uses
raft-rs
under the hood.You can see the logged
Message
includescontext
,data
as deserialized strings, not as byte slices in the below screenshot.I'm just wondering if there are some
raft-rs
maintainers who agree with this idea and if not, why not.Although this PR is currently just some sample codes to show ideas and working code, if there's a chance this PR will be merged, I'm willing to work on making improvements.
(Otherwise, I think I have to keep the cloned separate repository for
raftify
which would be troublesome for me...)