本文整理汇总了Java中org.pentaho.di.core.playlist.FilePlayListAll类的典型用法代码示例。如果您正苦于以下问题:Java FilePlayListAll类的具体用法?Java FilePlayListAll怎么用?Java FilePlayListAll使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FilePlayListAll类属于org.pentaho.di.core.playlist包,在下文中一共展示了FilePlayListAll类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createDataObject
import org.pentaho.di.core.playlist.FilePlayListAll; //导入依赖的package包/类
private TextFileInputData createDataObject( String file,
String separator,
String... outputFields ) throws Exception {
TextFileInputData data = new TextFileInputData();
data.files = new FileInputList();
data.files.addFile( KettleVFS.getFileObject( file ) );
data.separator = separator;
data.outputRowMeta = new RowMeta();
if ( outputFields != null ) {
for ( String field : outputFields ) {
data.outputRowMeta.addValueMeta( new ValueMetaString( field ) );
}
}
data.dataErrorLineHandler = mock( FileErrorHandler.class );
data.fileFormatType = TextFileInputMeta.FILE_FORMAT_UNIX;
data.filterProcessor = new TextFileFilterProcessor( new TextFileFilter[ 0 ], new Variables() );
data.filePlayList = new FilePlayListAll();
return data;
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:23,代码来源:TextFileInputTest.java
示例2: initReplayFactory
import org.pentaho.di.core.playlist.FilePlayListAll; //导入依赖的package包/类
private void initReplayFactory()
{
Date replayDate = getTrans().getReplayDate();
if (replayDate == null)
data.filePlayList = FilePlayListAll.INSTANCE;
else
data.filePlayList = new FilePlayListReplay(replayDate, meta.getLineNumberFilesDestinationDirectory(), meta.getLineNumberFilesExtension(), meta.getErrorFilesDestinationDirectory(), meta
.getErrorFilesExtension(), "Latin1");
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:10,代码来源:ExcelInput.java
示例3: initReplayFactory
import org.pentaho.di.core.playlist.FilePlayListAll; //导入依赖的package包/类
private void initReplayFactory()
{
Date replayDate = getTrans().getReplayDate();
if (replayDate == null) data.filePlayList = FilePlayListAll.INSTANCE;
else data.filePlayList = new FilePlayListReplay(replayDate, meta.getLineNumberFilesDestinationDirectory(),
meta.getLineNumberFilesExtension(), meta.getErrorFilesDestinationDirectory(), meta.getErrorLineFilesExtension(), meta.getEncoding());
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:8,代码来源:TextFileInput.java
示例4: initReplayFactory
import org.pentaho.di.core.playlist.FilePlayListAll; //导入依赖的package包/类
private void initReplayFactory()
{
Date replayDate = getTrans().getReplayDate();
if (replayDate == null)
data.filePlayList = FilePlayListAll.INSTANCE;
else
data.filePlayList = new FilePlayListReplay(replayDate, environmentSubstitute(meta.getLineNumberFilesDestinationDirectory()), meta.getLineNumberFilesExtension(), environmentSubstitute(meta.getErrorFilesDestinationDirectory()), meta
.getErrorFilesExtension(), "Latin1");
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:10,代码来源:ExcelInput.java
示例5: init
import org.pentaho.di.core.playlist.FilePlayListAll; //导入依赖的package包/类
@Override
public boolean init() {
Date replayDate = getTrans().getReplayDate();
if ( replayDate == null ) {
data.filePlayList = FilePlayListAll.INSTANCE;
} else {
data.filePlayList =
new FilePlayListReplay( replayDate, meta.errorHandling.lineNumberFilesDestinationDirectory,
meta.errorHandling.lineNumberFilesExtension, meta.errorHandling.errorFilesDestinationDirectory,
meta.errorHandling.errorFilesExtension, meta.content.encoding );
}
data.filterProcessor = new TextFileFilterProcessor( meta.getFilter(), this );
// calculate the file format type in advance so we can use a switch
data.fileFormatType = meta.getFileFormatTypeNr();
// calculate the file type in advance CSV or Fixed?
data.fileType = meta.getFileTypeNr();
// Handle the possibility of a variable substitution
data.separator = environmentSubstitute( meta.content.separator );
data.enclosure = environmentSubstitute( meta.content.enclosure );
data.escapeCharacter = environmentSubstitute( meta.content.escapeCharacter );
// CSV without separator defined
if ( meta.content.fileType.equalsIgnoreCase( "CSV" ) && ( meta.content.separator == null || meta.content.separator
.isEmpty() ) ) {
logError( BaseMessages.getString( PKG, "TextFileInput.Exception.NoSeparator" ) );
return false;
}
return true;
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:34,代码来源:TextFileInput.java
示例6: initReplayFactory
import org.pentaho.di.core.playlist.FilePlayListAll; //导入依赖的package包/类
private void initReplayFactory() {
Date replayDate = getTrans().getReplayDate();
if ( replayDate == null ) {
data.filePlayList = FilePlayListAll.INSTANCE;
} else {
data.filePlayList =
new FilePlayListReplay(
replayDate, environmentSubstitute( meta.getLineNumberFilesDestinationDirectory() ), meta
.getLineNumberFilesExtension(),
environmentSubstitute( meta.getErrorFilesDestinationDirectory() ), meta.getErrorFilesExtension(),
"Latin1" );
}
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:14,代码来源:ExcelInput.java
示例7: initReplayFactory
import org.pentaho.di.core.playlist.FilePlayListAll; //导入依赖的package包/类
private void initReplayFactory() {
Date replayDate = getTrans().getReplayDate();
if ( replayDate == null ) {
data.filePlayList = FilePlayListAll.INSTANCE;
} else {
data.filePlayList =
new FilePlayListReplay( replayDate, meta.getLineNumberFilesDestinationDirectory(), meta
.getLineNumberFilesExtension(), meta.getErrorFilesDestinationDirectory(), meta
.getErrorLineFilesExtension(), meta.getEncoding() );
}
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:12,代码来源:TextFileInput.java
示例8: readWrappedInputWithoutHeaders
import org.pentaho.di.core.playlist.FilePlayListAll; //导入依赖的package包/类
@Test
public void readWrappedInputWithoutHeaders() throws Exception {
final String content = new StringBuilder()
.append( "r1c1" ).append( '\n' ).append( ";r1c2\n" )
.append( "r2c1" ).append( '\n' ).append( ";r2c2" )
.toString();
final String virtualFile = createVirtualFile( "pdi-2607.txt", content );
TextFileInputMeta meta = new TextFileInputMeta();
meta.setLineWrapped( true );
meta.setNrWraps( 1 );
meta.setInputFields( new TextFileInputField[] { field( "col1" ), field( "col2" ) } );
meta.setFileCompression( "None" );
meta.setFileType( "CSV" );
meta.setHeader( false );
meta.setNrHeaderLines( -1 );
meta.setFooter( false );
meta.setNrFooterLines( -1 );
TextFileInputData data = new TextFileInputData();
data.setFiles( new FileInputList() );
data.getFiles().addFile( KettleVFS.getFileObject( virtualFile ) );
data.outputRowMeta = new RowMeta();
data.outputRowMeta.addValueMeta( new ValueMetaString( "col1" ) );
data.outputRowMeta.addValueMeta( new ValueMetaString( "col2" ) );
data.dataErrorLineHandler = Mockito.mock( FileErrorHandler.class );
data.fileFormatType = TextFileInputMeta.FILE_FORMAT_UNIX;
data.separator = ";";
data.filterProcessor = new TextFileFilterProcessor( new TextFileFilter[ 0 ] );
data.filePlayList = new FilePlayListAll();
TextFileInput input = StepMockUtil.getStep( TextFileInput.class, TextFileInputMeta.class, "test" );
List<Object[]> output = TransTestingUtil.execute( input, meta, data, 2, false );
TransTestingUtil.assertResult( new Object[] { "r1c1", "r1c2" }, output.get( 0 ) );
TransTestingUtil.assertResult( new Object[] { "r2c1", "r2c2" }, output.get( 1 ) );
deleteVfsFile( virtualFile );
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:41,代码来源:TextFileInputTest.java
示例9: readInputWithMissedValues
import org.pentaho.di.core.playlist.FilePlayListAll; //导入依赖的package包/类
@Test
public void readInputWithMissedValues() throws Exception {
final String virtualFile = createVirtualFile( "pdi-14172.txt", "1,1,1\n", "2,,2\n" );
TextFileInputMeta meta = new TextFileInputMeta();
TextFileInputField field2 = field( "col2" );
field2.setRepeated( true );
meta.setInputFields( new TextFileInputField[] {
field( "col1" ), field2, field( "col3" )
} );
meta.setFileCompression( "None" );
meta.setFileType( "CSV" );
meta.setHeader( false );
meta.setNrHeaderLines( -1 );
meta.setFooter( false );
meta.setNrFooterLines( -1 );
TextFileInputData data = new TextFileInputData();
data.setFiles( new FileInputList() );
data.getFiles().addFile( KettleVFS.getFileObject( virtualFile ) );
data.outputRowMeta = new RowMeta();
data.outputRowMeta.addValueMeta( new ValueMetaString( "col1" ) );
data.outputRowMeta.addValueMeta( new ValueMetaString( "col2" ) );
data.outputRowMeta.addValueMeta( new ValueMetaString( "col3" ) );
data.dataErrorLineHandler = Mockito.mock( FileErrorHandler.class );
data.fileFormatType = TextFileInputMeta.FILE_FORMAT_UNIX;
data.separator = ",";
data.filterProcessor = new TextFileFilterProcessor( new TextFileFilter[ 0 ] );
data.filePlayList = new FilePlayListAll();
TextFileInput input = StepMockUtil.getStep( TextFileInput.class, TextFileInputMeta.class, "test" );
List<Object[]> output = TransTestingUtil.execute( input, meta, data, 2, false );
TransTestingUtil.assertResult( new Object[] { "1", "1", "1" }, output.get( 0 ) );
TransTestingUtil.assertResult( new Object[] { "2", "1", "2" }, output.get( 1 ) );
deleteVfsFile( virtualFile );
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:41,代码来源:TextFileInputTest.java
示例10: readInputWithDefaultValues
import org.pentaho.di.core.playlist.FilePlayListAll; //导入依赖的package包/类
@Test
public void readInputWithDefaultValues() throws Exception {
final String virtualFile = createVirtualFile( "pdi-14832.txt", "1,\n" );
TextFileInputMeta meta = new TextFileInputMeta();
TextFileInputField field2 = field( "col2" );
field2.setIfNullValue( "DEFAULT" );
meta.setInputFields( new TextFileInputField[] { field( "col1" ), field2 } );
meta.setFileCompression( "None" );
meta.setFileType( "CSV" );
meta.setHeader( false );
meta.setNrHeaderLines( -1 );
meta.setFooter( false );
meta.setNrFooterLines( -1 );
TextFileInputData data = new TextFileInputData();
data.setFiles( new FileInputList() );
data.getFiles().addFile( KettleVFS.getFileObject( virtualFile ) );
data.outputRowMeta = new RowMeta();
data.outputRowMeta.addValueMeta( new ValueMetaString( "col1" ) );
data.outputRowMeta.addValueMeta( new ValueMetaString( "col2" ) );
data.dataErrorLineHandler = Mockito.mock( FileErrorHandler.class );
data.fileFormatType = TextFileInputMeta.FILE_FORMAT_UNIX;
data.separator = ",";
data.filterProcessor = new TextFileFilterProcessor( new TextFileFilter[ 0 ] );
data.filePlayList = new FilePlayListAll();
TextFileInput input = StepMockUtil.getStep( TextFileInput.class, TextFileInputMeta.class, "test" );
List<Object[]> output = TransTestingUtil.execute( input, meta, data, 1, false );
TransTestingUtil.assertResult( new Object[] { "1", "DEFAULT" }, output.get( 0 ) );
deleteVfsFile( virtualFile );
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:36,代码来源:TextFileInputTest.java
示例11: testMinimalWidth_PDI_14253
import org.pentaho.di.core.playlist.FilePlayListAll; //导入依赖的package包/类
@Test
public void testMinimalWidth_PDI_14253() throws Exception {
final String virtualFile = "ram://pdi-14253.txt";
KettleVFS.getFileObject( virtualFile ).createFile();
final String content = "r1c1, r1c2\nr2c1 , r2c2 ";
ByteArrayOutputStream bos = new ByteArrayOutputStream();
bos.write( content.getBytes() );
OutputStream os = KettleVFS.getFileObject( virtualFile ).getContent().getOutputStream();
IOUtils.copy( new ByteArrayInputStream( bos.toByteArray() ), os );
os.close();
TextFileInputMeta meta = new TextFileInputMeta();
meta.content.lineWrapped = false;
meta.inputFields = new BaseFileField[]{
new BaseFileField( "col1", -1, -1 ),
new BaseFileField( "col2", -1, -1 )
};
meta.content.fileCompression = "None";
meta.content.fileType = "CSV";
meta.content.header = false;
meta.content.nrHeaderLines = -1;
meta.content.footer = false;
meta.content.nrFooterLines = -1;
TextFileInputData data = new TextFileInputData();
data.files = new FileInputList();
data.files.addFile( KettleVFS.getFileObject( virtualFile ) );
data.outputRowMeta = new RowMeta();
data.outputRowMeta.addValueMeta( new ValueMetaString( "col1" ) );
data.outputRowMeta.addValueMeta( new ValueMetaString( "col2" ) );
data.dataErrorLineHandler = mock( FileErrorHandler.class );
data.fileFormatType = TextFileInputMeta.FILE_FORMAT_UNIX;
data.separator = ",";
data.filterProcessor = new TextFileFilterProcessor( new TextFileFilter[0], new Variables() { } );
data.filePlayList = new FilePlayListAll();
TextFileInputDialog dialog =
new TextFileInputDialog( mock( Shell.class ), meta, mock( TransMeta.class ), "TFIMinimalWidthTest" );
TableView tv = mock( TableView.class );
when( tv.nrNonEmpty() ).thenReturn( 0 );
// click the Minimal width button
dialog.setMinimalWidth( tv );
RowSet output = new BlockingRowSet( 5 );
TextFileInput input = StepMockUtil.getStep( TextFileInput.class, TextFileInputMeta.class, "test" );
input.setOutputRowSets( Collections.singletonList( output ) );
while ( input.processRow( meta, data ) ) {
// wait until the step completes executing
}
Object[] row1 = output.getRowImmediate();
assertRow( row1, "r1c1", "r1c2" );
Object[] row2 = output.getRowImmediate();
assertRow( row2, "r2c1", "r2c2" );
KettleVFS.getFileObject( virtualFile ).delete();
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:65,代码来源:TextFileInputDialogTest.java
注:本文中的org.pentaho.di.core.playlist.FilePlayListAll类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论