Liking cljdoc? Tell your friends :D

com.eldrix.hermes.impl.lmdb

A backing key value store implemented using LMDB.

LMDB has very fast read access, which makes it highly suitable as hermes operates principally in read-only mode. We use netty's direct buffers, and a shared pool because of allocation overhead compared to on-heap buffers.

We use key value stores in one of two ways. The first is to store entities. These are usually keyed by the identifier, except for descriptions, which are keyed by a tuple of concept identifier and description identifier. That optimises the common fetch of all descriptions for a given concept. The second is to store null values as part of an index, with compound keys. This means we can rapidly iterate across a range of keys, which are always sorted, and stored big-endian. The compound key structures are defined below.

It would be possible to create a generic key-value protocol, but this instead contains domain-optimised code.

A backing key value store implemented using LMDB.

LMDB has very fast read access, which makes it highly suitable as hermes
operates principally in read-only mode. We use netty's direct buffers, and a
shared pool because of allocation overhead compared to on-heap buffers.

We use key value stores in one of two ways. The first is to store entities.
These are usually keyed by the identifier, except for descriptions, which are
keyed by a tuple of concept identifier and description identifier. That
optimises the common fetch of all descriptions for a given concept. The second
is to store null values as part of an index, with compound keys. This means
we can rapidly iterate across a range of keys, which are always sorted, and
stored big-endian. The compound key structures are defined below.

It would be possible to create a generic key-value protocol, but this instead
contains domain-optimised code.
raw docstring

closeclj

(close store)
source

compactclj

(compact store)
source

component-refset-idsclj

(component-refset-ids store component-id)

Return a set of refset-ids to which this component belongs.

Return a set of refset-ids to which this component belongs.
sourceraw docstring

component-refset-itemsclj

(component-refset-items store component-id)
(component-refset-items store component-id refset-id)

Get the refset items for the given component, optionally limited to the refset specified.

  • store
  • component-id : id of the component (e.g concept-id or description-id)
  • refset-id : (optional) - limit to this refset.
Get the refset items for the given component, optionally
limited to the refset specified.
- store
- component-id : id of the component (e.g concept-id or description-id)
- refset-id    : (optional) - limit to this refset.
sourceraw docstring

conceptclj

(concept store id)
source

concept-descriptionsclj

(concept-descriptions store concept-id)

Returns a vector of descriptions for the given concept.

Returns a vector of descriptions for the given concept.
sourceraw docstring

concrete-valuesclj

(concrete-values store concept-id)

Return concrete values for the specified concept, if the underlying store supports concrete values. Only active concrete values are returned.

Return concrete values for the specified concept, if the underlying store
supports concrete values. Only active concrete values are returned.
sourceraw docstring

dbi-namesclj

(dbi-names env)

Returns an environment's DBI names as a set.

Returns an environment's DBI names as a set.
sourceraw docstring

descriptionclj

(description store description-id)
(description store concept-id description-id)

Return the description with the given concept-id and description-id.

If no concept-id is given, this uses the descriptionId-conceptId index to first determine the concept-id, as all descriptions are actually stored by conceptId-descriptionId-concept because that's a more common operation than finding a description by identifier alone.

Return the description with the given `concept-id` and `description-id`.

If no concept-id is given, this uses the descriptionId-conceptId index to
first determine the concept-id, as all descriptions are actually stored by
conceptId-descriptionId-concept because that's a more common operation than
finding a description by identifier alone.
sourceraw docstring

drop-refset-indicesclj

(drop-refset-indices store)

Delete all indices relating to reference set items.

Delete all indices relating to reference set items.
sourceraw docstring

drop-relationships-indexclj

(drop-relationships-index store)

Deletes all indices relating to relationships.

Deletes all indices relating to relationships.
sourceraw docstring

get-objectclj

(get-object env dbi id read-fn)
source

index-refsetsclj

(index-refsets store)

