Cleanup performed whenever MULTI/EXEC is aborted, either explicitly via DISCARD or implicitly via an error.
Shortcut for creating Aggregate actors.
Shortcut to the args of the current command.
Handles transaction management, specifically broadcasting either _MULTI or _EXEC to KeyNode (and indirectly, Node) actors, and then running the next stage on completion of receiving all expected replies.
Middle phase of a transaction where we receive and collect Response messages for queued commands - once they're all received, we construct the final response, switch state back to the default receiveCommand, and send the final response back to self to be received as a regular Response.
Moves the current value into a transaction for the current command's client ID.
Utility for handling boundary args that wrap around ends of sequences and count backwards when negative.
Main Receive method - handles incoming TextFrame payloads, which all use JSON strings.
Channels subscribed to.
ActorRef we send final responses back to.
Clones the value for use in a new transaction.
Removes and returns the transaction value.
The current command - normally will be set when a Command arrives via the actor's receive method.
Timeout for a single command.
Ordered map of commands that have been received - used to order responses received when multiple commands are in play, eg MULTI/EXEC.
Removes the transaction value and writes it back into the main value.
Compiles a Lua script given by a command, and runs a success function when successful - storing it in the case of LOAD SCRIPT on a KeyNode, or running it in the case of EVAL on a CLientNode.
The current DB name - default, or one provided by "SELECT".
Flag that enables detailed command debugging.
Deletes old snapshots after a new one is saved.
List of disabled commands.
Retrieves a duration config setting as milliseconds, and handles the value not being a duration value, so we can do something like set it to "off", in which case we default to 0.
Returns the default value for the type of Node, which subclasses must override.
Sends the final response once a transaction has ended, which in the case of MULTI/EXEC, is a sequence of all the collected responses, ordered by their corresponding commands.
Shortcut for a JSON object with an error value.
Converts responses to JSON embedded in TextFrame payloads.
Parses a JSON arg list from a HttpRequest or WebSocket TextFrame.
Checks if the current Command is in a transaction.
Transaction isolation level: "repeatable" reads, read "committed", or read "uncommitted".
Constructs the final JSON object from a Response payload.
The most recently saved snapshot.
Determines if a transaction is triggered via MULTI.
Utility for dropping extraneous zeros from floats when converting to strings, for consistency with Redis' INCRBYFLOAT/HINCRBYFLOAT commands and sorted set scores.
Utility for glob-style filtering.
Patterns subscribed to.
Stores the duration which controls the minimum delay between receiving a command that writes, and persisting the actual value written.
Boolean representing whether we've scheduled an internal Persist message, so that it only occurs once at a time according to the duration configured by the curiodb.persist-after setting.
Utility for selecting a random item.
Setup required for spray-websocket.
Receives final Response, which is then formatted per ClientNode subclass, and sent back to the original actor that provided the input for the Command.
Receive for PubSubClient, which is given a distinct name, so that ClientNode can compose together multiple Receive methods to form its own.
Restore the Node actor's value on startup.
Handles the RENAME/RENAMENX commands for all node types.
Sends a Response (usually the result of a command) back to the command's destination (usually a ClientNode sending a Command).
Sends a final response back to the original actor that provided the input for the Command.
Map of responses that have been received inside a transaction.
Shortcut route method for sending command input without a constructed Command instance, using the state of the current command (eg: db, clientID).
Sends an unrouted Command to one or more KeyNode actors, either by routing by key, or broadcasting to all.
Routes the given Command instance, initializing its timeout event.
Abstract definition of each Node actor's CommandRunner that must be implemented.
CommandRunner for AggregateCommands, which is given a distinct name, so that ClientNode can compose together multiple CommandRunner methods to form its own.
Alternate Receive handler for all Node actors - these are internal commands can run for any Node type, and are not validated in any way, nor are they configured in commands.conf.
CommandRunner for PubSubClient, which is given a distinct name, so that ClientNode can compose together multiple CommandRunner methods to form its own.
Runs a compiled Lua script by constructing a temporary ScriptRunner actor, and sending it the orignal command received so that it can eventually reply to it directly.
CommandRunner for ScriptingClient, which is given a distinct name, so that ClientNode can compose together multiple CommandRunner methods to form its own.
As discussed above, saves a snapshot.
Utility for scan-style commands, namely SCAN/SSCAN/HSCAN/ZSCAN.
Internal API for subclasses to send a command once they've received its full input.
Constructs the SHA1 digest of a given script - this happens on the ClientNode so that we can leverage the routing normally used for keys when sending the script to a KeyNode to be stored.
Utility for slicing sequences, for commands such as SLICE, GETRANGE, LRANGE, etc.
Handles the SORT command.
Here we override the stop method used by CommandProcessing, which allows us to inform the KeyNode actors holding subscriptions to our channels and patterns that we're unsubscribing.
Flag used to mark the ClientNode as being in "streaming" mode, namely when a PubSub channel is subscribed to, and command timeouts should be bypassed.
Handles all commands that subscribe or unsubsubscribe, namely SUBSCRIBE/UNSUBSCRIBE/PSUBSCRIBE/PUNSUBSCRIBE.
Converts a response to JSON - we need to deal with each type specifically so that spray-json knows what to do with it.
Should transactions abort if any of their commands receives an error response.
Flags a validation error occurring for a command inside MULTI/EXEC which is then used to abort when EXEC is called.
Stores the duration which controls the amount of time we allow a transaction to exist for.
Performs initial Command validation before sending it anywhere, as per the command's definition in commands.conf, namely that the command belongs to a type of Node, it contains a key if required, and the number of arguments fall within the configured range.
Value getter according to the configured transaction isolation level:
Value setter - writes the current value, either to the main key, or a client ID if in a transaction.
MVCC map of transaction values for the Node mapped to client IDs, including the committed "main" value, which is identified with an empty string as its key.
(Since version 2.4) use persistAll instead
(Since version 2.4) use persistAllAsync instead