Class

curiodb

KeyNode

Related Doc: package curiodb

Permalink

class KeyNode extends Node[Map[String, Map[String, NodeEntry]]] with PubSubServer with ScriptingServer

A KeyNode is a special type of Node in the system. It does not represent any key/value provided by a client, but instead is responsible for managing the keyspace for a subset of keys in its value field, which contains a map of DB names, mapped to keys, mapped to nodes, where each node is represented by a NodeEntry. KeyNode takes on the role of a Node, as there are a variety of commands that logically belong to it.

When a ClientNode (the other special type of node, responsble for handling a single client) receives a command for a particular key, the command is first routed to the KeyNode responsible for that key. The KeyNode maps each key to an ActorRef for the key's actual node (StringNode, ListNode, etc), having first created the Node actor at some point (this actually occurs when the key/node doesn't exist and, a command is run that doesn't have a default defined, and writes, as per in commands.conf), and forwards each command onto the Node when received. The routing strategy used is configurable via Akka (actor.deployment./keys.router in application.conf), defaulting to the consistent-hashing-pool router.

A KeyNode also handles many commands itself that deal with key management, such as deleting, persisting, and expiring keys. Each NodeEntry instance stores a Option(Long/Cancellable) pair which if expiring, contains the timestamp of when the expiry will occur, and the Cancellable task that will actually run, deleting the node. Deletion of a node (either via expiry or the DEL command) simply sends a message to the Node actor which when received, shuts down the actor, and then removes the key and NodeEntry from the keyspace map.

Lastly worthy of discussion is a feature that Redis does not provide, virtual memory, which simply allows a Node to persist its value to disk, and shut down after a period of time (defined by the curiodb.sleep-after duration value in reference.conf). The difference between this occurring and a Node being deleted, is that the key and NodeEntry is kept in the keyspace map. This is also why the ActorRef for each Node in a NodeEntry is an Option - a value of None indicates a sleeping Node. When a command is run against a key mapped to a sleeping Node, a new Node actor is created, which will read its previous value from disk. The idea here is to allow more data to be stored in the system than can fit in memory.

Linear Supertypes
ScriptingServer, Scripting, PubSubServer, Node[Map[String, Map[String, NodeEntry]]], ActorLogging, CommandProcessing, PersistentActor, Eventsourced, PersistenceRecovery, PersistenceIdentity, StashFactory, Stash, RequiresMessageQueue[DequeBasedMessageQueueSemantics], UnrestrictedStash, StashSupport, Snapshotter, Actor, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. KeyNode
  2. ScriptingServer
  3. Scripting
  4. PubSubServer
  5. Node
  6. ActorLogging
  7. CommandProcessing
  8. PersistentActor
  9. Eventsourced
  10. PersistenceRecovery
  11. PersistenceIdentity
  12. StashFactory
  13. Stash
  14. RequiresMessageQueue
  15. UnrestrictedStash
  16. StashSupport
  17. Snapshotter
  18. Actor
  19. AnyRef
  20. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new KeyNode()

    Permalink

