当前位置: 首页>>代码示例>>Java>>正文


Java RowMetaAndData.size方法代码示例

本文整理汇总了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();
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:17,代码来源:Repository.java

示例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);
       }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:19,代码来源:FilesFromResultMeta.java

示例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);
       }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:19,代码来源:FilesFromResultMeta.java

示例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++;
  }
}
 
开发者ID:griddynamics,项目名称:xml-dom-kettle-etl-plugin,代码行数:50,代码来源:DOMXsltTest.java

示例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++;
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:44,代码来源:GetXMLDataTest.java

示例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++;
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:49,代码来源:CsvInput1Test.java

示例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");
		}
    }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:42,代码来源:TransformationTestCase.java

示例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++;
      }
  }
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:48,代码来源:DetectLastRowStepTest.java

示例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++;
      }
  }
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:45,代码来源:JavaScriptSpecialTest.java

示例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++;
      }
  }
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:45,代码来源:JavaScriptStringTest.java

示例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++;
      }
  }
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:45,代码来源:DatabaseLookupTest.java

示例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++;
      }
  }
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:48,代码来源:ParameterSimpleTransTest.java


注:本文中的org.pentaho.di.core.RowMetaAndData.size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。