Class

cogx.runtime.checkpoint.hdf5

Hdf5ObjectSaver

Related Doc: package hdf5

Permalink

class Hdf5ObjectSaver extends ObjectSaver with Hdf5Common

Cog ComputeGraph saver based on HDF5

First realize that HDF5 provides considerable flexibility in how ones "web of objects" gets mapped to the HDF5 concepts of groups, datasets, attributes, etc. We have taken the approach of not using attributes and mapping the objects to groups and datasets as follows:

- Primitive values (Ints, Floats, Strings, etc.) are stored each in their own dataset, which is named by the writeXXX() call that wrote the primitive. - Arrays of primitive values are similarly stored each in their own named dataset. Only 1D Arrays are currently supported and the length of the array is stored and can be retrieved from the dataspace of the dataset. - Single Objects are created as a group (which is like a directory in the filesystem analogy) with the name given in the writeObject() call. The primitive data members of the object are stored in datasets that are within the object's group. - Arrays of Objects are created with a two-level group hierarchy. First a group is created that has the name provided by the writeObjectArray() call (e.g. "fields"). Then a special dataSet called "fieldsSize" is created within this group to hold the integer length of the array. Finally, each object of the array is stored in the group under a name that includes the array index (e.g. "fields[3]"). Note that the storing of the individual array objects will add a second level to the group hierarchy.

Note that this scheme permits a nesting of Objects and Arrays[Objects].

By example, assume you had the following class:

class Datapoint { val time: Int, val data: Float }

and instance:

val points = new Array[Datapoint](3)

Assume further that the Datpoint class is set up as a "Saveable" that wrote out its fields with names "time" and "data".

Then the call to writeObjectArray("points", points) would generate the following hdf5 datasets:

points/pointsSize points/points[0]/time points/points[0]/data points/points[1]/time points/points[1]/data points/points[2]/time points/points[2]/data

Note that under the hdf5 root group "/", the following groups were created:

points points/points[0] points/points[1] points/points[2]

Linear Supertypes
Hdf5Common, ObjectSaver, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hdf5ObjectSaver
  2. Hdf5Common
  3. ObjectSaver
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Hdf5ObjectSaver(filename: String)

    Permalink

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. def arrayElementName(name: String, index: Int): String

    Permalink

    How the individual array elements are named in the HDF5 object naming space

    How the individual array elements are named in the HDF5 object naming space

    Definition Classes
    Hdf5Common
  5. def arraySizeName(name: String): String

    Permalink

    How the size of an array is tagged in the HDF5 object naming space

    How the size of an array is tagged in the HDF5 object naming space

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

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def close(): Unit

    Permalink

    Close object store, preventing further writes.

    Close object store, preventing further writes.

    Definition Classes
    Hdf5Common
  9. def createAndEnterGroup(groupName: String): Int

    Permalink

    Create a group and make it the group used by any group-relative commands.

    Create a group and make it the group used by any group-relative commands.

    Definition Classes
    Hdf5Common
  10. def currentGroup: Int

    Permalink

    The most recently created or opened group.

    The most recently created or opened group.

    Definition Classes
    Hdf5Common
  11. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  13. val fileId: Int

    Permalink

    The fileId of the opened (ObjectRestorer) or created (ObjectSaver) file

    The fileId of the opened (ObjectRestorer) or created (ObjectSaver) file

    Definition Classes
    Hdf5ObjectSaverHdf5Common
  14. val fileOpenErrorMsg: String

    Permalink
  15. def finalize(): Unit

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

    Permalink
    Definition Classes
    AnyRef → Any
  17. lazy val groupIdStack: Stack[Int]

    Permalink

    The sequence of opened hdf5 groups, maintained as a stack.

    The sequence of opened hdf5 groups, maintained as a stack.

    Definition Classes
    Hdf5Common
  18. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  19. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  20. def leaveAndCloseGroup(expectedCurrentGroup: Int): Unit

    Permalink

    Close the last created/opened group, making the previous group the one used by any group-relative commands.

    Close the last created/opened group, making the previous group the one used by any group-relative commands.

    Definition Classes
    Hdf5Common
  21. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. def openAndEnterGroup(name: String): Int

    Permalink

    Open an existing group and make it the group used by any group-relative commands.

    Open an existing group and make it the group used by any group-relative commands.

    Definition Classes
    Hdf5Common
  25. def openGroupAbsolutePath(groupName: String): Int

    Permalink

    Open an hdf5 group given its absolute pathname.

    Open an hdf5 group given its absolute pathname.

    Definition Classes
    Hdf5Common
  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  27. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. def writeFloat(name: String, f: Float): Unit

    Permalink

    Write a Float to the object store.

    Write a Float to the object store.

    Definition Classes
    Hdf5ObjectSaverObjectSaver
  32. def writeFloatArray(name: String, fArray: Array[Float]): Unit

    Permalink

    Write an Array[Float] to the object store.

    Write an Array[Float] to the object store.

    Definition Classes
    Hdf5ObjectSaverObjectSaver
  33. def writeInt(name: String, i32: Int): Unit

    Permalink

    Write an Int to the object store.

    Write an Int to the object store.

    Definition Classes
    Hdf5ObjectSaverObjectSaver
  34. def writeIntArray(name: String, i32Array: Array[Int]): Unit

    Permalink

    Write an Array[Int] to the object store.

    Write an Array[Int] to the object store.

    Definition Classes
    Hdf5ObjectSaverObjectSaver
  35. def writeLong(name: String, i64: Long): Unit

    Permalink

    Write an Long to the object store.

    Write an Long to the object store.

    Definition Classes
    Hdf5ObjectSaverObjectSaver
  36. def writeLongArray(name: String, i64Array: Array[Long]): Unit

    Permalink

    Write an Array[Long] to the object store.

    Write an Array[Long] to the object store.

    Definition Classes
    Hdf5ObjectSaverObjectSaver
  37. def writeObject(name: String, saveable: Saveable): Unit

    Permalink

    Write a non-primitive "Saveable" object to the object store.

    Write a non-primitive "Saveable" object to the object store.

    Definition Classes
    Hdf5ObjectSaverObjectSaver
  38. def writeObjectArray(name: String, saveables: Array[_ <: Saveable]): Unit

    Permalink

    Write an Array of non-primitive "Saveable" object to the object store.

    Write an Array of non-primitive "Saveable" object to the object store.

    Definition Classes
    Hdf5ObjectSaverObjectSaver
  39. def writeString(name: String, s: String): Unit

    Permalink

    Write a String to the object store.

    Write a String to the object store.

    Definition Classes
    Hdf5ObjectSaverObjectSaver
  40. def writeStringArray(name: String, sArray: Array[String]): Unit

    Permalink

    Write an Array[String] to the object store.

    Write an Array[String] to the object store.

    Definition Classes
    Hdf5ObjectSaverObjectSaver

Inherited from Hdf5Common

Inherited from ObjectSaver

Inherited from AnyRef

Inherited from Any

Ungrouped