Type Members

  1. type CommandRunner = PartialFunction[String, Any]

    Permalink

    Signature for the partial function CommandRunner that actually handles each command.

    Signature for the partial function CommandRunner that actually handles each command. Every Node must implement the "run" method of this type (this requirement is actually codified in the base Node class). It takes a case statement mapping command names to the code that handles them - typically handled inline, or via a method if more complex. The result will then be sent back to the calling ClientNode, and converted into a Redis response before being sent back to the client socket. One special case is the handler returning Unit, in which case no response is sent back, in which case it's up to the handling code to manually send a response back to the client node. A common example of this is all of the aggregation commands, which need to coordinate with multiple nodes before calculating a response. But the bulk of commands are simple one-liners directly returning a response.

    Definition Classes
    CommandProcessing
  2. type DB = Map[String, NodeEntry]

    Permalink

    Alias for keys mapped to each NodeEntry.

  3. type Receive = PartialFunction[Any, Unit]

    Permalink
    Definition Classes
    Actor

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def aggregate(props: Props): Unit

    Permalink

    Shortcut for creating Aggregate actors.

    Shortcut for creating Aggregate actors.

    Definition Classes
    CommandProcessing
  5. def args: Seq[String]

    Permalink

    Shortcut to the args of the current command.

    Shortcut to the args of the current command.

    Definition Classes
    CommandProcessing
  6. def aroundPostRestart(reason: Throwable): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Eventsourced → Actor
  7. def aroundPostStop(): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Eventsourced → Actor
  8. def aroundPreRestart(reason: Throwable, message: Option[Any]): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Eventsourced → Actor
  9. def aroundPreStart(): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Eventsourced → Actor
  10. def aroundReceive(receive: Receive, message: Any): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Eventsourced → Actor
  11. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  12. def beginTransaction(): Any

    Permalink

    Overridden so that we can add the keys for this transaction to transactionKeys, and run forwardTransactionToNodes.

    Overridden so that we can add the keys for this transaction to transactionKeys, and run forwardTransactionToNodes.

    Definition Classes
    KeyNodeNode
  13. def bounds(from: Int, to: Int, size: Int): (Int, Int)

    Permalink

    Utility for handling boundary args that wrap around ends of sequences and count backwards when negative.

    Utility for handling boundary args that wrap around ends of sequences and count backwards when negative.

    Definition Classes
    CommandProcessing
  14. lazy val channels: Map[String, Set[ActorRef]]

    Permalink

    Client subscriptions to channels.

    Client subscriptions to channels.

    Definition Classes
    PubSubServer
  15. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  16. def cloneValue: Map[String, Map[String, NodeEntry]]

    Permalink

    Deep clone which drills down into each DB, and copies all its entries.

    Deep clone which drills down into each DB, and copies all its entries.

    Definition Classes
    KeyNodeNode
  17. def closeTransaction(clientId: String = command.clientId, committing: Boolean = false): Option[Map[String, Map[String, NodeEntry]]]

    Permalink

    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.

    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.

    Definition Classes
    KeyNodeNode
  18. var command: Command

    Permalink

    The current command - normally will be set when a Command arrives via the actor's receive method.

    The current command - normally will be set when a Command arrives via the actor's receive method.

    Definition Classes
    CommandProcessing
  19. def commandCreatedInTransaction(): Unit

    Permalink

    Resets the current command to a copy of itself with the createdInTransaction flag set to true.

    Resets the current command to a copy of itself with the createdInTransaction flag set to true. The Node actor that receives this command will then use it to set up its own transaction handling.

  20. val commandTimeout: Int

    Permalink

    Timeout for a single command.

    Timeout for a single command. Used by ClientNode to schedule timeout handlers for commands, and also in ScriptRunner to determine what the timeout for a Lua script should be.

    Definition Classes
    CommandProcessing
  21. def commitTransaction(): Any

    Permalink

    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.

    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.

    Definition Classes
    KeyNodeNode
  22. def compileScript(uncompiled: String, onSuccess: (Prototype) ⇒ Any): Any

    Permalink

    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.

    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.

    Definition Classes
    Scripting
  23. implicit val context: ActorContext

    Permalink
    Definition Classes
    Actor
  24. def create(dbName: String, key: String, kind: String, recovery: Boolean = false): Option[ActorRef]

    Permalink

    Creates a new Node actor for the given DB name, key and node type.

    Creates a new Node actor for the given DB name, key and node type. The recovery arg is set to true when the KeyNode first starts and restores its keyspace from disk, otherwise (the default) we persists the keyspace to disk.

  25. def db(name: String = command.db): DB

    Permalink

    Shortcut for grabbing the String/NodeEntry map (aka DB) for the given DB name, or the current command.

  26. val debug: Boolean

    Permalink

    Flag that enables detailed command debugging.

    Flag that enables detailed command debugging.

    Definition Classes
    CommandProcessing
  27. def deferAsync[A](event: A)(handler: (A) ⇒ Unit): Unit

    Permalink
    Definition Classes
    Eventsourced
  28. def delete(key: String, dbName: Option[String] = None): Boolean

    Permalink

    Deletes a Node.

  29. def deleteMessages(toSequenceNr: Long): Unit

    Permalink
    Definition Classes
    Eventsourced
  30. def deleteOldSnapshots(stopping: Boolean = false): Unit

    Permalink

    Deletes old snapshots after a new one is saved.

    Deletes old snapshots after a new one is saved.

    Definition Classes
    Node
  31. def deleteSnapshot(sequenceNr: Long): Unit

    Permalink
    Definition Classes
    Snapshotter
  32. def deleteSnapshots(criteria: SnapshotSelectionCriteria): Unit

    Permalink
    Definition Classes
    Snapshotter
  33. def durationSetting(name: String): Int

    Permalink

    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.

    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.

    Definition Classes
    CommandProcessing
  34. def emptyValue: Map[String, Map[String, NodeEntry]]

    Permalink

    The actual value persisted for a KeyNode is a map of db names to DB instances.

    The actual value persisted for a KeyNode is a map of db names to DB instances.

    Definition Classes
    KeyNodeNode
  35. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  36. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  37. def exists(key: String): Boolean

    Permalink

    Does the key exist - rather than using db.contains, we also need to account for keys marked as deleted in a transaction.

  38. def expire(when: Long): Int

    Permalink

    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.

  39. val expireAfter: Int

    Permalink

    Milliseconds after which a Node automatically expires itself.

  40. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  41. def forwardTransactionToNodes(): Any

    Permalink

    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.

    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. See ClientNode.awaitTransactionAcks for more detail about this flow.

  42. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  43. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  44. def inTransaction: Boolean

    Permalink

    Checks if the current Command is in a transaction.

    Checks if the current Command is in a transaction.

    Definition Classes
    Node
  45. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  46. val isolationLevel: String

    Permalink

    Transaction isolation level: "repeatable" reads, read "committed", or read "uncommitted".

    Transaction isolation level: "repeatable" reads, read "committed", or read "uncommitted".

    Definition Classes
    Node
  47. def journalPluginId: String

    Permalink
    Definition Classes
    PersistenceIdentity
  48. def lastSequenceNr: Long

    Permalink
    Definition Classes
    Eventsourced
  49. var lastSnapshot: Option[SnapshotMetadata]

    Permalink

    The most recently saved snapshot.

    The most recently saved snapshot. We store it on save and recover, so that we can delete it (and any earlier snapshots) each time we successfully save a new snapshot.

    Definition Classes
    Node
  50. def loadSnapshot(persistenceId: String, criteria: SnapshotSelectionCriteria, toSequenceNr: Long): Unit

    Permalink
    Definition Classes
    Snapshotter
  51. def log: LoggingAdapter

    Permalink
    Definition Classes
    ActorLogging
  52. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  53. def node(): ActorRef

    Permalink

    Shortcut for retrieving the ActorRef for the current Command.

    Shortcut for retrieving the ActorRef for the current Command. There are actually 5 states handled here:

    1) No key, Command belongs to a KeyNode. 2) Key doesn't exist. 3) Key exists and Node actor is not running (it's asleep). 4) Key exists, Node is running. 5) Key exists, Node is running, but marked deleted in transaction.

  54. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  55. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  56. def numberToString(n: Any): String

    Permalink

    Utility for dropping extraneous zeros from floats when converting to strings, for consistency with Redis' INCRBYFLOAT/HINCRBYFLOAT commands and sorted set scores.

    Utility for dropping extraneous zeros from floats when converting to strings, for consistency with Redis' INCRBYFLOAT/HINCRBYFLOAT commands and sorted set scores.

    Definition Classes
    CommandProcessing
  57. def onPersistFailure(cause: Throwable, event: Any, seqNr: Long): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Eventsourced
  58. def onPersistRejected(cause: Throwable, event: Any, seqNr: Long): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Eventsourced
  59. def onRecoveryFailure(cause: Throwable, event: Option[Any]): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Eventsourced
  60. def pattern(values: Iterable[String], pattern: String): Iterable[String]

    Permalink

    Utility for glob-style filtering.

    Utility for glob-style filtering.

    Definition Classes
    CommandProcessing
  61. lazy val patterns: Map[String, Set[ActorRef]]

    Permalink

    Client subscriptions to patterns.

    Client subscriptions to patterns.

    Definition Classes
    PubSubServer
  62. def persist(): Int

    Permalink

    Cancels expiry on a node when the PERSIST command is run.

  63. def persist[A](event: A)(handler: (A) ⇒ Unit): Unit

    Permalink
    Definition Classes
    Eventsourced
  64. val persistAfter: Int

    Permalink

    Stores the duration which controls the minimum delay between receiving a command that writes, and persisting the actual value written.

    Stores the duration which controls the minimum delay between receiving a command that writes, and persisting the actual value written.

    Definition Classes
    Node
  65. def persistAll[A](events: Seq[A])(handler: (A) ⇒ Unit): Unit

    Permalink
    Definition Classes
    Eventsourced
  66. def persistAllAsync[A](events: Seq[A])(handler: (A) ⇒ Unit): Unit

    Permalink
    Definition Classes
    Eventsourced
  67. def persistAsync[A](event: A)(handler: (A) ⇒ Unit): Unit

    Permalink
    Definition Classes
    Eventsourced
  68. def persistenceId: String

    Permalink
    Definition Classes
    Node → PersistenceIdentity
  69. var persisting: Boolean

    Permalink

    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.

    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.

    Definition Classes
    Node
  70. def postRestart(reason: Throwable): Unit

    Permalink
    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  71. def postStop(): Unit

    Permalink
    Definition Classes
    UnrestrictedStash → Actor
  72. def preRestart(reason: Throwable, message: Option[Any]): Unit

    Permalink
    Definition Classes
    UnrestrictedStash → Actor
  73. def preStart(): Unit

    Permalink
    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  74. def publish(): Int

    Permalink

    Sends a message that has been receieved (published) from a client, to all matching subscriptions - either channels, or patterns.

    Sends a message that has been receieved (published) from a client, to all matching subscriptions - either channels, or patterns.

    Definition Classes
    PubSubServer
  75. def randomItem(iterable: Iterable[String]): String

    Permalink

    Utility for selecting a random item.

    Utility for selecting a random item.

    Definition Classes
    CommandProcessing
  76. def receive: Receive

    Permalink
    Definition Classes
    Node → PersistentActor → Actor
  77. def receiveCommand: Receive

    Permalink

    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.

    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.

    Definition Classes
    KeyNodeNode → Eventsourced
  78. def receiveRecover: Receive

    Permalink

    Restores the keyspace from disk on startup, creating each Node actor.

    Restores the keyspace from disk on startup, creating each Node actor.

    Definition Classes
    KeyNodeNode → Eventsourced
  79. def recovery: Recovery

    Permalink
    Definition Classes
    PersistenceRecovery
  80. def recoveryFinished: Boolean

    Permalink
    Definition Classes
    Eventsourced
  81. def recoveryRunning: Boolean

    Permalink
    Definition Classes
    Eventsourced
  82. def rename(fromValue: Any, toCommand: String): Unit

    Permalink

    Handles the RENAME/RENAMENX commands for all node types.

    Handles the RENAME/RENAMENX commands for all node types. Each Node subclass is responsible for converting its value to something that can be used by the relevant command given - this command is typically implemented (and named) differently per node, and knows how to accept fromValue. Renaming is basically a delete, then create a new node, so we first delete ourselves (via the internal _DEL command), then pass the fromValue arg with the given command to what will be a newly created Node.

    Definition Classes
    Node
  83. def respond(response: Any): Unit

    Permalink

    Sends a Response (usually the result of a command) back to the command's destination (usually a ClientNode sending a Command).

    Sends a Response (usually the result of a command) back to the command's destination (usually a ClientNode sending a Command).

    Definition Classes
    CommandProcessing
  84. def route(input: Seq[Any], client: Option[ActorRef] = None): Unit

    Permalink

    Shortcut route method for sending command input without a constructed Command instance, using the state of the current command (eg: db, clientID).

    Shortcut route method for sending command input without a constructed Command instance, using the state of the current command (eg: db, clientID).

    Definition Classes
    CommandProcessing
  85. def route(command: Command): Unit

    Permalink

    Sends an unrouted Command to one or more KeyNode actors, either by routing by key, or broadcasting to all.

    Sends an unrouted Command to one or more KeyNode actors, either by routing by key, or broadcasting to all.

    Definition Classes
    CommandProcessing
  86. def run: CommandRunner

    Permalink

    Abstract definition of each Node actor's CommandRunner that must be implemented.

    Abstract definition of each Node actor's CommandRunner that must be implemented. It's the partial function that matches a Command name to the code that runs it.

    Definition Classes
    KeyNodeNode
  87. def runForAnyNode: CommandRunner

    Permalink

    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.

    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. Currently used for transaction begin (_MULTI) and commit (_EXEC).

    When _MULTI is received and a transaction is beginning, we store the current value in the transaction map against the transaction's client ID. Subsequent commands within the transaction will then read from and write to the transaction map, until it's committed via the _EXEC command, at which point we copy the value from the transaction map back to the main value, and remove it from the transaction map.

    The transaction may also timeout which is scheduled when _MULTI is received. If this occurs and then _EXEC is received, we don't send acknowledgement back to the ClientNode, so it can then deal with its own timeout.

    Definition Classes
    Node
  88. def runPubSub: CommandRunner

    Permalink
    Definition Classes
    PubSubServer
  89. def runScript(compiled: Prototype): Unit

    Permalink

    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.

    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.

    Definition Classes
    Scripting
  90. def runScripting: CommandRunner

    Permalink

    CommandRunner for ScriptingServer, which is given a distinct name, so that KeyNode can compose together multiple CommandRunner methods to form its own.

    CommandRunner for ScriptingServer, which is given a distinct name, so that KeyNode can compose together multiple CommandRunner methods to form its own.

    Definition Classes
    ScriptingServer
  91. def save(): Unit

    Permalink

    As discussed above, saves a snapshot.

    As discussed above, saves a snapshot. If curiodb.persist-after is zero or less (which means every change must cause a snapshot to be saved), then just save a snapshot. Otherwise schedule the internal Persist message to save a snapshot, if none has already been scheduled, according to the value of the persisting var.

    Definition Classes
    Node
  92. def saveSnapshot(snapshot: Any): Unit

    Permalink
    Definition Classes
    Snapshotter
  93. def scan(values: Iterable[String]): Seq[String]

    Permalink

    Utility for scan-style commands, namely SCAN/SSCAN/HSCAN/ZSCAN.

    Utility for scan-style commands, namely SCAN/SSCAN/HSCAN/ZSCAN.

    Definition Classes
    CommandProcessing
  94. lazy val scripts: Map[String, Prototype]

    Permalink

    Compiled scripts stored on a KeyNode via the LOAD SCRIPT command.

    Compiled scripts stored on a KeyNode via the LOAD SCRIPT command.

    Definition Classes
    ScriptingServer
  95. implicit final val self: ActorRef

    Permalink
    Definition Classes
    Actor
  96. final def sender(): ActorRef

    Permalink
    Definition Classes
    Actor
  97. def sleep(): Unit

    Permalink

    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.

    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. The key's NodeEntry has its ActorRef then set to None to signify a sleeping Node. When a command is next run against the key, the actor for the Node is then recreated, with its value restored from disk.

  98. val sleepAfter: Int

    Permalink

    Milliseconds after which a Node should persist its value to disk, and shut down, (aka sleep).

  99. def slice[T](value: Seq[T]): Seq[T]

    Permalink

    Utility for slicing sequences, for commands such as SLICE, GETRANGE, LRANGE, etc.

    Utility for slicing sequences, for commands such as SLICE, GETRANGE, LRANGE, etc.

    Definition Classes
    CommandProcessing
  100. def snapshotPluginId: String

    Permalink
    Definition Classes
    PersistenceIdentity
  101. def snapshotSequenceNr: Long

    Permalink
    Definition Classes
    Eventsourced → Snapshotter
  102. def snapshotterId: String

    Permalink
    Definition Classes
    Eventsourced → Snapshotter
  103. def sort(): Any

    Permalink

    Handles the bridge between the external SORT and internal _SORT commands.

    Handles the bridge between the external SORT and internal _SORT commands. This is essentially a work around given that we only allow external (client facing) commands to map to a single type of Node.

  104. def sort(values: Iterable[String]): Any

    Permalink

    Handles the SORT command.

    Handles the SORT command. Defined here since it can be run against multiple Node types, namely ListNode, SetNode and SortedSetNode.

    Definition Classes
    Node
  105. def stash(): Unit

    Permalink
    Definition Classes
    StashSupport
  106. def stop(): Unit

    Permalink

    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.

    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. Note we wrap context.stop with Try here since it may be called twice due to transaction timeouts.

    Definition Classes
    CommandProcessing
  107. def subscribeOrUnsubscribe(): Unit

    Permalink

    Handles subscribe and unsubscribe to both channels and patterns.

    Handles subscribe and unsubscribe to both channels and patterns. Responsible for omitting PubSubEvent messages back to the ClientNode when a change in subscription occurs.

    Definition Classes
    PubSubServer
  108. def supervisorStrategy: SupervisorStrategy

    Permalink
    Definition Classes
    Actor
  109. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  110. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  111. var transactionKeys: Map[String, String]

    Permalink

    Current keys in transaction mapped to client IDs.

    Current keys in transaction mapped to client IDs. See transactionAcknowledge/transactionClose for more detail.

  112. val transactionTimeout: Int

    Permalink

    Stores the duration which controls the amount of time we allow a transaction to exist for.

    Stores the duration which controls the amount of time we allow a transaction to exist for. This ensures that if for some reason the transaction does not complete, it can start handling write commands again.

    Definition Classes
    Node
  113. def ttl: Long

    Permalink

    Retrieves the milliseconds remaining until expiry occurs for a key when the TTL/PTTL commands are run.

  114. def unhandled(message: Any): Unit

    Permalink
    Definition Classes
    Eventsourced → Actor
  115. def unstashAll(): Unit

    Permalink
    Definition Classes
    Eventsourced → StashSupport
  116. def validate: Option[Any]

    Permalink

    Validates that the key and command for the current Command can be run.

    Validates that the key and command for the current Command can be run. This boils down to ensuring the command belongs to the type of Node mapped to the key, and that the Node must or musn't exist, given the particular command. Optionally returns an error, or a default value if the Node doesn't exist and a default is defined (as per commands.conf). Otherwise if validation passes, None is returned, indicating the command should be sent to the key's Node. Also validates that for write commands, the keys for the command aren't part of an existing transaction - if this occurs, the commands gets stashed until the transaction has completed.

  117. def value: Map[String, Map[String, NodeEntry]]

    Permalink

    Value getter according to the configured transaction isolation level:

    Value getter according to the configured transaction isolation level:

    - repeatable: should always return the value of the current transaction - uncommitted: always returns the newest written value, even if uncommitted - committed: always return the commit value, even inside a transaction

    Note that there is no "serializable" level since there is no notion of a range query. You can read more info on isolation levels here: https://en.wikipedia.org/wiki/Isolation_(database_systems)

    Definition Classes
    Node
  118. def value_=(value: Map[String, Map[String, NodeEntry]]): Unit

    Permalink

    Value setter - writes the current value, either to the main key, or a client ID if in a transaction.

    Value setter - writes the current value, either to the main key, or a client ID if in a transaction.

    Definition Classes
    Node
  119. var values: LinkedHashMap[String, Map[String, Map[String, NodeEntry]]]

    Permalink

    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.

    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. LinkedHashMap is used so that we can access the most recently written value when transaction isolation is configued as read-uncommitted.

    Definition Classes
    Node
  120. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  121. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  122. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  123. val wrongType: ErrorReply

    Permalink

    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.

Deprecated Value Members

  1. def persist[A](events: Seq[A])(handler: (A) ⇒ Unit): Unit

    Permalink
    Definition Classes
    Eventsourced
    Annotations
    @deprecated
    Deprecated

    (Since version 2.4) use persistAll instead

  2. def persistAsync[A](events: Seq[A])(handler: (A) ⇒ Unit): Unit

    Permalink
    Definition Classes
    Eventsourced
    Annotations
    @deprecated
    Deprecated

    (Since version 2.4) use persistAllAsync instead

Inherited from ScriptingServer

Inherited from Scripting

Inherited from PubSubServer

Inherited from Node[Map[String, Map[String, NodeEntry]]]

Inherited from ActorLogging

Inherited from CommandProcessing

Inherited from PersistentActor

Inherited from Eventsourced

Inherited from PersistenceRecovery

Inherited from PersistenceIdentity

Inherited from StashFactory

Inherited from Stash

Inherited from RequiresMessageQueue[DequeBasedMessageQueueSemantics]

Inherited from UnrestrictedStash

Inherited from StashSupport

Inherited from Snapshotter

Inherited from Actor

Inherited from AnyRef

Inherited from Any

Ungrouped