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

Adapt legacy node request handlers to use hash_t keys internally #159

Open
gavin-norman-sociomantic opened this issue Jun 26, 2018 · 3 comments

Comments

@gavin-norman-sociomantic

Actually changing the on-the-wire protocol to send integers instead of strings would be a breaking change, but we can adapt the node-side request handlers to use hash_t internally. This allows storage engine implementations to be purely hash_t based, as well.

@gavin-norman-sociomantic
Copy link
Author

gavin-norman-sociomantic commented Oct 18, 2018

This would be a breaking change, as code that uses this library (i.e. dhtnode) would break as a result of the change. (We could find a way to do this via a deprecation, instead of as a breaking change, but it would be very unfun.)

@gavin-norman-sociomantic
Copy link
Author

Moved to v15.0.0.

@gavin-norman-sociomantic
Copy link
Author

I think what this is talking about is the abstract methods in the node-side request classes, e.g. https://github.com/sociomantic-tsunami/dhtproto/blob/v14.x.x/src/dhtproto/node/request/Put.d#L182. The keys are currently passed around as cstrings, including at the point when they're passed into the storage engine's methods (e.g. https://github.com/sociomantic-tsunami/dhtnode/blob/master/src/dhtnode/request/PutRequest.d#L127). Moving the conversion from string to hash_t to the protocol classes, and always passing hash_t keys into the abstract methods will allow us to simplify the storage engine code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants