Signature for the partial function CommandRunner that actually handles each command.
Alias for keys mapped to each NodeEntry.
Shortcut for creating Aggregate actors.
Shortcut to the args of the current command.
Overridden so that we can add the keys for this transaction to transactionKeys, and run forwardTransactionToNodes.
Utility for handling boundary args that wrap around ends of sequences and count backwards when negative.
Client subscriptions to channels.
Deep clone which drills down into each DB, and copies all its entries.
Overridden so that we can clean up transactionKeys, and unstash any write commands that were previously stashed due to conflicting with keys in an existing transaction.
The current command - normally will be set when a Command arrives via the actor's receive method.
Resets the current command to a copy of itself with the createdInTransaction flag set to true.
Timeout for a single command.
Overridden so that we can migrate the DB in the transaction map, specifically handling the case of keys marked as deleted, as this is the stage where they're permananely deleted as they would be outside of a transaction.
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.
Creates a new Node actor for the given DB name, key and node type.
Shortcut for grabbing the String/NodeEntry map (aka DB) for the given DB name, or the current command.
Flag that enables detailed command debugging.
Deletes a Node.
Deletes old snapshots after a new one is saved.
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.
The actual value persisted for a KeyNode is a map of db names to DB instances.
Does the key exist - rather than using db.contains, we also need to account for keys marked as deleted in a transaction.
Initiates expiry on a node when any of the relevant commands are run, namely EXPIRE/PEXPIRE/EXPIREAT/PEXPIREAT, or when the "expire-after" setting is configured.
Milliseconds after which a Node automatically expires itself.
Called by beginTransaction and commitTransaction when _MULTI and _EXEC are received respectively, and handled both forwarding on these commands, and returning TransactionAck responses indicating the number of *invalid* keys received, so that the ClientNode managing the transaction can account for all keys sent.
Checks if the current Command is in a transaction.
Transaction isolation level: "repeatable" reads, read "committed", or read "uncommitted".
The most recently saved snapshot.
Shortcut for retrieving the ActorRef for the current Command.
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.
Client subscriptions to patterns.
Cancels expiry on a node when the PERSIST command is run.
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.
Sends a message that has been receieved (published) from a client, to all matching subscriptions - either channels, or patterns.
Utility for selecting a random item.
We override the KeyNode actor's Receive so as to perform validation, prior to the Node parent class Receive running, which wil call CommandRunner for the KeyNode.
Restores the keyspace from disk on startup, creating each Node actor.
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).
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.
Abstract definition of each Node actor's CommandRunner that must be implemented.
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.
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 ScriptingServer, which is given a distinct name, so that KeyNode 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.
Compiled scripts stored on a KeyNode via the LOAD SCRIPT command.
Called every time a command is run, only if sleeping is enabled (via the curiodb.sleep-after config value), and initiates the actor's sleeping process, whereby its value is persisted to disk and then shut down.
Milliseconds after which a Node should persist its value to disk, and shut down, (aka sleep).
Utility for slicing sequences, for commands such as SLICE, GETRANGE, LRANGE, etc.
Handles the bridge between the external SORT and internal _SORT commands.
Handles the SORT command.
Stops the actor - we define this shortcut to give subclassing traits the chance to override it and inject extra shutdown behavior that concrete actors need not know about.
Handles subscribe and unsubscribe to both channels and patterns.
Current keys in transaction mapped to client IDs.
Stores the duration which controls the amount of time we allow a transaction to exist for.
Retrieves the milliseconds remaining until expiry occurs for a key when the TTL/PTTL commands are run.
Validates that the key and command for the current Command can be run.
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.
Error message sent to ClientNode when a command is issued against an existing key that contains a different type of node than the type that the command belongs to.
(Since version 2.4) use persistAll instead
(Since version 2.4) use persistAllAsync instead