本文整理匯總了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);
}
}
}
示例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;
}
示例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);
}
}
}
示例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);
}
}
}
示例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;
}
示例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);
}
}
示例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 );
}
示例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);
}
示例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);
}
}
}
示例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();
}
示例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);
}
}
示例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();
}