Iterates all active reference set items and rebuilds indices. Each active item is indexed:

  • componentRefsets : referencedComponentId -- refsetId -- msb -- lsb
  • associations : targetComponentId -- refsetId -- referencedComponentId - msb - lsb
Iterates all active reference set items and rebuilds indices.
Each *active* item is indexed:
- componentRefsets  : referencedComponentId -- refsetId -- msb -- lsb
- associations      : targetComponentId -- refsetId -- referencedComponentId - msb - lsb
sourceraw docstring

index-relationshipsclj

(index-relationships store)

Iterates all active relationships and rebuilds parent and child indices. Each active relationship is referenced in the 'conceptParentRelationships' and 'conceptChildRelationships' indices.

Iterates all active relationships and rebuilds parent and child indices.
Each *active* relationship is referenced in the 'conceptParentRelationships'
and 'conceptChildRelationships' indices.
sourceraw docstring

installed-reference-setsclj

(installed-reference-sets store)

Returns a set of identifiers representing installed reference sets.

While it is possible to use the SNOMED ontology to find all reference sets:

(get-leaves store (all-children store 900000000000455006))

That might return reference sets with no actual members in the installed edition. Instead, we keep track of installed reference sets as we import reference set items, thus ensuring we have a list that contains only reference sets with members.

Returns a set of identifiers representing installed reference sets.

While it is possible to use the SNOMED ontology to find all reference sets:
  ```
  (get-leaves store (all-children store 900000000000455006))
  ```
That might return reference sets with no actual members in the installed
edition. Instead, we keep track of installed reference sets as we import
reference set items, thus ensuring we have a list that contains only
reference sets with members.
sourceraw docstring

make-dbi-flagsclj

(make-dbi-flags read-only? & flags)
source

map-keys-in-rangeclj

(map-keys-in-range env dbi start-key end-key f)

Returns a vector consisting of the result of applying f to the keys in the inclusive range between start-key and end-key. 'f' is called with a ByteBuf representing a key within the range. While each key should be a vector of longs, comparison is character-wise. As such,minimum long is 0 and maximum long is -1 (FFFF...) and not Long/MIN_VALUE and Long/MAX_VALUE as might be expected.

Returns a vector consisting of the result of applying f to the keys in the
inclusive range between start-key and end-key. 'f' is called with a ByteBuf
representing a key within the range.
While each key should be a vector of longs, comparison is character-wise. As
such,minimum long is 0 and maximum long is -1 (FFFF...) and not Long/MIN_VALUE
 and Long/MAX_VALUE as might be expected.
sourceraw docstring

open-storeclj

(open-store)
(open-store f)
(open-store f opts)
source

put-flagsclj

source

raw-child-relationshipsclj

(raw-child-relationships store concept-id)
(raw-child-relationships store concept-id type-id)

Return the child relationships of the given concept. Returns a vector of tuples [from--type--group--to].

Return the child relationships of the given concept.
Returns a vector of tuples [from--type--group--to].
sourceraw docstring

raw-parent-relationshipsclj

(raw-parent-relationships store concept-id)
(raw-parent-relationships store concept-id type-id)

Return either all parent relationships of the given concept or only those relationships of the given type. Returns a vector of tuples [from--type--group--to].

Return either all parent relationships of the given concept or only those
relationships of the given type.
Returns a vector of tuples [from--type--group--to].
sourceraw docstring

refset-field-namesclj

(refset-field-names store refset-id)

Returns the field names for the given reference set.

The reference set descriptors provide a human-readable description and a type for each column in a reference set, but do not include the camel-cased column identifier in the original source file. On import, we store those column names and provide the lookup here.

Returns the field names for the given reference set.

The reference set descriptors provide a human-readable description and a type
for each column in a reference set, but do not include the camel-cased column
identifier in the original source file. On import, we store those column names
and provide the lookup here.
sourceraw docstring

refset-itemclj

