Package org.pentaho.di.arff
Class ArffOutputMeta
- java.lang.Object
-
- org.pentaho.di.trans.step.BaseStepMeta
-
- org.pentaho.di.arff.ArffOutputMeta
-
- All Implemented Interfaces:
Cloneable
,org.pentaho.di.trans.step.StepAttributesInterface
,org.pentaho.di.trans.step.StepMetaInterface
@Step(id="ArffOutput", image="ARFF.svg", name="Arff output", description="Writes data in ARFF format to a file", documentationUrl="https://pentaho-community.atlassian.net/wiki/display/EAI/ARFF+Output", categoryDescription="Data Mining") public class ArffOutputMeta extends org.pentaho.di.trans.step.BaseStepMeta implements org.pentaho.di.trans.step.StepMetaInterface
Contains the meta data for the ArffOutput step.- Version:
- 1.0
- Author:
- Mark Hall (mhall{[at]}pentaho.org)
-
-
Field Summary
Fields Modifier and Type Field Description protected String
m_encoding
protected String
m_fileFormat
protected String
m_fileName
protected String
m_newLine
protected org.pentaho.dm.commons.ArffMeta[]
m_outputFields
protected boolean
m_outputSparseInstances
protected String
m_relationName
protected String
m_weightField
The anme of the field to use to set the weights.protected static Class<?>
PKG
-
Constructor Summary
Constructors Constructor Description ArffOutputMeta()
Creates a newArffOutputMeta
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
allocate(int num)
Allocate an array to hold meta data for the output fieldsvoid
check(List<org.pentaho.di.core.CheckResultInterface> remarks, org.pentaho.di.trans.TransMeta transmeta, org.pentaho.di.trans.step.StepMeta stepMeta, org.pentaho.di.core.row.RowMetaInterface prev, String[] input, String[] output, org.pentaho.di.core.row.RowMetaInterface info)
Check the settings of this step and put findings in a remarks list.Object
clone()
Clone this step's meta databoolean
equals(Object obj)
Check for equalityString
getDialogClassName()
String
getEncoding()
Get the character encoding in usevoid
getFields(org.pentaho.di.core.row.RowMetaInterface row, String origin, org.pentaho.di.core.row.RowMetaInterface[] info, org.pentaho.di.trans.step.StepMeta nextStep, org.pentaho.di.core.variables.VariableSpace space)
Generates row meta data to represent the fields output by this stepString
getFileFormat()
Get the file format in useString
getFileName()
Get the filename of the current ARFF fileprotected String
getNewLine()
org.pentaho.dm.commons.ArffMeta[]
getOutputFields()
Get the meta data for the output fieldsboolean
getOutputSparseInstance()
Get whether to output instances in sparse formatString
getRelationName()
Get the relation name for the current ARFF fileorg.pentaho.di.trans.step.StepInterface
getStep(org.pentaho.di.trans.step.StepMeta stepMeta, org.pentaho.di.trans.step.StepDataInterface stepDataInterface, int cnr, org.pentaho.di.trans.TransMeta tr, org.pentaho.di.trans.Trans trans)
Get the executing step, needed by Trans to launch a step.org.pentaho.di.trans.step.StepDataInterface
getStepData()
Get a new instance of the appropriate data class.String
getWeightFieldName()
Gets the name of the field to use to set instance weights.String
getXML()
Return the XML describing this (configured) stepvoid
loadXML(Node stepnode, List<org.pentaho.di.core.database.DatabaseMeta> databases, Map<String,org.pentaho.di.core.Counter> counters)
Loads the meta data for this (configured) step from XML.void
readRep(org.pentaho.di.repository.Repository rep, org.pentaho.di.repository.ObjectId id_step, List<org.pentaho.di.core.database.DatabaseMeta> databases, Map<String,org.pentaho.di.core.Counter> counters)
Read this step's configuration from a repositoryvoid
saveRep(org.pentaho.di.repository.Repository rep, org.pentaho.di.repository.ObjectId id_transformation, org.pentaho.di.repository.ObjectId id_step)
Save this step's meta data to a repositoryvoid
setDefault()
Set default valuesvoid
setEncoding(String e)
Set the character encoding to usevoid
setFileFormat(String ff)
Set the file format to use (DOS/UNIX)void
setFileName(String fn)
Set the filename to usevoid
setOutputFields(org.pentaho.dm.commons.ArffMeta[] am)
Set the array of meta data for the output fieldsvoid
setOutputSparseIntsances(boolean o)
Set whether to output instances in sparse formatvoid
setRelationName(String r)
Set the relation name to usevoid
setupArffMeta(org.pentaho.di.core.row.RowMetaInterface rmi)
Sets up the ArffMeta array based on the incomming Kettle row format.void
setWeightFieldName(String wfn)
Set the name of the field to use to set instance weights from.-
Methods inherited from class org.pentaho.di.trans.step.BaseStepMeta
analyseImpact, analyseImpact, cancelQueries, check, check, createEntry, excludeFromCopyDistributeVerification, excludeFromRowLayoutVerification, exportResources, exportResources, extractStepMetadataEntries, findAttribute, findParent, findParentEntry, getActiveReferencedObjectDescription, getDescription, getFields, getLog, getLogChannelId, getName, getObjectCopy, getObjectId, getObjectRevision, getObjectType, getOptionalStreams, getParent, getParentStepMeta, getReferencedObjectDescriptions, getRepCode, getRepositoryDirectory, getRequiredFields, getRequiredFields, getResourceDependencies, getSQLStatements, getSQLStatements, getStepInjectionMetadataEntries, getStepIOMeta, getStepIOMeta, getStepMetaInjectionInterface, getSupportedTransformationTypes, getTableFields, getTooltip, getUsedArguments, getUsedDatabaseConnections, getUsedLibraries, getXmlCode, handleStreamSelection, hasChanged, hasRepositoryReferences, isBasic, isDebug, isDetailed, isReferencedObjectEnabled, isRowLevel, loadReferencedObject, loadReferencedObject, loadStepAttributes, loadXML, loadXML, logBasic, logBasic, logDebug, logDebug, logDetailed, logDetailed, logError, logError, logError, logMinimal, logMinimal, logRowlevel, logRowlevel, lookupRepositoryReferences, readRep, readRep, resetStepIoMeta, saveRep, searchInfoAndTargetSteps, setChanged, setChanged, setParentStepMeta, setStepIOMeta, supportsErrorHandling
-
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pentaho.di.trans.step.StepMetaInterface
analyseImpact, analyseImpact, cancelQueries, check, cleanAfterHopFromRemove, cleanAfterHopFromRemove, cleanAfterHopToRemove, excludeFromCopyDistributeVerification, excludeFromRowLayoutVerification, exportResources, exportResources, extractStepMetadataEntries, fetchTransMeta, getActiveReferencedObjectDescription, getFields, getOptionalStreams, getParentStepMeta, getReferencedObjectDescriptions, getRequiredFields, getResourceDependencies, getSQLStatements, getSQLStatements, getStepIOMeta, getStepMetaInjectionInterface, getSupportedTransformationTypes, getTableFields, getUsedArguments, getUsedDatabaseConnections, getUsedLibraries, handleStreamSelection, hasChanged, hasRepositoryReferences, isReferencedObjectEnabled, loadReferencedObject, loadXML, lookupRepositoryReferences, passDataToServletOutput, readRep, resetStepIoMeta, saveRep, searchInfoAndTargetSteps, setChanged, setParentStepMeta, supportsErrorHandling
-
-
-
-
Field Detail
-
PKG
protected static Class<?> PKG
-
m_outputFields
protected org.pentaho.dm.commons.ArffMeta[] m_outputFields
-
m_fileName
protected String m_fileName
-
m_encoding
protected String m_encoding
-
m_newLine
protected String m_newLine
-
m_fileFormat
protected String m_fileFormat
-
m_relationName
protected String m_relationName
-
m_outputSparseInstances
protected boolean m_outputSparseInstances
-
m_weightField
protected String m_weightField
The anme of the field to use to set the weights. Null indicates no weight setting (i.e. equal weights)
-
-
Method Detail
-
allocate
public void allocate(int num)
Allocate an array to hold meta data for the output fields- Parameters:
num
- number of meta data objects to allocate
-
setWeightFieldName
public void setWeightFieldName(String wfn)
Set the name of the field to use to set instance weights from.- Parameters:
wfn
- the name of the field to use to set instance weights or null for equal weights.
-
getWeightFieldName
public String getWeightFieldName()
Gets the name of the field to use to set instance weights.- Returns:
- the name of the field to use or null if all instances are to receive equal weights
-
setOutputSparseIntsances
public void setOutputSparseIntsances(boolean o)
Set whether to output instances in sparse format- Parameters:
o
- true if instances are to be output in sparse format
-
getOutputSparseInstance
public boolean getOutputSparseInstance()
Get whether to output instances in sparse format- Returns:
- true if instances are to be output in sparse format
-
setRelationName
public void setRelationName(String r)
Set the relation name to use- Parameters:
r
- the relation name
-
getRelationName
public String getRelationName()
Get the relation name for the current ARFF file- Returns:
- the relation name
-
setFileName
public void setFileName(String fn)
Set the filename to use- Parameters:
fn
- the filename to use
-
getFileName
public String getFileName()
Get the filename of the current ARFF file- Returns:
- the filename
-
setEncoding
public void setEncoding(String e)
Set the character encoding to use- Parameters:
e
- the character encoding to use
-
getEncoding
public String getEncoding()
Get the character encoding in use- Returns:
- a
String
value
-
setFileFormat
public void setFileFormat(String ff)
Set the file format to use (DOS/UNIX)- Parameters:
ff
- the file format to use
-
getFileFormat
public String getFileFormat()
Get the file format in use- Returns:
- return the file format as a String (DOS or UNIX)
-
setOutputFields
public void setOutputFields(org.pentaho.dm.commons.ArffMeta[] am)
Set the array of meta data for the output fields- Parameters:
am
- an array of ArffMeta
-
getOutputFields
public org.pentaho.dm.commons.ArffMeta[] getOutputFields()
Get the meta data for the output fields- Returns:
- an array of ArffMeta
-
setupArffMeta
public void setupArffMeta(org.pentaho.di.core.row.RowMetaInterface rmi)
Sets up the ArffMeta array based on the incomming Kettle row format.- Parameters:
rmi
- aRowMetaInterface
value
-
getXML
public String getXML()
Return the XML describing this (configured) step- Specified by:
getXML
in interfaceorg.pentaho.di.trans.step.StepMetaInterface
- Overrides:
getXML
in classorg.pentaho.di.trans.step.BaseStepMeta
- Returns:
- a
String
containing the XML
-
loadXML
public void loadXML(Node stepnode, List<org.pentaho.di.core.database.DatabaseMeta> databases, Map<String,org.pentaho.di.core.Counter> counters) throws org.pentaho.di.core.exception.KettleXMLException
Loads the meta data for this (configured) step from XML.- Specified by:
loadXML
in interfaceorg.pentaho.di.trans.step.StepMetaInterface
- Overrides:
loadXML
in classorg.pentaho.di.trans.step.BaseStepMeta
- Parameters:
stepnode
- the step to load- Throws:
org.pentaho.di.core.exception.KettleXMLException
- if an error occurs
-
readRep
public void readRep(org.pentaho.di.repository.Repository rep, org.pentaho.di.repository.ObjectId id_step, List<org.pentaho.di.core.database.DatabaseMeta> databases, Map<String,org.pentaho.di.core.Counter> counters) throws org.pentaho.di.core.exception.KettleException
Read this step's configuration from a repository- Specified by:
readRep
in interfaceorg.pentaho.di.trans.step.StepMetaInterface
- Overrides:
readRep
in classorg.pentaho.di.trans.step.BaseStepMeta
- Parameters:
rep
- the repository to accessid_step
- the id for this step- Throws:
org.pentaho.di.core.exception.KettleException
- if an error occurs
-
saveRep
public void saveRep(org.pentaho.di.repository.Repository rep, org.pentaho.di.repository.ObjectId id_transformation, org.pentaho.di.repository.ObjectId id_step) throws org.pentaho.di.core.exception.KettleException
Save this step's meta data to a repository- Specified by:
saveRep
in interfaceorg.pentaho.di.trans.step.StepMetaInterface
- Overrides:
saveRep
in classorg.pentaho.di.trans.step.BaseStepMeta
- Parameters:
rep
- the repository to save toid_transformation
- transformation idid_step
- step id- Throws:
org.pentaho.di.core.exception.KettleException
- if an error occurs
-
getFields
public void getFields(org.pentaho.di.core.row.RowMetaInterface row, String origin, org.pentaho.di.core.row.RowMetaInterface[] info, org.pentaho.di.trans.step.StepMeta nextStep, org.pentaho.di.core.variables.VariableSpace space) throws org.pentaho.di.core.exception.KettleStepException
Generates row meta data to represent the fields output by this step- Specified by:
getFields
in interfaceorg.pentaho.di.trans.step.StepMetaInterface
- Overrides:
getFields
in classorg.pentaho.di.trans.step.BaseStepMeta
- Parameters:
row
- the meta data for the output producedorigin
- the name of the step to be used as the origininfo
- The input rows metadata that enters the step through the specified channels in the same order as in method getInfoSteps(). The step metadata can then choose what to do with it: ignore it or not.nextStep
- if this is a non-null value, it's the next step in the transformation. The one who's asking, the step where the data is targetted towards.space
- not sure what this is :-)- Throws:
org.pentaho.di.core.exception.KettleStepException
- if an error occurs
-
check
public void check(List<org.pentaho.di.core.CheckResultInterface> remarks, org.pentaho.di.trans.TransMeta transmeta, org.pentaho.di.trans.step.StepMeta stepMeta, org.pentaho.di.core.row.RowMetaInterface prev, String[] input, String[] output, org.pentaho.di.core.row.RowMetaInterface info)
Check the settings of this step and put findings in a remarks list.- Specified by:
check
in interfaceorg.pentaho.di.trans.step.StepMetaInterface
- Overrides:
check
in classorg.pentaho.di.trans.step.BaseStepMeta
- Parameters:
remarks
- the list to put the remarks in. seeorg.pentaho.di.core.CheckResult
transmeta
- the transform meta datastepMeta
- the step meta dataprev
- the fields coming from a previous stepinput
- the input step namesoutput
- the output step namesinfo
- the fields that are used as information by the step
-
equals
public boolean equals(Object obj)
Check for equality
-
clone
public Object clone()
Clone this step's meta data- Specified by:
clone
in interfaceorg.pentaho.di.trans.step.StepMetaInterface
- Overrides:
clone
in classorg.pentaho.di.trans.step.BaseStepMeta
- Returns:
- the cloned meta data
-
setDefault
public void setDefault()
Set default values- Specified by:
setDefault
in interfaceorg.pentaho.di.trans.step.StepMetaInterface
-
getNewLine
protected String getNewLine()
-
getDialogClassName
public String getDialogClassName()
- Specified by:
getDialogClassName
in interfaceorg.pentaho.di.trans.step.StepMetaInterface
- Overrides:
getDialogClassName
in classorg.pentaho.di.trans.step.BaseStepMeta
-
getStep
public org.pentaho.di.trans.step.StepInterface getStep(org.pentaho.di.trans.step.StepMeta stepMeta, org.pentaho.di.trans.step.StepDataInterface stepDataInterface, int cnr, org.pentaho.di.trans.TransMeta tr, org.pentaho.di.trans.Trans trans)
Get the executing step, needed by Trans to launch a step.- Specified by:
getStep
in interfaceorg.pentaho.di.trans.step.StepMetaInterface
- Parameters:
stepMeta
- the step infostepDataInterface
- the step data interface linked to this step. Here the step can store temporary data, database connections, etc.cnr
- the copy number to get.tr
- the transformation info.trans
- the launching transformation- Returns:
- a
StepInterface
value
-
getStepData
public org.pentaho.di.trans.step.StepDataInterface getStepData()
Get a new instance of the appropriate data class. This data class implements the StepDataInterface. It basically contains the persisting data that needs to live on, even if a worker thread is terminated.- Specified by:
getStepData
in interfaceorg.pentaho.di.trans.step.StepMetaInterface
- Returns:
- a
StepDataInterface
value
-
-