java.lang.Object
com.pervasive.datarush.operators.AbstractLogicalOperator
com.pervasive.datarush.operators.CompositeOperator
com.pervasive.datarush.operators.io.AbstractReader
com.pervasive.datarush.operators.io.mdf.ReadMDF
- All Implemented Interfaces:
LogicalOperator,RecordSourceOperator,SourceOperator<RecordPort>
Reads data previously written using MDF format.
Currently only supports MDF version 4.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.pervasive.datarush.operators.io.AbstractReader
options, output -
Constructor Summary
ConstructorsConstructorDescriptionReadMDF()Reads an empty source with default settings.Reads the file specified by the path.ReadMDF(ByteSource source) Reads the specified data source using default options.Reads all paths matching the specified pattern using default options. -
Method Summary
Modifier and TypeMethodDescriptionprotected DataFormatDetermines the data format for the source.booleanGet whether the raw values should have any associated conversion rules applied.intSets the data group to read.longGets the record ids to read within the specified data channel.getRecordSchema(FileClient fileClient) Gets the mode that decides what will be extracted from the MDF file.Sets the expected MDF versionvoidsetConvertRaw(boolean convertRaw) Set whether raw values should have any associated conversion rules applied.voidsetDataGroup(int dataGroup) Gets the data group to read.voidsetRecordId(long recordId) Sets the record ids to read within the specified data channel.voidsetRunMode(ReadMDF.ExtractionMode runMode) Sets the mode that will decide what will be extracted from the MDF file.voidsetVersion(MDFUtil.MDFVersion version) Get the expected MDF versionMethods inherited from class com.pervasive.datarush.operators.io.AbstractReader
compose, getExtraFieldAction, getFieldErrorAction, getFieldLengthThreshold, getIncludeSourceInfo, getMissingFieldAction, getOutput, getParseOptions, getPessimisticSplitting, getReadBuffer, getReadOnClient, getRecordWarningThreshold, getSelectedFields, getSource, getSplitOptions, getUseMetadata, setExtraFieldAction, setFieldErrorAction, setFieldLengthThreshold, setIncludeSourceInfo, setMissingFieldAction, setParseErrorAction, setParseOptions, setPessimisticSplitting, setReadBuffer, setReadOnClient, setRecordWarningThreshold, setSelectedFields, setSelectedFields, setSource, setSource, setSource, setSplitOptions, setUseMetadataMethods inherited from class com.pervasive.datarush.operators.AbstractLogicalOperator
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyErrorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.pervasive.datarush.operators.LogicalOperator
disableParallelism, getInputPorts, getOutputPorts
-
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
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
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
Reads the specified data source using default options.- Parameters:
source- the data source to read
-
-
Method Details
-
getVersion
Sets the expected MDF version- Returns:
- version of the MDF source
-
setVersion
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
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
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
- Throws:
IOException
-
computeFormat
Description copied from class:AbstractReaderDetermines the data format for the source. The returned format is used during composition to construct aReadSourceoperator. If an implementation supports schema discovery, it must be performed in this method.- Specified by:
computeFormatin classAbstractReader- Parameters:
ctx- the composition context for the current invocation ofAbstractReader.compose(CompositionContext)- Returns:
- the source format to use
-