(refset-item store uuid)
(refset-item store msb lsb)

Get the specified refset item. Parameters:

  • store
  • UUID : the UUID of the refset item to fetch
  • msb/lsb : the most and least significant 64-bit longs representing the UUID.
Get the specified refset item.
Parameters:
- store
- UUID  : the UUID of the refset item to fetch
- msb/lsb : the most and least significant 64-bit longs representing the UUID.
sourceraw docstring

relationshipclj

(relationship store relationship-id)
source

source-association-referenced-componentsclj

(source-association-referenced-components store component-id refset-id)

Returns a sequence of component identifiers that reference the specified component in the specified association reference set.

Returns a sequence of component identifiers that reference the specified
component in the specified association reference set.
sourceraw docstring

source-associationsclj

(source-associations store component-id)
(source-associations store component-id refset-id)

Returns the associations in which this component is the target. targetComponentId -- refsetId -- referencedComponentId - itemId1 - itemId2

Returns the associations in which this component is the target.
targetComponentId -- refsetId -- referencedComponentId - itemId1 - itemId2
sourceraw docstring

statisticsclj

(statistics store)

Internal statistics for the store. Returns a sequence with an item per environment

Internal statistics for the store. Returns a sequence with an item per
environment
sourceraw docstring

statusclj

(status store)
source

stream-allclj

(stream-all env dbi ch read-fn)
(stream-all env dbi ch read-fn close?)

Blocking; stream all values from the specified dbi to the channel specified. It would usually be appropriate to run in a background thread.

Blocking; stream all values from the specified dbi to the channel specified.
It would usually be appropriate to run in a background thread.
sourceraw docstring

stream-all-conceptsclj

(stream-all-concepts store ch)
(stream-all-concepts store ch close?)

Streams all concepts to the channel specified, and, by default, closes the channel when done, unless specified.

Streams all concepts to the channel specified, and, by default, closes the
channel when done, unless specified.
sourceraw docstring

stream-all-refset-itemsclj

(stream-all-refset-items store ch)
(stream-all-refset-items store ch close?)
source

write-conceptsclj

(write-concepts store concepts)

Each concept is stored as an entity in the 'concepts' db keyed by identifier.

Each concept is stored as an entity in the 'concepts' db keyed by identifier.
sourceraw docstring

write-concrete-valuesclj

(write-concrete-values store concrete-values)

Write concrete values to the store. Only active concrete values are stored. Inactive concrete values are managed carefully so that if appropriate, previously stored concrete values are deleted.

Write concrete values to the store. Only active concrete values are stored.
Inactive concrete values are managed carefully so that if appropriate,
previously stored concrete values are deleted.
sourceraw docstring

write-descriptionsclj

(write-descriptions store descriptions)

Each description is stored as an entity in the 'descriptions' db, keyed by a tuple of concept-id--description--id.

Each description is referenced in the 'descriptionConcept' index, keyed by description-id--concept-id.

Each description is stored as an entity in the 'descriptions' db, keyed
by a tuple of concept-id--description--id.

Each description is referenced in the 'descriptionConcept' index,
keyed by description-id--concept-id.
sourceraw docstring

write-refset-itemsclj

(write-refset-items store headings items)

Each reference set item is stored as an entity in the 'refsetItems' db, keyed by the UUID, a tuple of msb and lsb.

During import, a record of refset field names is created:

  • refsetFieldNames : refset-id -- field-names (an array of strings)
Each reference set item is stored as an entity in the 'refsetItems' db, keyed
by the UUID, a tuple of msb and lsb.

During import, a record of refset field names is created:
- refsetFieldNames  : refset-id -- field-names (an array of strings)
sourceraw docstring

write-relationshipsclj

(write-relationships store relationships)

Each relationship is stored as an entity in the 'relationships' db, keyed by a relationship-id.

Each relationship is stored as an entity in the 'relationships' db, keyed
by a relationship-id.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close