com.opendatagroup.hadrian.shared

SharedMap

abstract class SharedMap extends AnyRef

An abstract class for shared memory whose update granularity is one item in the map.

Make subclasses of this class for sharing data in different circumstances, such as data shared among JVM processes or among compute nodes in a network, using databases, etc.

The SharedState/SharedMap policy is:

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SharedMap
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SharedMap()

Abstract Value Members

  1. abstract def get(name: String, path: Array[PathIndex]): Either[Exception, Any]

    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

    name of the object to extract (could be a cell or an item of a pool)

    path

    sequence of array indexes, map keys, and record field names to extract

    returns

    a tagged union (Scala Either) of Left(exception object) or Right(result at the end of the path)

  2. abstract def put[X](name: String, path: Array[PathIndex], value: X, initializing: Boolean = false): Either[Exception, X]

    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

    name of the object to replace (could be a cell or an item of a pool)

    path

    sequence of array indexes, map keys, and record field names to dig down to before replacing

    returns

    a tagged union (Scala Either) of Left(exception object) or Right(new value at the end of the path)

  3. abstract def remove(name: String): AnyRef

    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

    name of the object to replace (could be a cell or an item of a pool)

    returns

    old value

  4. abstract def toMap: Map[String, Any]

    Block updates and return a snapshot of the SharedMap at a point in time.

  5. abstract def update[X](name: String, path: Array[PathIndex], initialValue: X, updator: (X) ⇒ X, schema: Schema): Either[Exception, Any]

    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

    name of the object to replace (could be a cell or an item of a pool)

    path

    sequence of array indexes, map keys, and record field names to dig down to before replacing

    initialValue

    value to use it the object does not yet exist

    updator

    function to apply to an existing object to get a new value

    returns

    a tagged union (Scala Either) of Left(exception object) or Right(new value at the end of the path)

Concrete Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def blockUntilInitialized(): Unit

    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.

  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

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

    Definition Classes
    AnyRef → Any
  14. def initialize(names: Set[String], value: (String) ⇒ Any): Unit

    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.

  15. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  20. def toString(): String

    Definition Classes
    AnyRef → Any
  21. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped