[WIP] New ETag Commands Syntax + ETag Object Support#1478
Draft
[WIP] New ETag Commands Syntax + ETag Object Support#1478
Conversation
Add YCSB --di (Delete and reInsert) option
…ies (eliminating need for ISessionFunctions calls for those operations)
…ed), other fixes related to prior changes
…l for change to LogRecord based
- Rename SingleWriter() => InitialWriter(), ConcurrentWriter() => InPlaceWriter() - Rename SinglecDeleter() => InitialDeleter(), ConcurrentDeleter() => InPlaceDeleter() - Consolidate SingleReader() and ConcurrentReader() to just Reader()
…onalOperation chain
…ail, and CopyToReadCache now being fully internal operations.
… no-longer-needed allocator functions that are now done by DLR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
<<This PR is still a work in progress>>
This PR introduces a notion of "meta commands" - commands that "envelop" existing data commands.
The meta commands introduced in this PR are ETag related - EXECWITHETAG (execute a command and add the dest key's etag to the output), as well as EXECIFMATCH, EXECIFNOTMATCH, EXECIFGREATER (conditionally-execute a command based on the dest key's ETag in relation to the ETag meta-argument).
These command are able to replace the existing etag-related commands and command arguments, and in-turn support many more (including object commands).
For example:
DELIFGREATER key etag->EXECIFGREATER etag DEL keyGETIFNOTMATCH key etag->EXECIFNOTMATCH etag GET keyGETWITHETAG key->EXECWITHETAG GET keySETIFMATCH key value etag->EXECIFMATCH etag SET key valueTo achieve this logic, we parse the meta command and its meta-arguments into the
SessionParseState. Currently this logic supports a constant number of meta-arguments which is defined in theArityproperty in the meta-command'sRespCommandInfo(arg count = arity - 1).When the parse state gets handed to the appropriate
ISessionFunctionsmethod, the method decides whether the operation should get executed (in the case of conditional-execution) and to what value should the record's ETag advance (if at all).The "special output" (in case the ETag needs to be written along with the command output) is handled by the
ISessionFunctionsmethod in the main and unified case, and in theIGarnetObject.Operatemethod in the object case.To-do:
SessionParseStateto parse and hold meta-argumentsInputHeaderto include meta-command and update commandsISessionFunctionsfor all 3 contextsISessionFunctions(internal transactions)ISessionFunctionsTesting & Benchmarking: