Package com.exonum.binding.core.storage.indices

Contains Exonum indexes — persistent, named collections built on top of Exonum key-value storage.

Indexes are also known as collections, tables, and rarely as views for a database view is inherently associated with an index.

Index families

An index family is a named group of indexes of the same type. Each index in the group is identified by an identifier, an arbitrary byte string. An index in the group works the same as an individual index. Indexes in a family are isolated from each other. It is not possible to iterate through all elements that are stored inside an index group.

Use cases

Index families provide a way to separate elements by a certain criterion. Applications include indexing, where you create a separate collection group to index another collection of elements by a certain criterion; referencing another collection Bar from elements of collection Foo, where you keep an identifier into a collection in group Bar in a structure stored in collection Foo.

Limitations

Currently Exonum prepends an index identifier within a group to internal, implementation-specific, keys of that index to keep their elements separate from each other. The resulting database key includes the index identifier followed by the internal index key. Such implementation of index separation implies that each index identifier withing a group must not be a prefix of another index identifier in this group. The easiest way to achieve that is to use fixed-length identifiers.

Until this limitation is fixed, care must be taken when using this feature, because the identifiers are not checked.

See Also:
Exonum indexes reference documentation
  • Interface Summary 
    Interface Description
    ListIndex<T>
    A list index proxy is a contiguous list of elements.
    MapIndex<K,​V>
    A MapIndex is an index that maps keys to values.
    StorageIndex
    Storage index is a persistent, named collection built on top of Exonum key-value storage.
  • Class Summary 
    Class Description
    EntryIndexProxy<T>
    An Entry is a database index that can contain no or a single value.
    IndexAddress
    An Exonum index address: a pair of the name and an optional id in a group, which identifies an Exonum index.
    KeySetIndexProxy<E>
    A key set is an index that contains no duplicate elements (keys).
    ListIndexProxy<E>
    A list index proxy is a contiguous list of elements.
    MapIndexProxy<K,​V>
    A MapIndex is an index that maps keys to values.
    ProofListIndexProxy<E>
    A proof list index proxy is a contiguous list of elements, capable of providing cryptographic proofs that it contains a certain element at a particular position.
    ProofMapIndexProxy<K,​V>
    A ProofMapIndexProxy is an index that maps keys to values.
    ValueSetIndexProxy<E>
    A value set is an index that contains no duplicate elements (values).
    ValueSetIndexProxy.Entry<E>
    An entry of a value set index: a hash-value pair.