public class ArffOutputData
extends org.pentaho.di.trans.step.BaseStepData
implements org.pentaho.di.trans.step.StepDataInterface
Modifier and Type | Field and Description |
---|---|
protected ArffMeta[] |
m_arffMeta |
protected OutputStream |
m_dataOut |
protected boolean |
m_hasEncoding |
protected File |
m_headerFile |
protected OutputStream |
m_headerOut |
protected byte[] |
m_leftCurly |
protected byte[] |
m_missing |
protected byte[] |
m_newLine |
protected Map<String,String>[] |
m_nominalVals |
protected int[] |
m_outputFieldIndexes |
protected org.pentaho.di.core.row.RowMetaInterface |
m_outputRowMeta |
protected boolean |
m_outputSparseInstances
True if sparse data is to be output
|
protected byte[] |
m_rightCurly |
protected byte[] |
m_separator |
protected byte[] |
m_spaceLeftCurly |
protected File |
m_tempFile |
protected int |
m_weightFieldIndex
Index of the field used to set the weight for each instance (-1 means equal
weights)
|
Constructor and Description |
---|
ArffOutputData() |
Modifier and Type | Method and Description |
---|---|
void |
closeFiles()
Flush and close all files
|
void |
finishOutput(String relationName,
String encoding)
Writes the ARFF header and appends the temporary file
|
boolean |
getHasEncoding()
Returns true if a specific character encoding is in use.
|
org.pentaho.di.core.row.RowMetaInterface |
getOutputRowMeta()
Get the meta data for the output format
|
void |
openFiles(String filename)
Open files ready to write to
|
void |
setBinaryMissing(byte[] m)
Set the binary missing value to use
|
void |
setBinaryNewLine(byte[] nl)
Set the binary line terminator to use
|
void |
setBinarySeparator(byte[] s)
Set the binary separator to use
|
void |
setHasEncoding(boolean e)
Set whether an encoding is in use.
|
void |
setOutputFieldIndexes(int[] outputFieldIndexes,
ArffMeta[] arffMeta)
Set the indexes of the fields to output to the ARFF file
|
void |
setOutputRowMeta(org.pentaho.di.core.row.RowMetaInterface rmi)
Set the meta data for the output format
|
void |
setOutputSparseInstances(boolean s)
Set whether to output instances in sparse format
|
void |
setWeightFieldIndex(int index)
Set the index of the field whose values will be used to set the weight for
each instance.
|
void |
writeRow(Object[] r,
String encoding)
Convert and write a row of data to the ARFF file.
|
getStatus, isDisposed, isEmpty, isFinished, isIdle, isInitialising, isRunning, isStopped, setStatus
protected org.pentaho.di.core.row.RowMetaInterface m_outputRowMeta
protected int[] m_outputFieldIndexes
protected boolean m_outputSparseInstances
protected int m_weightFieldIndex
protected ArffMeta[] m_arffMeta
protected File m_tempFile
protected File m_headerFile
protected OutputStream m_dataOut
protected OutputStream m_headerOut
protected byte[] m_separator
protected byte[] m_newLine
protected byte[] m_missing
protected byte[] m_leftCurly
protected byte[] m_spaceLeftCurly
protected byte[] m_rightCurly
protected boolean m_hasEncoding
public org.pentaho.di.core.row.RowMetaInterface getOutputRowMeta()
RowMetaInterface
valuepublic void setOutputRowMeta(org.pentaho.di.core.row.RowMetaInterface rmi)
rmi
- a RowMetaInterface
valuepublic void setHasEncoding(boolean e)
e
- true if an encoding is in usepublic boolean getHasEncoding()
public void setBinaryNewLine(byte[] nl)
nl
- the line terminatorpublic void setBinarySeparator(byte[] s)
s
- binary field separatorpublic void setBinaryMissing(byte[] m)
m
- binary missing valuepublic void setOutputFieldIndexes(int[] outputFieldIndexes, ArffMeta[] arffMeta)
outputFieldIndexes
- array of indexesarffMeta
- array of arff metaspublic void setWeightFieldIndex(int index)
index
- the index of the field to use to set instance-level weights.public void setOutputSparseInstances(boolean s)
s
- true if instances are to be output in sparse formatpublic void openFiles(String filename) throws IOException
filename
- the name of the ARFF file to write toIOException
- if an error occurspublic void writeRow(Object[] r, String encoding) throws IOException, org.pentaho.di.core.exception.KettleStepException
r
- the Kettle rowencoding
- an (optional) character encoding to useIOException
- if an error occursorg.pentaho.di.core.exception.KettleStepException
- if an error occurspublic void finishOutput(String relationName, String encoding) throws org.pentaho.di.core.exception.KettleStepException
relationName
- the ARFF relation nameencoding
- an (optional) character encodingorg.pentaho.di.core.exception.KettleStepException
- if an error occurspublic void closeFiles() throws IOException
IOException
- if an error occursCopyright © 2019 Hitachi Vantara. All rights reserved.