本文整理汇总了Java中org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta类的典型用法代码示例。如果您正苦于以下问题:Java RowGeneratorMeta类的具体用法?Java RowGeneratorMeta怎么用?Java RowGeneratorMeta使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RowGeneratorMeta类属于org.pentaho.di.trans.steps.rowgenerator包,在下文中一共展示了RowGeneratorMeta类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ok
import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
private void ok()
{
if (Const.isEmpty(wStepname.getText())) return;
stepname = wStepname.getText(); // return value
try
{
getInfo(new RowGeneratorMeta()); // to see if there is an exception
getInfo(input); // to put the content on the input structure for real if all is well.
dispose();
}
catch(KettleException e)
{
new ErrorDialog(shell, Messages.getString("RowGeneratorDialog.Illegal.Dialog.Settings.Title"), Messages.getString("RowGeneratorDialog.Illegal.Dialog.Settings.Message"), e);
}
}
示例2: ok
import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
private void ok()
{
if (Const.isEmpty(wStepname.getText())) return;
stepname = wStepname.getText(); // return value
try
{
getInfo(new RowGeneratorMeta()); // to see if there is an exception
getInfo(input); // to put the content on the input structure for real if all is well.
dispose();
}
catch(KettleException e)
{
new ErrorDialog(shell, BaseMessages.getString(PKG, "RowGeneratorDialog.Illegal.Dialog.Settings.Title"), BaseMessages.getString(PKG, "RowGeneratorDialog.Illegal.Dialog.Settings.Message"), e);
}
}
示例3: createRowGeneratorStep
import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
/**
* Creates a row generator step for this class..
*
* @param name
* @param registry
* @return
*/
private StepMeta createRowGeneratorStep(String name, PluginRegistry registry) {
// Default the name if it is empty
String testFileOutputName = (Const.isEmpty(name)?"generate rows":name);
// create the RowGenerator and Step Meta
RowGeneratorMeta rowGeneratorMeta = new RowGeneratorMeta();
String rowGeneratorPid = registry.getPluginId(StepPluginType.class, rowGeneratorMeta);
StepMeta generateRowsStep = new StepMeta(rowGeneratorPid, testFileOutputName, rowGeneratorMeta);
// Set the field names, types and values
rowGeneratorMeta.setFieldName(new String[]{"Id", "State", "City"});
rowGeneratorMeta.setFieldType(new String[]{"Integer", "String", "String"});
rowGeneratorMeta.setValue(new String[]{"1", "Florida", "Orlando"});
rowGeneratorMeta.setFieldLength(new int[]{-1, -1, -1});
rowGeneratorMeta.setFieldPrecision(new int[]{-1, -1, -1});
rowGeneratorMeta.setGroup(new String[]{"", "", ""});
rowGeneratorMeta.setDecimal(new String[]{"", "", ""});
rowGeneratorMeta.setFieldFormat(new String[]{"", "", ""});
rowGeneratorMeta.setRowLimit("10");
// return the step meta
return generateRowsStep;
}
示例4: createRowGeneratorStep
import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
/**
* Creates a row generator step for this class..
*
* @param name
* @param registry
* @return
*/
private StepMeta createRowGeneratorStep(String name, PluginRegistry registry) {
// Default the name if it is empty
String testFileOutputName = (Const.isEmpty(name)?"generate rows":name);
// create the RowGenerator and Step Meta
RowGeneratorMeta rowGeneratorMeta = new RowGeneratorMeta();
String rowGeneratorPid = registry.getPluginId(StepPluginType.class, rowGeneratorMeta);
StepMeta generateRowsStep = new StepMeta(rowGeneratorPid, testFileOutputName, rowGeneratorMeta);
// Set the field names, types and values
rowGeneratorMeta.setFieldName(new String[]{"Id", "State", "City"});
rowGeneratorMeta.setFieldType(new String[]{"Integer", "String", "String"});
rowGeneratorMeta.setValue(new String[]{"1", "Orlando", "Florida"});
rowGeneratorMeta.setFieldLength(new int[]{-1, -1, -1});
rowGeneratorMeta.setFieldPrecision(new int[]{-1, -1, -1});
rowGeneratorMeta.setGroup(new String[]{"", "", ""});
rowGeneratorMeta.setDecimal(new String[]{"", "", ""});
rowGeneratorMeta.setCurrency(new String[]{"", "", ""});
rowGeneratorMeta.setFieldFormat(new String[]{"", "", ""});
rowGeneratorMeta.setRowLimit("10");
// return the step meta
return generateRowsStep;
}
示例5: createRowGeneratorStep
import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
/**
* Creates a row generator step for this class..
*
* @param name
* @param registry
* @return
*/
private StepMeta createRowGeneratorStep(String name, PluginRegistry registry) {
// Default the name if it is empty
String testFileOutputName = (Const.isEmpty(name)?"generate rows":name);
// create the RowGenerator and Step Meta
RowGeneratorMeta rowGeneratorMeta = new RowGeneratorMeta();
String rowGeneratorPid = registry.getPluginId(StepPluginType.class, rowGeneratorMeta);
StepMeta generateRowsStep = new StepMeta(rowGeneratorPid, testFileOutputName, rowGeneratorMeta);
// Set the field names, types and values
rowGeneratorMeta.setFieldName(new String[]{"Id", "State", "City"});
rowGeneratorMeta.setFieldType(new String[]{"Integer", "String", "String"});
rowGeneratorMeta.setValue(new String[]{"1", "Florida", "Orlando"});
rowGeneratorMeta.setFieldLength(new int[]{-1, -1, -1});
rowGeneratorMeta.setFieldPrecision(new int[]{-1, -1, -1});
rowGeneratorMeta.setGroup(new String[]{"", "", ""});
rowGeneratorMeta.setDecimal(new String[]{"", "", ""});
rowGeneratorMeta.setCurrency(new String[]{"", "", ""});
rowGeneratorMeta.setFieldFormat(new String[]{"", "", ""});
rowGeneratorMeta.setRowLimit("10");
// return the step meta
return generateRowsStep;
}
示例6: createPDI14676Transformation
import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
private String createPDI14676Transformation() throws IOException, KettleException {
// Setup Transformation
String rowGenStepName = "Generate Rows";
RowGeneratorMeta rowGenMeta = new RowGeneratorMeta();
rowGenMeta.setRowLimit( String.valueOf( Integer.MAX_VALUE ) );
rowGenMeta.setNeverEnding( true );
rowGenMeta.setIntervalInMs( "0" );
rowGenMeta.allocate( 0 );
TransMeta tMeta = TransTestFactory.generateTestTransformation( new Variables(), rowGenMeta, rowGenStepName );
// Remove the Injector step, as it's not needed for this transformation
TransHopMeta hopToRemove = tMeta.findTransHop( tMeta.findStep( TransTestFactory.INJECTOR_STEPNAME ), tMeta.findStep( rowGenStepName ) );
tMeta.removeTransHop( tMeta.indexOfTransHop( hopToRemove ) );
tMeta.removeStep( tMeta.indexOfStep( tMeta.findStep( TransTestFactory.INJECTOR_STEPNAME ) ) );
// Write transformation to temp file, for use within a job
String transFilename = TestUtilities.createEmptyTempFile( this.getClass().getSimpleName() + "_PDI14676_", ".ktr" );
FileObject transFile = TestUtils.getFileObject( transFilename );
OutputStream outStream = transFile.getContent().getOutputStream();
PrintWriter pw = new PrintWriter( outStream );
pw.write( tMeta.getXML() );
pw.close();
outStream.close();
return transFilename;
}
示例7: createRowGeneratorStep
import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
/**
* Creates a row generator step for this class..
*
* @param name
* @param registry
* @return
*/
private StepMeta createRowGeneratorStep( String name, PluginRegistry registry ) {
// Default the name if it is empty
String testFileOutputName = ( Utils.isEmpty( name ) ? "generate rows" : name );
// create the RowGenerator and Step Meta
RowGeneratorMeta rowGeneratorMeta = new RowGeneratorMeta();
String rowGeneratorPid = registry.getPluginId( StepPluginType.class, rowGeneratorMeta );
StepMeta generateRowsStep = new StepMeta( rowGeneratorPid, testFileOutputName, rowGeneratorMeta );
// Set the field names, types and values
rowGeneratorMeta.setFieldName( new String[] { "Id", "State", "City" } );
rowGeneratorMeta.setFieldType( new String[] { "Integer", "String", "String" } );
rowGeneratorMeta.setValue( new String[] { "1", "Orlando", "Florida" } );
rowGeneratorMeta.setFieldLength( new int[] { -1, -1, -1 } );
rowGeneratorMeta.setFieldPrecision( new int[] { -1, -1, -1 } );
rowGeneratorMeta.setGroup( new String[] { "", "", "" } );
rowGeneratorMeta.setDecimal( new String[] { "", "", "" } );
rowGeneratorMeta.setCurrency( new String[] { "", "", "" } );
rowGeneratorMeta.setFieldFormat( new String[] { "", "", "" } );
rowGeneratorMeta.setRowLimit( "10" );
// return the step meta
return generateRowsStep;
}
示例8: ok
import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
private void ok() {
if ( Utils.isEmpty( wStepname.getText() ) ) {
return;
}
stepname = wStepname.getText(); // return value
try {
getInfo( new RowGeneratorMeta() ); // to see if there is an exception
getInfo( input ); // to put the content on the input structure for real if all is well.
dispose();
} catch ( KettleException e ) {
new ErrorDialog(
shell, BaseMessages.getString( PKG, "RowGeneratorDialog.Illegal.Dialog.Settings.Title" ), BaseMessages
.getString( PKG, "RowGeneratorDialog.Illegal.Dialog.Settings.Message" ), e );
}
}
示例9: createRowGeneratorStep
import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
/**
* Creates a row generator step for this class..
*
* @param name
* @param registry
* @return
*/
private StepMeta createRowGeneratorStep( String name, PluginRegistry registry ) {
// Default the name if it is empty
String testFileOutputName = ( Utils.isEmpty( name ) ? "generate rows" : name );
// create the RowGenerator and Step Meta
RowGeneratorMeta rowGeneratorMeta = new RowGeneratorMeta();
String rowGeneratorPid = registry.getPluginId( StepPluginType.class, rowGeneratorMeta );
StepMeta generateRowsStep = new StepMeta( rowGeneratorPid, testFileOutputName, rowGeneratorMeta );
// Set the field names, types and values
rowGeneratorMeta.setFieldName( new String[] { "Id", "State", "City" } );
rowGeneratorMeta.setFieldType( new String[] { "Integer", "String", "String" } );
rowGeneratorMeta.setValue( new String[] { "1", "Florida", "Orlando" } );
rowGeneratorMeta.setFieldLength( new int[] { -1, -1, -1 } );
rowGeneratorMeta.setFieldPrecision( new int[] { -1, -1, -1 } );
rowGeneratorMeta.setGroup( new String[] { "", "", "" } );
rowGeneratorMeta.setDecimal( new String[] { "", "", "" } );
rowGeneratorMeta.setCurrency( new String[] { "", "", "" } );
rowGeneratorMeta.setFieldFormat( new String[] { "", "", "" } );
rowGeneratorMeta.setRowLimit( "10" );
// return the step meta
return generateRowsStep;
}
示例10: generateTestTransformation
import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
public static Trans generateTestTransformation()
{
RowGeneratorMeta A = new RowGeneratorMeta();
A.allocate(3);
A.setRowLimit("100000000");
A.getFieldName()[0] = "ID";
A.getFieldType()[0] = ValueMeta.getTypeDesc(ValueMetaInterface.TYPE_INTEGER);
A.getFieldLength()[0] = 7;
A.getValue()[0] = "1234";
A.getFieldName()[1] = "Name";
A.getFieldType()[1] = ValueMeta.getTypeDesc(ValueMetaInterface.TYPE_STRING);
A.getFieldLength()[1] = 35;
A.getValue()[1] = "Some name";
A.getFieldName()[2] = "Last updated";
A.getFieldType()[2] = ValueMeta.getTypeDesc(ValueMetaInterface.TYPE_DATE);
A.getFieldFormat()[2] = "yyyy/MM/dd";
A.getValue()[2] = "2006/11/13";
TransMeta transMeta = TransPreviewFactory.generatePreviewTransformation(null, A, "A");
transMeta.setName("Row generator test");
transMeta.setSizeRowset(2500);
transMeta.setFeedbackSize(50000);
transMeta.setUsingThreadPriorityManagment(false);
return new Trans(transMeta);
}
示例11: getInfo
import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
private void getInfo(RowGeneratorMeta meta) throws KettleException
{
meta.setRowLimit( wLimit.getText() );
int nrfields = wFields.nrNonEmpty();
meta.allocate(nrfields);
for (int i=0;i<nrfields;i++)
{
TableItem item = wFields.getNonEmpty(i);
meta.getFieldName()[i] = item.getText(1);
meta.getFieldType()[i] = item.getText(2);
meta.getFieldFormat()[i] = item.getText(3);
String slength = item.getText(4);
String sprec = item.getText(5);
meta.getCurrency()[i] = item.getText(6);
meta.getDecimal()[i] = item.getText(7);
meta.getGroup()[i] = item.getText(8);
meta.getValue()[i] = item.getText(9);
meta.getFieldLength()[i] = Const.toInt( slength, -1);
meta.getFieldPrecision()[i] = Const.toInt( sprec , -1);
}
// Performs checks...
/*
* Commented out verification : if variables are used, this check is a pain!
*
long longLimit = Const.toLong(transMeta.environmentSubstitute( wLimit.getText()), -1L );
if (longLimit<0)
{
throw new KettleException( Messages.getString("RowGeneratorDialog.Wrong.RowLimit.Number") );
}
*/
}
示例12: getInfo
import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
private void getInfo(RowGeneratorMeta meta) throws KettleException
{
meta.setRowLimit( wLimit.getText() );
int nrfields = wFields.nrNonEmpty();
meta.allocate(nrfields);
for (int i=0;i<nrfields;i++)
{
TableItem item = wFields.getNonEmpty(i);
meta.getFieldName()[i] = item.getText(1);
meta.getFieldType()[i] = item.getText(2);
meta.getFieldFormat()[i] = item.getText(3);
String slength = item.getText(4);
String sprec = item.getText(5);
meta.getCurrency()[i] = item.getText(6);
meta.getDecimal()[i] = item.getText(7);
meta.getGroup()[i] = item.getText(8);
meta.getValue()[i] = item.getText(9);
meta.getFieldLength()[i] = Const.toInt( slength, -1);
meta.getFieldPrecision()[i] = Const.toInt( sprec , -1);
}
// Performs checks...
/*
* Commented out verification : if variables are used, this check is a pain!
*
long longLimit = Const.toLong(transMeta.environmentSubstitute( wLimit.getText()), -1L );
if (longLimit<0)
{
throw new KettleException( BaseMessages.getString(PKG, "RowGeneratorDialog.Wrong.RowLimit.Number") );
}
*/
}
示例13: generateTestTransformation
import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
public static Trans generateTestTransformation() {
RowGeneratorMeta A = new RowGeneratorMeta();
A.allocate(3);
A.setRowLimit("10000000");
A.getFieldName()[0] = "ID";
A.getFieldType()[0] = ValueMeta.getTypeDesc(ValueMetaInterface.TYPE_INTEGER);
A.getFieldLength()[0] = 7;
A.getValue()[0] = "1234";
A.getFieldName()[1] = "Name";
A.getFieldType()[1] = ValueMeta.getTypeDesc(ValueMetaInterface.TYPE_STRING);
A.getFieldLength()[1] = 35;
A.getValue()[1] = "Some name";
A.getFieldName()[2] = "Last updated";
A.getFieldType()[2] = ValueMeta.getTypeDesc(ValueMetaInterface.TYPE_DATE);
A.getFieldFormat()[2] = "yyyy/MM/dd";
A.getValue()[2] = "2010/02/09";
TransMeta transMeta = TransPreviewFactory.generatePreviewTransformation(null, A, "A");
transMeta.setName("CarteUnitTest");
transMeta.setSizeRowset(2500);
transMeta.setFeedbackSize(50000);
transMeta.setUsingThreadPriorityManagment(false);
return new Trans(transMeta);
}
示例14: buildRowGeneratorStep
import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
/**
* Builds a {@link RowGenerator} Step with a single String field.
*
* @param registry Plugin Registry.
* @param stepName Name to use for step
* @return {@link StepMeta} for a Row Generator step.
*/
private StepMeta buildRowGeneratorStep(PluginRegistry registry, String stepName) {
RowGeneratorMeta rm = new RowGeneratorMeta();
// Set the information of the row generator.
String rowGeneratorPid = registry.getPluginId(StepPluginType.class, rm);
StepMeta rowGeneratorStep = new StepMeta(rowGeneratorPid, stepName, rm);
String fieldName[] = { "string" }; //$NON-NLS-1$
String type[] = { "String" }; //$NON-NLS-1$
String value[] = { "string_value" }; //$NON-NLS-1$
String fieldFormat[] = { "" }; //$NON-NLS-1$
String group[] = { "" }; //$NON-NLS-1$
String decimal[] = { "" }; //$NON-NLS-1$
int intDummies[] = { -1, -1, -1 };
rm.setDefault();
rm.setFieldName(fieldName);
rm.setFieldType(type);
rm.setValue(value);
rm.setFieldLength(intDummies);
rm.setFieldPrecision(intDummies);
rm.setRowLimit("1"); //$NON-NLS-1$
rm.setFieldFormat(fieldFormat);
rm.setGroup(group);
rm.setDecimal(decimal);
return rowGeneratorStep;
}
示例15: generateTestTransformation
import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
public static Trans generateTestTransformation()
{
RowGeneratorMeta A = new RowGeneratorMeta();
A.allocate(3);
A.setRowLimit("100000000");
A.getFieldName()[0] = "ID";
A.getFieldType()[0] = ValueMeta.getTypeDesc(ValueMetaInterface.TYPE_INTEGER);
A.getFieldLength()[0] = 7;
A.getValue()[0] = "1234";
A.getFieldName()[1] = "Name";
A.getFieldType()[1] = ValueMeta.getTypeDesc(ValueMetaInterface.TYPE_STRING);
A.getFieldLength()[1] = 35;
A.getValue()[1] = "Some name";
A.getFieldName()[2] = "Last updated";
A.getFieldType()[2] = ValueMeta.getTypeDesc(ValueMetaInterface.TYPE_DATE);
A.getFieldFormat()[2] = "yyyy/MM/dd";
A.getValue()[2] = "2006/11/13";
TransMeta transMeta = TransPreviewFactory.generatePreviewTransformation(null, A, "A");
transMeta.setName("Row generator test");
transMeta.setSizeRowset(2500);
transMeta.setFeedbackSize(50000);
transMeta.setUsingThreadPriorityManagment(false);
return new Trans(transMeta);
}