Class H5Relation

java.lang.Object
nz.org.riskscape.engine.relation.BaseRelation
nz.org.riskscape.hdf5.relation.H5Relation
All Implemented Interfaces:
AutoCloseable, nz.org.riskscape.engine.data.SelfDescribingScalarData, nz.org.riskscape.engine.pipeline.Realized, nz.org.riskscape.engine.relation.Relation

public class H5Relation extends nz.org.riskscape.engine.relation.BaseRelation

A relation that emits tuples formed from values in a one dimensional hdf5 dataset.

  • Nested Class Summary

    Nested classes/interfaces inherited from class nz.org.riskscape.engine.relation.BaseRelation

    nz.org.riskscape.engine.relation.BaseRelation.Fields, nz.org.riskscape.engine.relation.BaseRelation.Transformer
  • Field Summary

    Fields inherited from class nz.org.riskscape.engine.relation.BaseRelation

    skipOnInvalid, transformers
  • Constructor Summary

    Constructors
    Constructor
    Description
    H5Relation(H5Dataset dataset, nz.org.riskscape.engine.types.Struct producedType, Function<H5DatasetCursor,nz.org.riskscape.engine.Tuple> tupleMapper, int cursorSizeMB)
    Creates a relation from a HDF5 dataset.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected nz.org.riskscape.engine.relation.BaseRelation
    clone(nz.org.riskscape.engine.relation.BaseRelation.Fields fields)
     
     
    protected nz.org.riskscape.engine.relation.TupleIterator
     
     

    Methods inherited from class nz.org.riskscape.engine.relation.BaseRelation

    cloneWithProjectionIfSupported, cloneWithRestrictionIfSupported, cloneWithTransformer, getLimit, getOffset, getRawType, getSpatialMetadata, getType, hasSkipOnInvalid, iterator, limitAndOffset, project, restrict, skipInvalid, skipOrThrow, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface nz.org.riskscape.engine.pipeline.Realized

    close

    Methods inherited from interface nz.org.riskscape.engine.relation.Relation

    calculateBounds, getScalarDataType, limit, offset, stream
  • Constructor Details

    • H5Relation

      public H5Relation(H5Dataset dataset, nz.org.riskscape.engine.types.Struct producedType, Function<H5DatasetCursor,nz.org.riskscape.engine.Tuple> tupleMapper, int cursorSizeMB)

      Creates a relation from a HDF5 dataset.

      Parameters:
      dataset - the HDF5 dataset (within file) to produce the relation from
      producedType - the type to be produced by this relation
      tupleMapper - a function that accepts a byte buffer and element index and returns a tuple of producedType
      cursorSizeMB - the size in megabytes of each HDF5 read
  • Method Details

    • rawIterator

      protected nz.org.riskscape.engine.relation.TupleIterator rawIterator()
      Specified by:
      rawIterator in class nz.org.riskscape.engine.relation.BaseRelation
    • clone

      protected nz.org.riskscape.engine.relation.BaseRelation clone(nz.org.riskscape.engine.relation.BaseRelation.Fields fields)
      Specified by:
      clone in class nz.org.riskscape.engine.relation.BaseRelation
    • getSourceInformation

      public String getSourceInformation()
    • size

      public Optional<Long> size()