com.opendatagroup.hadrian.shared
Methods like get
, put
, etc.
Methods like get
, put
, etc. should wait for initialize
to finish. Concrete implementations should call blockUntilInitialized
first to ensure that the SharedMap
is past the initialization stage.
Returns the item with a given name
at substructure path
if it exists or an exception if there are any errors.
Returns the item with a given name
at substructure path
if it exists or an exception if there are any errors.
Blocks during initialization, but never afterward. If a put
, update
, or remove
is in progress, get
returns the old version of the item; it does not wait for a new version to be provided.
name of the object to extract (could be a cell or an item of a pool)
sequence of array indexes, map keys, and record field names to extract
a tagged union (Scala Either
) of Left(exception object) or Right(result at the end of the path)
The first time a SharedMap
is built, it may need to set up many names at once and ensure that all of these names are installed before any further access.
The first time a SharedMap
is built, it may need to set up many names at once and ensure that all of these names are installed before any further access. This function provides a way to do that.
initialize
only takes effect the first time it is called. After that, it is strictly pass-through.
Replaces or adds an item with a given name
at substructure path
, returning value
if there are no errors or an exception otherwise.
Replaces or adds an item with a given name
at substructure path
, returning value
if there are no errors or an exception otherwise.
Blocks during initialization and during any other update (put
, update
, or remove
). Blocking is at the granularity of a particular item: if another item (with another name
) is being updated, this function does not wait.
put
is a special case of update in which initialValue
is value
and updator
is a function that ignores the input and returns value
.
name of the object to replace (could be a cell or an item of a pool)
sequence of array indexes, map keys, and record field names to dig down to before replacing
a tagged union (Scala Either
) of Left(exception object) or Right(new value at the end of the path)
Removes an item with a given name
.
Removes an item with a given name
.
Blocks during initialization and during any other update (put
, update
, or remove
). Blocking is at the granularity of a particular item: if another item (with another name
) is being updated, this function does not wait.
name of the object to replace (could be a cell or an item of a pool)
old value
Block updates and return a snapshot of the SharedMap
at a point in time.
Block updates and return a snapshot of the SharedMap
at a point in time.
Replaces or adds an item with a given name
at substructure path
with an updator
function (if it exists) or an initialValue
(if it does not), returning the new value if there are no errors or an exception otherwise.
Replaces or adds an item with a given name
at substructure path
with an updator
function (if it exists) or an initialValue
(if it does not), returning the new value if there are no errors or an exception otherwise.
Blocks during initialization and during any other update (put
, update
, or remove
). Blocking is at the granularity of a particular item: if another item (with another name
) is being updated, this function does not wait.
name of the object to replace (could be a cell or an item of a pool)
sequence of array indexes, map keys, and record field names to dig down to before replacing
value to use it the object does not yet exist
function to apply to an existing object to get a new value
a tagged union (Scala Either
) of Left(exception object) or Right(new value at the end of the path)
Concrete subclass of
SharedMap
that implements sharing within one JVM using ajava.util.concurrent.ConcurrentHashMap
.Follows the
SharedMap
concurrency rules (see SharedMap documentation for details).