當前位置: 首頁>>代碼示例>>Java>>正文


Java RowMetaInterface.clone方法代碼示例

本文整理匯總了Java中org.pentaho.di.core.row.RowMetaInterface.clone方法的典型用法代碼示例。如果您正苦於以下問題:Java RowMetaInterface.clone方法的具體用法?Java RowMetaInterface.clone怎麽用?Java RowMetaInterface.clone使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.pentaho.di.core.row.RowMetaInterface的用法示例。


在下文中一共展示了RowMetaInterface.clone方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: analyseImpact

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void analyseImpact(List<DatabaseImpact> impact, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev,
		String[] input, String[] output, RowMetaInterface info) throws KettleStepException {

	RowMetaInterface out = prev.clone();
	getFields(out, stepMeta.getName(), new RowMetaInterface[] { info, }, null, transMeta );
	if (out!=null)
	{
		for (int i=0;i<out.size();i++)
		{
			ValueMetaInterface outvalue = out.getValueMeta(i);
			DatabaseImpact di = new DatabaseImpact( DatabaseImpact.TYPE_IMPACT_READ, 
					transMeta.getName(),
					stepMeta.getName(),
					databaseMeta.getDatabaseName(),
					"", //$NON-NLS-1$
					outvalue.getName(),
					outvalue.getName(),
					stepMeta.getName(),
					sql,
					Messages.getString("DynamicSQLRowMeta.DatabaseImpact.Title") //$NON-NLS-1$
					);
			impact.add(di);

		}
	}
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:27,代碼來源:DynamicSQLRowMeta.java

示例2: get

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
/**
 * Get the fields as a row generated by a database cache entry 
 * @param entry the entry to look for
 * @return the fields as a row generated by a database cache entry 
 */
public RowMetaInterface get(DBCacheEntry entry)
{
	if (!usecache) return null;
	
       RowMetaInterface fields = cache.get(entry);
	if (fields!=null)
	{
		fields = fields.clone(); // Copy it again!
				
		//System.out.println("Cache hit!!, fields="+fields.toStringMeta() );
		//System.out.println("Cache hit entry="+entry.sql );
	}

	return fields;
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:21,代碼來源:DBCache.java

示例3: analyseImpact

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void analyseImpact(List<DatabaseImpact> impact, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev,
		String[] input, String[] output, RowMetaInterface info) throws KettleStepException {

	RowMetaInterface out = prev.clone();
	getFields(out, stepMeta.getName(), new RowMetaInterface[] { info, }, null, transMeta );
	if (out!=null)
	{
		for (int i=0;i<out.size();i++)
		{
			ValueMetaInterface outvalue = out.getValueMeta(i);
			DatabaseImpact di = new DatabaseImpact( DatabaseImpact.TYPE_IMPACT_READ, 
					transMeta.getName(),
					stepMeta.getName(),
					databaseMeta.getDatabaseName(),
					"", //$NON-NLS-1$
					outvalue.getName(),
					outvalue.getName(),
					stepMeta.getName(),
					sql,
					BaseMessages.getString(PKG, "DynamicSQLRowMeta.DatabaseImpact.Title") //$NON-NLS-1$
					);
			impact.add(di);

		}
	}
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:27,代碼來源:DynamicSQLRowMeta.java

示例4: analyseImpact

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
@Override
public void analyseImpact(List<DatabaseImpact> impact, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev,
		String[] input, String[] output, RowMetaInterface info) throws KettleStepException {

	// Find the lookupfields...
	//
	RowMetaInterface out = prev.clone();
	getFields(out, stepMeta.getName(), new RowMetaInterface[] { info, }, null, transMeta );
	
	if (out!=null)
	{
		for (int i=0;i<out.size();i++)
		{
			ValueMetaInterface outvalue = out.getValueMeta(i);
			DatabaseImpact di = new DatabaseImpact( DatabaseImpact.TYPE_IMPACT_READ, 
											transMeta.getName(),
											stepMeta.getName(),
											databaseMeta.getDatabaseName(),
											"", //$NON-NLS-1$
											outvalue.getName(),
											outvalue.getName(),
											stepMeta.getName(),
											sql,
											Messages.getString("DatabaseJoinMeta.DatabaseImpact.Title") //$NON-NLS-1$
											);
			impact.add(di);

		}
	}
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:31,代碼來源:DatabaseJoinMeta.java

示例5: getAllFields

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public RowMetaInterface getAllFields(RowMetaInterface inputRowMeta)
{
    RowMetaInterface rowMeta = inputRowMeta.clone();
    
    for (int i=0;i<calculation.length;i++)
    {
        CalculatorMetaFunction fn = calculation[i];
        if (!Const.isEmpty(fn.getFieldName())) // It's a new field!
        {
            ValueMetaInterface v = getValueMeta(fn, null);
            rowMeta.addValueMeta(v);
        }
    }
    return rowMeta;
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:16,代碼來源:CalculatorMeta.java

示例6: safeModeChecking

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
protected void safeModeChecking(RowMetaInterface row) throws KettleRowException
{
	if (row==null) {
		return;
	}
	
    if (inputReferenceRow == null)
    {
        inputReferenceRow = row.clone(); // copy it!
        
        // Check for double field names.
        // 
        String[] fieldnames = row.getFieldNames();
        Arrays.sort(fieldnames);
        for (int i=0;i<fieldnames.length-1;i++)
        {
            if (fieldnames[i].equals(fieldnames[i+1]))
            {
                throw new KettleRowException(Messages.getString("BaseStep.SafeMode.Exception.DoubleFieldnames", fieldnames[i]));
            }
        }
    }
    else
    {
        safeModeChecking(inputReferenceRow, row);
    }
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:28,代碼來源:BaseStep.java

示例7: put

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void put(DBCacheEntry entry, RowMetaInterface fields)
{
	if (!usecache) return;
	
       RowMetaInterface copy = fields.clone();
	cache.put(entry, copy);
	
	//System.out.println("Cache store: "+copy.toStringMeta());
	//System.out.println("Cache store entry="+entry.sql );
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:11,代碼來源:DBCache.java

示例8: getFields

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface info[], StepMeta nextStep, VariableSpace space) throws KettleStepException
{
    RowMetaInterface rowMeta = inputRowMeta.clone();
    inputRowMeta.clear();
    inputRowMeta.addRowMeta(rowMeta);
    
       getSelectFields(inputRowMeta, name);
	getDeleteFields(inputRowMeta);
	getMetadataFields(inputRowMeta, name);
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:11,代碼來源:SelectValuesMeta.java

示例9: analyseImpact

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
@Override
public void analyseImpact(List<DatabaseImpact> impact, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev,
		String[] input, String[] output, RowMetaInterface info) throws KettleStepException {

	// Find the lookupfields...
	//
	RowMetaInterface out = prev.clone();
	getFields(out, stepMeta.getName(), new RowMetaInterface[] { info, }, null, transMeta );
	
	if (out!=null)
	{
		for (int i=0;i<out.size();i++)
		{
			ValueMetaInterface outvalue = out.getValueMeta(i);
			DatabaseImpact di = new DatabaseImpact( DatabaseImpact.TYPE_IMPACT_READ, 
											transMeta.getName(),
											stepMeta.getName(),
											databaseMeta.getDatabaseName(),
											"", //$NON-NLS-1$
											outvalue.getName(),
											outvalue.getName(),
											stepMeta.getName(),
											transMeta.environmentSubstitute(sql),
											BaseMessages.getString(PKG, "DatabaseJoinMeta.DatabaseImpact.Title") //$NON-NLS-1$
											);
			impact.add(di);

		}
	}
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:31,代碼來源:DatabaseJoinMeta.java

示例10: putError

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void putError(RowMetaInterface rowMeta, Object[] row, long nrErrors, String errorDescriptions, String fieldNames, String errorCodes) throws KettleStepException {
  if (trans.isSafeModeEnabled()) {
    if (rowMeta.size() > row.length) {
      throw new KettleStepException(BaseMessages.getString(PKG, "BaseStep.Exception.MetadataDoesntMatchDataRowSize", Integer.toString(rowMeta.size()), Integer.toString(row != null ? row.length : 0)));
    }
  }

  StepErrorMeta stepErrorMeta = stepMeta.getStepErrorMeta();

  if (errorRowMeta == null) {
    errorRowMeta = rowMeta.clone();

    RowMetaInterface add = stepErrorMeta.getErrorRowMeta(nrErrors, errorDescriptions, fieldNames, errorCodes);
    errorRowMeta.addRowMeta(add);
  }

  Object[] errorRowData = RowDataUtil.allocateRowData(errorRowMeta.size());
  if (row != null) {
    System.arraycopy(row, 0, errorRowData, 0, rowMeta.size());
  }

  // Also add the error fields...
  stepErrorMeta.addErrorRowData(errorRowData, rowMeta.size(), nrErrors, errorDescriptions, fieldNames, errorCodes);

  // call all row listeners...
  synchronized(rowListeners) {
    for (int i = 0; i < rowListeners.size(); i++) {
      RowListener rowListener = rowListeners.get(i);
      rowListener.errorRowWrittenEvent(rowMeta, row);
    }
  }

  if (errorRowSet != null) {
    while (!errorRowSet.putRow(errorRowMeta, errorRowData) && !isStopped())
      ;
    incrementLinesRejected();
  }

  verifyRejectionRates();
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:41,代碼來源:BaseStep.java

示例11: safeModeChecking

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
protected void safeModeChecking(RowMetaInterface row) throws KettleRowException
{
	if (row==null) {
		return;
	}
	
    if (inputReferenceRow == null)
    {
        inputReferenceRow = row.clone(); // copy it!
        
        // Check for double field names.
        // 
        String[] fieldnames = row.getFieldNames();
        Arrays.sort(fieldnames);
        for (int i=0;i<fieldnames.length-1;i++)
        {
            if (fieldnames[i].equals(fieldnames[i+1]))
            {
                throw new KettleRowException(BaseMessages.getString(PKG, "BaseStep.SafeMode.Exception.DoubleFieldnames", fieldnames[i]));
            }
        }
    }
    else
    {
        safeModeChecking(inputReferenceRow, row);
    }
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:28,代碼來源:BaseStep.java

示例12: putError

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void putError(RowMetaInterface rowMeta, Object[] row, long nrErrors, String errorDescriptions, String fieldNames, String errorCodes) throws KettleStepException
{
	if (safeModeEnabled) {
		if(rowMeta.size()>row.length) {
			throw new KettleStepException(Messages.getString("BaseStep.Exception.MetadataDoesntMatchDataRowSize", Integer.toString(rowMeta.size()), Integer.toString(row!=null?row.length:0)));
		}
	}

    StepErrorMeta stepErrorMeta = stepMeta.getStepErrorMeta();

    if (errorRowMeta==null)
    {
        errorRowMeta = rowMeta.clone();
        
        RowMetaInterface add = stepErrorMeta.getErrorRowMeta(nrErrors, errorDescriptions, fieldNames, errorCodes);
        errorRowMeta.addRowMeta(add);
    }
    
    Object[] errorRowData = RowDataUtil.allocateRowData(errorRowMeta.size());
    if (row!=null) {
    	System.arraycopy(row, 0, errorRowData, 0, rowMeta.size());
    }
    
    // Also add the error fields...
    stepErrorMeta.addErrorRowData(errorRowData, rowMeta.size(), nrErrors, errorDescriptions, fieldNames, errorCodes);
    
    // call all rowlisteners...
    for (int i = 0; i < rowListeners.size(); i++)
    {
        RowListener rowListener = (RowListener) rowListeners.get(i);
        rowListener.errorRowWrittenEvent(rowMeta, row);
    }

    if (errorRowSet!=null) 
    {
    	while (!errorRowSet.putRow(errorRowMeta, errorRowData) && !isStopped()) 
    		;
    	incrementLinesRejected();
    }

    verifyRejectionRates();
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:43,代碼來源:BaseStep.java


注:本文中的org.pentaho.di.core.row.RowMetaInterface.clone方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。