All Implemented Interfaces:
LogicalOperator, RecordSourceOperator, SourceOperator<RecordPort>

public class ReadMDF extends AbstractReader
Reads data previously written using MDF format. Currently only supports MDF version 4.

  • Constructor Details

    • ReadMDF

      public ReadMDF()
      Reads an empty source with default settings. The source must be set before execution or an error will be raised.
      See Also:
    • ReadMDF

      public ReadMDF(String pattern)
      Reads all paths matching the specified pattern using default options. Any matching path which is a directory is replaced with all files in the directory; this expansion is not recursive.
      Parameters:
      pattern - a path-matching pattern
      See Also:
    • ReadMDF

      public ReadMDF(Path path)
      Reads the file specified by the path. If the path refers to a a directory, all files in the directory are read; this read is not recursive into sub-directories.
      Parameters:
      path - the path to read
    • ReadMDF

      public ReadMDF(ByteSource source)
      Reads the specified data source using default options.
      Parameters:
      source - the data source to read
  • Method Details

    • getVersion

      public MDFUtil.MDFVersion getVersion()
      Sets the expected MDF version
      Returns:
      version of the MDF source
    • setVersion

      public void setVersion(MDFUtil.MDFVersion version)
      Get the expected MDF version
      Parameters:
      version - the version of the MDF source
    • getDataGroup

      public int getDataGroup()
      Sets the data group to read.
      Returns:
      data group to read
    • setDataGroup

      public void setDataGroup(int dataGroup)
      Gets the data group to read.
      Parameters:
      dataGroup - the data group to read
    • getRecordId

      public long getRecordId()
      Gets the record ids to read within the specified data channel. If the record id is unspecified will read the first channel group.
      Returns:
      record ids to read
    • setRecordId

      public void setRecordId(long recordId)
      Sets the record ids to read within the specified data channel. If the record id is unspecified will read the first channel group.
      Parameters:
      recordId - the record id to read
    • getConvertRaw

      public boolean getConvertRaw()
      Get whether the raw values should have any associated conversion rules applied.
      Returns:
      convert raw whether to apply conversion rules
    • setConvertRaw

      public void setConvertRaw(boolean convertRaw)
      Set whether raw values should have any associated conversion rules applied.
      Parameters:
      convertRaw - whether to apply conversion rules
    • getRunMode

      public ReadMDF.ExtractionMode getRunMode()
      Gets the mode that decides what will be extracted from the MDF file. DATA - Extracts the data for the specified record ATTACHMENT - Extracts the raw binary data for any attachments METADATA - Extracts the metadata from the file
      Returns:
      the mode that will be run
    • setRunMode

      public void setRunMode(ReadMDF.ExtractionMode runMode)
      Sets the mode that will decide what will be extracted from the MDF file. DATA - Extracts the data for the specified record ATTACHMENT - Extracts the raw binary data for any attachments METADATA - Extracts the metadata from the file
      Parameters:
      runMode - the mode that will be run
    • getRecordSchema

      public RecordTextSchema<?> getRecordSchema(FileClient fileClient) throws IOException
      Throws:
      IOException
    • computeFormat

      protected DataFormat computeFormat(CompositionContext ctx)
      Description copied from class: AbstractReader
      Determines the data format for the source. The returned format is used during composition to construct a ReadSource operator. If an implementation supports schema discovery, it must be performed in this method.
      Specified by:
      computeFormat in class AbstractReader
      Parameters:
      ctx - the composition context for the current invocation of AbstractReader.compose(CompositionContext)
      Returns:
      the source format to use