public class TextFileOutputMeta extends BaseStepMeta implements StepMetaInterface, ResolvableResource
Modifier and Type | Field and Description |
---|---|
protected static int |
FILE_COMPRESSION_TYPE_NONE |
protected static int |
FILE_COMPRESSION_TYPE_ZIP |
protected static String[] |
fileCompressionTypeCodes |
static String[] |
formatMapperLineTerminator |
attributes, databases, ioMeta, log, loggingObject, parentStepMeta, repository, STEP_ATTRIBUTES_FILE
Constructor and Description |
---|
TextFileOutputMeta() |
Modifier and Type | Method and Description |
---|---|
void |
allocate(int nrfields) |
String |
buildFilename(String filename,
String extension,
VariableSpace space,
int stepnr,
String partnr,
int splitnr,
boolean ziparchive,
TextFileOutputMeta meta) |
String |
buildFilename(VariableSpace space,
int stepnr,
String partnr,
int splitnr,
boolean ziparchive) |
void |
check(List<CheckResultInterface> remarks,
TransMeta transMeta,
StepMeta stepMeta,
RowMetaInterface prev,
String[] input,
String[] output,
RowMetaInterface info,
VariableSpace space,
Repository repository,
org.pentaho.metastore.api.IMetaStore metaStore)
Checks the settings of this step and puts the findings in a remarks List.
|
Object |
clone()
Make an exact copy of this step, make sure to explicitly copy Collections etc.
|
String |
exportResources(VariableSpace space,
Map<String,ResourceDefinition> definitions,
ResourceNamingInterface resourceNamingInterface,
Repository repository,
org.pentaho.metastore.api.IMetaStore metaStore)
Since the exported transformation that runs this will reside in a ZIP file, we can't reference files relatively.
|
List<StepInjectionMetaEntry> |
extractStepMetadataEntries() |
String |
getDateTimeFormat() |
String |
getEnclosure() |
String |
getEncoding() |
String |
getEndedLine() |
String |
getExtension() |
void |
getFields(RowMetaInterface inputRowMeta,
String name,
RowMetaInterface[] info,
StepMeta nextStep,
VariableSpace space)
Deprecated.
|
void |
getFields(RowMetaInterface row,
String name,
RowMetaInterface[] info,
StepMeta nextStep,
VariableSpace space,
Repository repository,
org.pentaho.metastore.api.IMetaStore metaStore)
Gets the fields.
|
String |
getFileCompression() |
String |
getFileFormat() |
String |
getFileName() |
String |
getFileNameField() |
String[] |
getFiles(VariableSpace space) |
int |
getFooterShift() |
String |
getNewline() |
String |
getNewLine(String fformat) |
TextFileField[] |
getOutputFields() |
String |
getSeparator() |
int |
getSplitEvery() |
StepInterface |
getStep(StepMeta stepMeta,
StepDataInterface stepDataInterface,
int cnr,
TransMeta transMeta,
Trans trans)
Get the executing step, needed by Trans to launch a step.
|
StepDataInterface |
getStepData()
Get a new instance of the appropriate data class.
|
String |
getXML()
Produces the XML string that describes this step's information.
|
boolean |
isAddToResultFiles() |
boolean |
isCreateParentFolder() |
boolean |
isDateInFilename() |
boolean |
isDoNotOpenNewFileInit() |
boolean |
isEnclosureFixDisabled() |
boolean |
isEnclosureForced() |
boolean |
isFastDump() |
boolean |
isFileAppended() |
boolean |
isFileNameInField() |
boolean |
isFooterEnabled() |
boolean |
isHeaderEnabled() |
boolean |
isPadded() |
boolean |
isPartNrInFilename() |
boolean |
isServletOutput() |
boolean |
isSpecifyingFormat() |
boolean |
isStepNrInFilename() |
boolean |
isTimeInFilename() |
protected String |
loadSource(Node stepnode,
org.pentaho.metastore.api.IMetaStore metastore) |
protected String |
loadSourceRep(Repository rep,
ObjectId id_step,
org.pentaho.metastore.api.IMetaStore metaStore) |
void |
loadXML(Node stepnode,
List<DatabaseMeta> databases,
org.pentaho.metastore.api.IMetaStore metaStore)
Load the values for this step from an XML Node
|
boolean |
passDataToServletOutput()
True if the step passes it's result data straight to the servlet output.
|
void |
readData(Node stepnode) |
protected void |
readData(Node stepnode,
org.pentaho.metastore.api.IMetaStore metastore) |
void |
readRep(Repository rep,
org.pentaho.metastore.api.IMetaStore metaStore,
ObjectId id_step,
List<DatabaseMeta> databases)
Read the steps information from a Kettle repository
|
void |
resolve()
Resolves resource data elements variables and temporary references.
|
protected void |
saveFileOptions(StringBuilder retval) |
void |
saveRep(Repository rep,
org.pentaho.metastore.api.IMetaStore metaStore,
ObjectId id_transformation,
ObjectId id_step)
Save the steps data into a Kettle repository
|
protected void |
saveSource(StringBuilder retVal,
String value) |
protected void |
saveSourceRep(Repository rep,
ObjectId id_transformation,
ObjectId id_step,
String value) |
void |
setAddToResultFiles(boolean addtoresultfilenamesin) |
void |
setCreateParentFolder(boolean createparentfolder) |
void |
setDateInFilename(boolean dateInFilename) |
void |
setDateTimeFormat(String dateTimeFormat) |
void |
setDefault()
Set default values
|
void |
setDoNotOpenNewFileInit(boolean doNotOpenNewFileInit) |
void |
setEnclosure(String enclosure) |
void |
setEnclosureFixDisabled(boolean disableEnclosureFix) |
void |
setEnclosureForced(boolean enclosureForced) |
void |
setEncoding(String encoding) |
void |
setEndedLine(String endedLine) |
void |
setExtension(String extension) |
void |
setFastDump(boolean fastDump) |
void |
setFileAppended(boolean fileAppended) |
void |
setFileCompression(String fileCompression) |
void |
setFileFormat(String fileFormat) |
void |
setFilename(String fileName) |
void |
setFileName(String fileName) |
void |
setFileNameField(String fileNameField) |
void |
setFileNameInField(boolean fileNameInField) |
void |
setFooterEnabled(boolean footer) |
void |
setHeaderEnabled(boolean header) |
void |
setNewline(String newline) |
void |
setOutputFields(TextFileField[] outputFields) |
void |
setPadded(boolean padded) |
void |
setPartNrInFilename(boolean partNrInFilename) |
void |
setSeparator(String separator) |
void |
setServletOutput(boolean servletOutput) |
void |
setSpecifyingFormat(boolean specifyingFormat) |
void |
setSplitEvery(int splitEvery) |
void |
setStepNrInFilename(boolean stepNrInFilename) |
void |
setTimeInFilename(boolean timeInFilename) |
analyseImpact, analyseImpact, cancelQueries, check, check, createEntry, excludeFromCopyDistributeVerification, excludeFromRowLayoutVerification, exportResources, findAttribute, findParent, findParentEntry, getActiveReferencedObjectDescription, getDescription, getDialogClassName, getLog, getLogChannelId, getName, getObjectCopy, getObjectId, getObjectRevision, getObjectType, getOptionalStreams, getParent, getParentStepMeta, getReferencedObjectDescriptions, getRepCode, getRepositoryDirectory, getRequiredFields, getRequiredFields, getResourceDependencies, getSQLStatements, getSQLStatements, getStepInjectionMetadataEntries, 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, supportsErrorHandling
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
analyseImpact, analyseImpact, cancelQueries, check, cleanAfterHopFromRemove, excludeFromCopyDistributeVerification, excludeFromRowLayoutVerification, exportResources, getActiveReferencedObjectDescription, getDialogClassName, getOptionalStreams, getParentStepMeta, getReferencedObjectDescriptions, getRequiredFields, getResourceDependencies, getSQLStatements, getSQLStatements, getStepIOMeta, getStepMetaInjectionInterface, getSupportedTransformationTypes, getTableFields, getUsedArguments, getUsedDatabaseConnections, getUsedLibraries, handleStreamSelection, hasChanged, hasRepositoryReferences, isReferencedObjectEnabled, loadReferencedObject, loadXML, lookupRepositoryReferences, readRep, resetStepIoMeta, saveRep, searchInfoAndTargetSteps, setChanged, setParentStepMeta, supportsErrorHandling
protected static final int FILE_COMPRESSION_TYPE_NONE
protected static final int FILE_COMPRESSION_TYPE_ZIP
protected static final String[] fileCompressionTypeCodes
public static final String[] formatMapperLineTerminator
public boolean isServletOutput()
public void setServletOutput(boolean servletOutput)
public void setCreateParentFolder(boolean createparentfolder)
createparentfolder
- The createparentfolder to set.public boolean isCreateParentFolder()
public boolean isDateInFilename()
public void setDateInFilename(boolean dateInFilename)
dateInFilename
- The dateInFilename to set.public String getEnclosure()
public void setEnclosure(String enclosure)
enclosure
- The enclosure to set.public boolean isEnclosureForced()
public void setEnclosureForced(boolean enclosureForced)
enclosureForced
- The enclosureForced to set.public boolean isEnclosureFixDisabled()
public void setEnclosureFixDisabled(boolean disableEnclosureFix)
enclosureFixDisabled
- The enclosureFixDisabled to set.public String getExtension()
public void setExtension(String extension)
extension
- The extension to set.public boolean isAddToResultFiles()
public void setAddToResultFiles(boolean addtoresultfilenamesin)
addtoresultfilenamesin
- The addtoresultfilenames to set.public boolean isFileAppended()
public void setFileAppended(boolean fileAppended)
fileAppended
- The fileAppended to set.public String getFileFormat()
public void setFileFormat(String fileFormat)
fileFormat
- The fileFormat to set.public String getFileCompression()
public void setFileCompression(String fileCompression)
fileCompression
- The fileCompression to set.public String getFileName()
public void setFileName(String fileName)
fileName
- The fileName to set.public boolean isFooterEnabled()
public void setFooterEnabled(boolean footer)
footer
- The footer to set.public boolean isHeaderEnabled()
public void setHeaderEnabled(boolean header)
header
- The header to set.public String getNewline()
public void setNewline(String newline)
newline
- The newline to set.public boolean isPadded()
public void setPadded(boolean padded)
padded
- The padded to set.public boolean isFastDump()
public void setFastDump(boolean fastDump)
fastDump
- The fastDump to set.public String getSeparator()
public void setSeparator(String separator)
separator
- The separator to set.public boolean isDoNotOpenNewFileInit()
public void setDoNotOpenNewFileInit(boolean doNotOpenNewFileInit)
doNotOpenNewFileInit
- The "do not open new file at init" flag to set.public int getSplitEvery()
public int getFooterShift()
public void setSplitEvery(int splitEvery)
splitEvery
- The splitEvery to set.public boolean isStepNrInFilename()
public void setStepNrInFilename(boolean stepNrInFilename)
stepNrInFilename
- The stepNrInFilename to set.public boolean isPartNrInFilename()
public void setPartNrInFilename(boolean partNrInFilename)
partNrInFilename
- The partNrInFilename to set.public boolean isTimeInFilename()
public void setTimeInFilename(boolean timeInFilename)
timeInFilename
- The timeInFilename to set.public boolean isSpecifyingFormat()
public void setSpecifyingFormat(boolean specifyingFormat)
public String getDateTimeFormat()
public void setDateTimeFormat(String dateTimeFormat)
public TextFileField[] getOutputFields()
public void setOutputFields(TextFileField[] outputFields)
outputFields
- The outputFields to set.public String getEncoding()
public void setEncoding(String encoding)
encoding
- The desired encoding of output file, null or empty if the default system encoding needs to be used.public String getEndedLine()
public void setEndedLine(String endedLine)
endedLine
- The desired last line in the output file, null or empty if nothing has to be added.public boolean isFileNameInField()
public void setFileNameInField(boolean fileNameInField)
fileNameInField
- Is the file name coded in a field?public String getFileNameField()
public void setFileNameField(String fileNameField)
fileNameField
- Name of the field that contains the file namepublic void loadXML(Node stepnode, List<DatabaseMeta> databases, org.pentaho.metastore.api.IMetaStore metaStore) throws KettleXMLException
StepMetaInterface
loadXML
in interface StepMetaInterface
loadXML
in class BaseStepMeta
stepnode
- the Node to get the info fromdatabases
- The available list of databases to reference tometaStore
- the metastore to optionally load external reference metadata fromKettleXMLException
- When an unexpected XML error occurred. (malformed etc.)public void allocate(int nrfields)
public Object clone()
StepMetaInterface
clone
in interface StepMetaInterface
clone
in class BaseStepMeta
protected void readData(Node stepnode, org.pentaho.metastore.api.IMetaStore metastore) throws KettleXMLException
KettleXMLException
public void readData(Node stepnode) throws KettleXMLException
KettleXMLException
public void setDefault()
StepMetaInterface
setDefault
in interface StepMetaInterface
public String[] getFiles(VariableSpace space)
public String buildFilename(VariableSpace space, int stepnr, String partnr, int splitnr, boolean ziparchive)
public String buildFilename(String filename, String extension, VariableSpace space, int stepnr, String partnr, int splitnr, boolean ziparchive, TextFileOutputMeta meta)
public void getFields(RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, org.pentaho.metastore.api.IMetaStore metaStore) throws KettleStepException
BaseStepMeta
getFields
in interface StepMetaInterface
getFields
in class BaseStepMeta
row
- the input row meta that is modified in this method to reflect the output row metadata of the stepname
- Name of the step to use as input for the origin field in the valuesinfo
- Fields used as extra lookup informationnextStep
- the next step that is targetedspace
- the space The variable space to use to replace variablesrepository
- the repository to use to load Kettle metadata objects impacting the output fieldsmetaStore
- the MetaStore to use to load additional external data or metadata impacting the output fieldsKettleStepException
- the kettle step exception@Deprecated public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException
BaseStepMeta
getFields
in interface StepMetaInterface
getFields
in class BaseStepMeta
inputRowMeta
- the input row meta that is modified in this method to reflect the output row metadata of the stepname
- Name of the step to use as input for the origin field in the valuesinfo
- Fields used as extra lookup informationnextStep
- the next step that is targetedspace
- the space The variable space to use to replace variablesKettleStepException
- the kettle step exceptionpublic String getXML()
BaseStepMeta
getXML
in interface StepMetaInterface
getXML
in class BaseStepMeta
protected void saveFileOptions(StringBuilder retval)
public void readRep(Repository rep, org.pentaho.metastore.api.IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases) throws KettleException
StepMetaInterface
readRep
in interface StepMetaInterface
readRep
in class BaseStepMeta
rep
- The repository to read frommetaStore
- The MetaStore to read external information fromid_step
- The step IDdatabases
- The databases to referenceKettleException
- When an unexpected error occurred (database, network, etc)public void saveRep(Repository rep, org.pentaho.metastore.api.IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step) throws KettleException
StepMetaInterface
saveRep
in interface StepMetaInterface
saveRep
in class BaseStepMeta
rep
- The Kettle repository to save tometaStore
- the metaStore to optionally write toid_transformation
- The transformation IDid_step
- The step IDKettleException
- When an unexpected error occurred (database, network, etc)public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository, org.pentaho.metastore.api.IMetaStore metaStore)
StepMetaInterface
check
in interface StepMetaInterface
check
in class BaseStepMeta
remarks
- The list to put the remarks in @see org.pentaho.di.core.CheckResultstepMeta
- The stepMeta to help checkingprev
- The fields coming from the previous stepinput
- The input step namesoutput
- The output step namesinfo
- The fields that are used as information by the stepspace
- the variable space to resolve variable expressions withrepository
- the repository to use to load Kettle metadata objects impacting the output fieldsmetaStore
- the MetaStore to use to load additional external data or metadata impacting the output fieldspublic StepInterface getStep(StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta transMeta, Trans trans)
StepMetaInterface
getStep
in interface StepMetaInterface
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 nr to gettransMeta
- The transformation infotrans
- The launching transformationpublic StepDataInterface getStepData()
StepMetaInterface
getStepData
in interface StepMetaInterface
public String exportResources(VariableSpace space, Map<String,ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository, org.pentaho.metastore.api.IMetaStore metaStore) throws KettleException
exportResources
in interface StepMetaInterface
exportResources
in class BaseStepMeta
space
- the variable space to usedefinitions
- resourceNamingInterface
- repository
- The repository to optionally load other resources from (to be converted to XML)metaStore
- the metaStore in which non-kettle metadata could reside.KettleException
public void setFilename(String fileName)
public List<StepInjectionMetaEntry> extractStepMetadataEntries() throws KettleException
extractStepMetadataEntries
in interface StepMetaInterface
extractStepMetadataEntries
in class BaseStepMeta
KettleException
protected String loadSource(Node stepnode, org.pentaho.metastore.api.IMetaStore metastore)
protected void saveSource(StringBuilder retVal, String value)
protected String loadSourceRep(Repository rep, ObjectId id_step, org.pentaho.metastore.api.IMetaStore metaStore) throws KettleException
KettleException
protected void saveSourceRep(Repository rep, ObjectId id_transformation, ObjectId id_step, String value) throws KettleException
KettleException
public boolean passDataToServletOutput()
passDataToServletOutput
in interface StepMetaInterface
public void resolve()
ResolvableResource
resolve
in interface ResolvableResource
Copyright © 2018 Hitachi Vantara. All rights reserved.