本文整理汇总了Java中org.pentaho.di.core.ResultFile类的典型用法代码示例。如果您正苦于以下问题:Java ResultFile类的具体用法?Java ResultFile怎么用?Java ResultFile使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ResultFile类属于org.pentaho.di.core包,在下文中一共展示了ResultFile类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addFileToResultFilenames
import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
private void addFileToResultFilenames(String fileaddentry,LogWriter log,Result result,Job parentJob)
{
try
{
ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject(fileaddentry), parentJob.getJobname(), toString());
result.getResultFiles().put(resultFile.getFile().toString(), resultFile);
if(log.isDebug())
{
log.logDebug(toString()," ------ ");
log.logDebug(toString(),Messages.getString("JobMoveFiles.Log.FileAddedToResultFilesName",fileaddentry));
}
}catch (Exception e)
{
log.logError(Messages.getString("JobMoveFiles.Error.AddingToFilenameResult"),fileaddentry + ""+e.getMessage());
}
}
示例2: addFileToResultFilenames
import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
private void addFileToResultFilenames(String fileaddentry,LogWriter log,Result result,Job parentJob)
{
try
{
ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject(fileaddentry), parentJob.getName(), toString());
result.getResultFiles().put(resultFile.getFile().toString(), resultFile);
if(log.isDetailed())
{
log.logDetailed(toString(),Messages.getString("JobXMLWellFormed.Log.FileAddedToResultFilesName",fileaddentry));
}
}catch (Exception e)
{
log.logError(toString(),Messages.getString("JobXMLWellFormed.Error.AddingToFilenameResult",fileaddentry,e.getMessage()));
}
}
示例3: processRow
import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException
{
if (data.resultFilesList == null || getLinesRead() >= data.resultFilesList.size())
{
setOutputDone();
return false;
}
ResultFile resultFile = (ResultFile) data.resultFilesList.get((int) getLinesRead());
RowMetaAndData r = resultFile.getRow();
data.outputRowMeta = r.getRowMeta();
smi.getFields(data.outputRowMeta, getStepname(), null, null, this);
incrementLinesRead();
putRow(data.outputRowMeta, r.getData()); // copy row to possible alternate
// rowset(s).
if (checkFeedback(getLinesRead()))
logBasic(Messages.getString("FilesFromResult.Log.LineNumber") + getLinesRead()); //$NON-NLS-1$
return true;
}
示例4: getFields
import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
public void getFields(RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException
{
// Add the fields from a ResultFile
try
{
ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject("foo.bar"), "parentOrigin", "origin");
RowMetaAndData add = resultFile.getRow();
// Set the origin on the fields...
for (int i=0;i<add.size();i++) add.getValueMeta(i).setOrigin(name);
r.addRowMeta(add.getRowMeta());
}
catch(IOException e)
{
throw new KettleStepException(e);
}
}
示例5: PrepareFile
import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
private void PrepareFile() throws IOException
{
String filename=environmentSubstitute(meta.getFilename());
if(meta.isAddToResultFiles())
{
// Add this to the result file names...
ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject(filename), getTransMeta().getName(), getStepname());
resultFile.setComment("This file was created with a cube file output step");
addResultFile(resultFile);
}
data.fos=KettleVFS.getOutputStream(filename, false);
data.zip=new GZIPOutputStream(data.fos);
data.dos=new DataOutputStream(data.zip);
}
示例6: ok
import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
private void ok()
{
if (Const.isEmpty(wStepname.getText())) return;
stepname = wStepname.getText(); // return value
input.setFilenameField(wFilenameField.getText());
if (wTypes.getSelectionIndex()>=0)
{
input.setFileType( wTypes.getSelectionIndex() );
}
else
{
input.setFileType( ResultFile.FILE_TYPE_GENERAL );
}
dispose();
}
示例7: addFileToResultFilenames
import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
private void addFileToResultFilenames(String fileaddentry,Result result,Job parentJob)
{
try
{
ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject(fileaddentry, this), parentJob.getJobname(), toString());
result.getResultFiles().put(resultFile.getFile().toString(), resultFile);
if(log.isDebug())
{
logDebug(" ------ ");
logDebug(BaseMessages.getString(PKG, "JobMoveFiles.Log.FileAddedToResultFilesName",fileaddentry));
}
}catch (Exception e)
{
log.logError(BaseMessages.getString(PKG, "JobMoveFiles.Error.AddingToFilenameResult"),fileaddentry + ""+e.getMessage());
}
}
示例8: addFileToResultFilenames
import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
private void addFileToResultFilenames(String fileaddentry,Result result,Job parentJob)
{
try
{
ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject(fileaddentry, this), parentJob.getName(), toString());
result.getResultFiles().put(resultFile.getFile().toString(), resultFile);
if(log.isDetailed())
{
logDetailed(BaseMessages.getString(PKG, "JobXMLWellFormed.Log.FileAddedToResultFilesName",fileaddentry));
}
}catch (Exception e)
{
logError(BaseMessages.getString(PKG, "JobXMLWellFormed.Error.AddingToFilenameResult",fileaddentry,e.getMessage()));
}
}
示例9: processRow
import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException
{
if (data.resultFilesList == null || getLinesRead() >= data.resultFilesList.size())
{
setOutputDone();
return false;
}
ResultFile resultFile = (ResultFile) data.resultFilesList.get((int) getLinesRead());
RowMetaAndData r = resultFile.getRow();
if (first) {
first=false;
data.outputRowMeta = new RowMeta();
smi.getFields(data.outputRowMeta, getStepname(), null, null, this);
}
incrementLinesRead();
putRow(data.outputRowMeta, r.getData()); // copy row to possible alternate
// rowset(s).
if (checkFeedback(getLinesRead()))
logBasic(BaseMessages.getString(PKG, "FilesFromResult.Log.LineNumber") + getLinesRead()); //$NON-NLS-1$
return true;
}
示例10: getFields
import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
public void getFields(RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException
{
// Add the fields from a ResultFile
try
{
ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject("foo.bar", space), "parentOrigin", "origin");
RowMetaAndData add = resultFile.getRow();
// Set the origin on the fields...
for (int i=0;i<add.size();i++) add.getValueMeta(i).setOrigin(name);
r.addRowMeta(add.getRowMeta());
}
catch(KettleFileException e)
{
throw new KettleStepException(e);
}
}
示例11: prepareFile
import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
private void prepareFile() throws KettleFileException
{
try {
String filename=environmentSubstitute(meta.getFilename());
if(meta.isAddToResultFiles())
{
// Add this to the result file names...
ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject(filename, getTransMeta()), getTransMeta().getName(), getStepname());
resultFile.setComment("This file was created with a cube file output step");
addResultFile(resultFile);
}
data.fos=KettleVFS.getOutputStream(filename, getTransMeta(), false);
data.zip=new GZIPOutputStream(data.fos);
data.dos=new DataOutputStream(data.zip);
}
catch(Exception e) {
throw new KettleFileException(e);
}
}
示例12: testCollectExecutionResultFilesDisabledHop
import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
@Test
public void testCollectExecutionResultFilesDisabledHop() throws KettleException {
Result result = mock( Result.class );
ResultFile resultFile = mock( ResultFile.class, RETURNS_DEEP_STUBS );
when( result.getResultFilesList() ).thenReturn( Arrays.asList( resultFile ) );
StepMeta resultFilesTargetStepMeta = mock( StepMeta.class );
meta.setResultFilesTargetStepMeta( resultFilesTargetStepMeta );
RowMetaInterface resultFilesOutputRowMeta = mock( RowMetaInterface.class );
data.setResultFilesOutputRowMeta( resultFilesOutputRowMeta );
doNothing().when( executor ).putRowTo( any(), any(), any() );
executor.init( meta, data );
executor.collectExecutionResultFiles( result );
verify( executor, never() ).putRowTo( any(), any(), any() );
}
示例13: ok
import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
private void ok() {
if ( Utils.isEmpty( wStepname.getText() ) ) {
return;
}
stepname = wStepname.getText(); // return value
input.setFilenameField( wFilenameField.getText() );
if ( wTypes.getSelectionIndex() >= 0 ) {
input.setFileType( wTypes.getSelectionIndex() );
} else {
input.setFileType( ResultFile.FILE_TYPE_GENERAL );
}
dispose();
}
示例14: testStepMeta
import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
@Test
public void testStepMeta() throws KettleException {
List<String> attributes = Arrays.asList( "filename_field", "file_type" );
Map<String, String> getterMap = new HashMap<String, String>();
getterMap.put( "filename_field", "getFilenameField" );
getterMap.put( "file_type", "getFileType" );
Map<String, String> setterMap = new HashMap<String, String>();
setterMap.put( "filename_field", "setFilenameField" );
setterMap.put( "file_type", "setFileType" );
Map<String, FieldLoadSaveValidator<?>> fieldLoadSaveValidatorAttributeMap =
new HashMap<String, FieldLoadSaveValidator<?>>();
fieldLoadSaveValidatorAttributeMap.put( "file_type",
new IntLoadSaveValidator( ResultFile.fileTypeCode.length ) );
LoadSaveTester loadSaveTester =
new LoadSaveTester( FilesToResultMeta.class, attributes, getterMap, setterMap,
fieldLoadSaveValidatorAttributeMap, new HashMap<String, FieldLoadSaveValidator<?>>() );
loadSaveTester.testSerialization();
}
示例15: processRow
import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException {
if ( data.resultFilesList == null || getLinesRead() >= data.resultFilesList.size() ) {
setOutputDone();
return false;
}
ResultFile resultFile = data.resultFilesList.get( (int) getLinesRead() );
RowMetaAndData r = resultFile.getRow();
if ( first ) {
first = false;
data.outputRowMeta = new RowMeta();
smi.getFields( data.outputRowMeta, getStepname(), null, null, this, repository, metaStore );
}
incrementLinesRead();
putRow( data.outputRowMeta, r.getData() ); // copy row to possible alternate
// rowset(s).
if ( checkFeedback( getLinesRead() ) ) {
logBasic( BaseMessages.getString( PKG, "FilesFromResult.Log.LineNumber" ) + getLinesRead() );
}
return true;
}