Skip to content

Latest commit

 

History

History
 
 

vault

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Ignite vault module

This module provides Vault API implementation.

Vault is the local persistent key-value storage where node maintains its local state. The data stored in the vault is semantically divided in the following categories:

  • User-level local configuration properties (such as memory limits, network timeouts, etc). User-level configuration properties can be written both at runtime (not all properties will be applied at runtime, however, - some of them will require a full node restart) and when a node is shut down (in order to be able to change properties that prevent node startup for some reason)
  • System-level private properties (such as computed local statistics, node-local common paths, etc). System-level private properties are computed locally based on the information available at node locally (not based on metastorage watched values)
  • System-level distributed metastorage projected properties (such as paths to partition files, etc). System-level projected properties are associated with one or more metastorage properties and are computed based on the local node state and the metastorage properties values. System-level projected properties values are semantically bound to a particular revision of the dependee properties and must be recalculated when dependees are changed (see reliable watch processing).

The main components of the module are the following:

  • VaultEntry is the vault unit as entry with comparable key represented as a ByteArray and value represented as an array of bytes.
  • VaultService defines interface for accessing to a vault service. There are standard methods for working with keys and values like get VaultEntry by key, put value with key to vault, remove value with a key from vault, putAll method that inserts or updates entries with given keys and given values. Also there is a range method that returns a view of the portion of vault whose keys range from fromKey, inclusive, to toKey, exclusive.
  • VaultManager is responsible for handling VaultService lifecycle and providing interface for managing local keys.

There are two implementations of VaultService: InMemoryVaultService and PersistentVaultService. The first one is the in-memory implementation of VaultService and mostly used for testing purposes.

The second one is VaultService implementation based on RocksDB. RocksDB is a storage engine with key/value interface, where keys and values are arbitrary byte streams. For more info about RocksDB see corresponding wiki.