本文整理汇总了Java中org.pentaho.di.core.RowMetaAndData.size方法的典型用法代码示例。如果您正苦于以下问题:Java RowMetaAndData.size方法的具体用法?Java RowMetaAndData.size怎么用?Java RowMetaAndData.size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.core.RowMetaAndData
的用法示例。
在下文中一共展示了RowMetaAndData.size方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateTableRow
import org.pentaho.di.core.RowMetaAndData; //导入方法依赖的package包/类
public synchronized void updateTableRow(String tablename, String idfield, RowMetaAndData values, long id) throws KettleException
{
String sets[] = new String[values.size()];
for (int i = 0; i < values.size(); i++)
sets[i] = values.getValueMeta(i).getName();
String codes[] = new String[] { idfield };
String condition[] = new String[] { "=" };
database.prepareUpdate(tablename, codes, condition, sets);
values.addValue(new ValueMeta(idfield, ValueMetaInterface.TYPE_INTEGER), new Long(id));
database.setValuesUpdate(values.getRowMeta(), values.getData());
database.updateRow();
database.closeUpdate();
}
示例2: getFields
import org.pentaho.di.core.RowMetaAndData; //导入方法依赖的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);
}
}
示例3: updateTableRow
import org.pentaho.di.core.RowMetaAndData; //导入方法依赖的package包/类
public synchronized void updateTableRow(String tablename, String idfield, RowMetaAndData values) throws KettleException
{
long id = values.getInteger(idfield, 0L);
values.removeValue(idfield);
String sets[] = new String[values.size()];
for (int i = 0; i < values.size(); i++)
sets[i] = values.getValueMeta(i).getName();
String codes[] = new String[] { idfield };
String condition[] = new String[] { "=" };
database.prepareUpdate(tablename, codes, condition, sets);
values.addValue(new ValueMeta(idfield, ValueMetaInterface.TYPE_INTEGER), new Long(id));
database.setValuesUpdate(values.getRowMeta(), values.getData());
database.updateRow();
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:18,代码来源:KettleDatabaseRepositoryConnectionDelegate.java
示例4: getFields
import org.pentaho.di.core.RowMetaAndData; //导入方法依赖的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);
}
}
示例5: checkRows
import org.pentaho.di.core.RowMetaAndData; //导入方法依赖的package包/类
/**
* Check the 2 lists comparing the rows in order. If they are not the same fail the test.
*
* @param rows1
* set 1 of rows to compare
* @param rows2
* set 2 of rows to compare
* @param fileNameColumn
* Number of the column containing the filename. This is only checked for being non-null (some systems maybe
* canonize names differently than we input).
*/
public void checkRows( List<RowMetaAndData> rows1, List<RowMetaAndData> rows2, int fileNameColumn ) {
int idx = 1;
if ( rows1.size() != rows2.size() ) {
fail( "Number of rows is not the same: " + rows1.size() + " and " + rows2.size() );
}
Iterator<RowMetaAndData> it1 = rows1.iterator();
Iterator<RowMetaAndData> it2 = rows2.iterator();
while ( it1.hasNext() && it2.hasNext() ) {
RowMetaAndData rm1 = it1.next();
RowMetaAndData rm2 = it2.next();
Object[] r1 = rm1.getData();
Object[] r2 = rm2.getData();
if ( !DOMTestUtilities.toString((Document)r1[3]).equals(DOMTestUtilities.toString((Document)r2[3])) ) {
fail( "row nr " + idx + " is not equal" );
}
if ( rm1.size() != rm2.size() ) {
fail( "row nr " + idx + " is not equal" );
}
int[] fields = new int[r1.length];
for ( int ydx = 0; ydx < r1.length; ydx++ ) {
fields[ydx] = ydx;
}
try {
r1[fileNameColumn] = r2[fileNameColumn];
if ( rm1.getRowMeta().compare( r1, r2, fields ) != 0 ) {
fail( "row nr " + idx + " is not equal" );
}
} catch ( KettleValueException e ) {
fail( "row nr " + idx + " is not equal" );
}
idx++;
}
}
示例6: checkRows
import org.pentaho.di.core.RowMetaAndData; //导入方法依赖的package包/类
/**
* Check the 2 lists comparing the rows in order. If they are not the same
* fail the test.
*
* @param rows1
* set 1 of rows to compare
* @param rows2
* set 2 of rows to compare
*/
public void checkRows(List<RowMetaAndData> rows1, List<RowMetaAndData> rows2) {
int idx = 1;
if (rows1.size() != rows2.size()) {
fail("Number of rows is not the same: " + rows1.size() + " and "
+ rows2.size());
}
Iterator<RowMetaAndData> it1 = rows1.iterator();
Iterator<RowMetaAndData> it2 = rows2.iterator();
while (it1.hasNext() && it2.hasNext()) {
RowMetaAndData rm1 = it1.next();
RowMetaAndData rm2 = it2.next();
Object[] r1 = rm1.getData();
Object[] r2 = rm2.getData();
if (rm1.size() != rm2.size()) {
fail("row nr " + idx + " is not equal");
}
int[] fields = new int[r1.length];
for (int ydx = 0; ydx < r1.length; ydx++) {
fields[ydx] = ydx;
}
try {
if (rm1.getRowMeta().compare(r1, r2, fields) != 0) {
fail("row nr " + idx + " is not equal");
}
} catch (KettleValueException e) {
fail("row nr " + idx + " is not equal");
}
idx++;
}
}
示例7: checkRows
import org.pentaho.di.core.RowMetaAndData; //导入方法依赖的package包/类
/**
* Check the 2 lists comparing the rows in order. If they are not the same
* fail the test.
*
* @param rows1
* set 1 of rows to compare
* @param rows2
* set 2 of rows to compare
* @param fileNameColumn
* Number of the column containing the filename. This is only checked
* for being non-null (some systems maybe canonize names differently
* than we input).
*/
public void checkRows(List<RowMetaAndData> rows1, List<RowMetaAndData> rows2, int fileNameColumn) {
int idx = 1;
if (rows1.size() != rows2.size()) {
fail("Number of rows is not the same: " + rows1.size() + " and "
+ rows2.size());
}
Iterator<RowMetaAndData> it1 = rows1.iterator();
Iterator<RowMetaAndData> it2 = rows2.iterator();
while (it1.hasNext() && it2.hasNext()) {
RowMetaAndData rm1 = it1.next();
RowMetaAndData rm2 = it2.next();
Object[] r1 = rm1.getData();
Object[] r2 = rm2.getData();
if (rm1.size() != rm2.size()) {
fail("row nr " + idx + " is not equal");
}
int[] fields = new int[r1.length];
for (int ydx = 0; ydx < r1.length; ydx++) {
fields[ydx] = ydx;
}
try {
r1[fileNameColumn] = r2[fileNameColumn];
if (rm1.getRowMeta().compare(r1, r2, fields) != 0) {
fail("row nr " + idx + " is not equal");
}
} catch (KettleValueException e) {
fail("row nr " + idx + " is not equal");
}
idx++;
}
}
示例8: checkRows
import org.pentaho.di.core.RowMetaAndData; //导入方法依赖的package包/类
/**
* Check the 2 lists comparing the rows in order.
* If they are not the same fail the test.
*/
public void checkRows(List<RowMetaAndData> rows1, List<RowMetaAndData> rows2)
{
if ( rows1.size() != rows2.size() )
{
fail("Number of rows is not the same: " +
rows1.size() + " and " + rows2.size());
}
ListIterator<RowMetaAndData> it1 = rows1.listIterator();
ListIterator<RowMetaAndData> it2 = rows2.listIterator();
while ( it1.hasNext() && it2.hasNext() )
{
RowMetaAndData rm1 = it1.next();
RowMetaAndData rm2 = it2.next();
Object[] r1 = rm1.getData();
Object[] r2 = rm2.getData();
if ( rm1.size() != rm2.size() )
{
fail("row nr " + it1.nextIndex() + " is not equal");
}
int fields[] = new int[r1.length];
for ( int ydx = 0; ydx < r1.length; ydx++ )
{
fields[ydx] = ydx;
}
try {
if ( rm1.getRowMeta().compare(r1, r2, fields) != 0 )
{
fail("row nr " + it1.nextIndex() + " is not equal");
}
} catch (KettleValueException e) {
fail("row nr " + it1.nextIndex() + " is not equal");
}
}
}
示例9: checkRows
import org.pentaho.di.core.RowMetaAndData; //导入方法依赖的package包/类
/**
* Check the 2 lists comparing the rows in order.
* If they are not the same fail the test.
*
* @param rows1 first row set to compare
* @param rows2 second row set to compare
*/
public void checkRows(List<RowMetaAndData> rows1, List<RowMetaAndData> rows2)
{
int idx = 1;
if ( rows1.size() != rows2.size() )
{
fail("Number of rows is not the same: " +
rows1.size() + " and " + rows2.size());
}
Iterator<RowMetaAndData> it1 = rows1.iterator();
Iterator<RowMetaAndData> it2 = rows2.iterator();
while ( it1.hasNext() && it2.hasNext() )
{
RowMetaAndData rm1 = it1.next();
RowMetaAndData rm2 = it2.next();
Object[] r1 = rm1.getData();
Object[] r2 = rm2.getData();
if ( rm1.size() != rm2.size() )
{
fail("row nr " + idx + " is not equal");
}
int fields[] = new int[rm1.size()];
for ( int ydx = 0; ydx < rm1.size(); ydx++ )
{
fields[ydx] = ydx;
}
try {
if ( rm1.getRowMeta().compare(r1, r2, fields) != 0 )
{
fail("row nr " + idx + " is not equal");
}
} catch (KettleValueException e) {
fail("row nr " + idx + " is not equal");
}
idx++;
}
}
示例10: checkRows
import org.pentaho.di.core.RowMetaAndData; //导入方法依赖的package包/类
/**
* Check the 2 lists comparing the rows in order.
* If they are not the same fail the test.
*/
public void checkRows(List<RowMetaAndData> rows1, List<RowMetaAndData> rows2)
{
int idx = 1;
if ( rows1.size() != rows2.size() )
{
fail("Number of rows is not the same: " +
rows1.size() + " and " + rows2.size());
}
Iterator<RowMetaAndData> it1 = rows1.iterator();
Iterator<RowMetaAndData> it2 = rows2.iterator();
while ( it1.hasNext() && it2.hasNext() )
{
RowMetaAndData rm1 = it1.next();
RowMetaAndData rm2 = it2.next();
Object[] r1 = rm1.getData();
Object[] r2 = rm2.getData();
if ( rm1.size() != rm2.size() )
{
fail("row nr " + idx + " is not equal");
}
int fields[] = new int[rm1.size()];
for ( int ydx = 0; ydx < rm1.size(); ydx++ )
{
fields[ydx] = ydx;
}
try {
if ( rm1.getRowMeta().compare(r1, r2, fields) != 0 )
{
fail("row nr " + idx + " is not equal");
}
} catch (KettleValueException e) {
fail("row nr " + idx + " is not equal");
}
idx++;
}
}
示例11: checkRows
import org.pentaho.di.core.RowMetaAndData; //导入方法依赖的package包/类
/**
* Check the 2 lists comparing the rows in order.
* If they are not the same fail the test.
*/
public void checkRows(List<RowMetaAndData> rows1, List<RowMetaAndData> rows2)
{
int idx = 1;
if ( rows1.size() != rows2.size() )
{
fail("Number of rows is not the same: " +
rows1.size() + " and " + rows2.size());
}
Iterator<RowMetaAndData> it1 = rows1.iterator();
Iterator<RowMetaAndData> it2 = rows2.iterator();
while ( it1.hasNext() && it2.hasNext() )
{
RowMetaAndData rm1 = it1.next();
RowMetaAndData rm2 = it2.next();
Object[] r1 = rm1.getData();
Object[] r2 = rm2.getData();
if ( rm1.size() != rm2.size() )
{
fail("row nr " + idx + " is not equal");
}
int fields[] = new int[rm1.size()];
for ( int ydx = 0; ydx < rm1.size(); ydx++ )
{
fields[ydx] = ydx;
}
try {
if ( rm1.getRowMeta().compare(r1, r2, fields) != 0 )
{
fail("row nr " + idx + " is not equal");
}
} catch (KettleValueException e) {
fail("row nr " + idx + " is not equal");
}
idx++;
}
}
示例12: checkRows
import org.pentaho.di.core.RowMetaAndData; //导入方法依赖的package包/类
/**
* Check the 2 lists comparing the rows in order.
* If they are not the same fail the test.
*/
public void checkRows(List<RowMetaAndData> rows1, List<RowMetaAndData> rows2)
{
int idx = 1;
if ( rows1.size() != rows2.size() )
{
fail("Number of rows is not the same: " +
rows1.size() + " and " + rows2.size());
}
Iterator<RowMetaAndData> it1 = rows1.iterator();
Iterator<RowMetaAndData> it2 = rows2.iterator();
while ( it1.hasNext() && it2.hasNext() )
{
RowMetaAndData rm1 = it1.next();
RowMetaAndData rm2 = it2.next();
Object[] r1 = rm1.getData();
Object[] r2 = rm2.getData();
if ( rm1.size() != rm2.size() )
{
fail("row nr " + idx + " is not equal");
}
int fields[] = new int[r1.length];
for ( int ydx = 0; ydx < r1.length; ydx++ )
{
fields[ydx] = ydx;
}
try {
if ( rm1.getRowMeta().compare(r1, r2, fields) != 0 )
{
fail("row nr " + idx + " is not equal");
}
} catch (KettleValueException e) {
fail("row nr " + idx + " is not equal");
}
idx++;
}
}
示例13: checkRows
import org.pentaho.di.core.RowMetaAndData; //导入方法依赖的package包/类
/**
* Check the 2 lists comparing the rows in order.
* If they are not the same fail the test.
*
* @param rows1 first row set to compare
* @param rows2 second row set to compare
*/
public void checkRows(List<RowMetaAndData> rows1, List<RowMetaAndData> rows2)
{
int idx = 1;
if ( rows1.size() != rows2.size() )
{
fail("Number of rows is not the same: " +
rows1.size() + " and " + rows2.size());
}
Iterator<RowMetaAndData> it1 = rows1.iterator();
Iterator<RowMetaAndData> it2 = rows2.iterator();
while ( it1.hasNext() && it2.hasNext() )
{
RowMetaAndData rm1 = it1.next();
RowMetaAndData rm2 = it2.next();
Object[] r1 = rm1.getData();
Object[] r2 = rm2.getData();
if ( rm1.size() != rm2.size() )
{
fail("row nr " + idx + " is not equal");
}
int[] fields = new int[rm1.size()];
for ( int ydx = 0; ydx < rm1.size(); ydx++ )
{
fields[ydx] = ydx;
}
try {
if ( rm1.getRowMeta().compare(r1, r2, fields) != 0 )
{
fail("row nr " + idx + " is not equal");
}
} catch (KettleValueException e) {
fail("row nr " + idx + " is not equal");
}
idx++;
}
}