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


Java StepInterface.getLinesUpdated方法代碼示例

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


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

示例1: getProcessCount

import org.pentaho.di.trans.step.StepInterface; //導入方法依賴的package包/類
public static double getProcessCount(Context actualContext, Scriptable actualObject, Object[] ArgList, Function FunctionContext){
	
	if(ArgList.length==1){
		try{
			Object scmO = actualObject.get("_step_", actualObject);
			StepInterface scm = (StepInterface)Context.jsToJava(scmO, StepInterface.class);
			String strType = Context.toString(ArgList[0]).toLowerCase();
			
			if(strType.equals("i")) return (double)scm.getLinesInput();
			else if(strType.equals("o")) return (double)scm.getLinesOutput();
			else if(strType.equals("r")) return (double)scm.getLinesRead();
			else if(strType.equals("u")) return (double)scm.getLinesUpdated();
			else if(strType.equals("w")) return (double)scm.getLinesWritten();
               else if(strType.equals("e")) return (double)scm.getLinesRejected();
			else return 0;
		}catch(Exception e){
			//throw Context.reportRuntimeError(e.toString());
			return 0;
		}
	}else{
		throw Context.reportRuntimeError("The function call getProcessCount requires 1 argument.");	
	}
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:24,代碼來源:ScriptValuesAddedFunctions.java

示例2: addStepPerformanceSnapShot

import org.pentaho.di.trans.step.StepInterface; //導入方法依賴的package包/類
protected void addStepPerformanceSnapShot() {
   	if (transMeta.isCapturingStepPerformanceSnapShots())
   	{
        // get the statistics from the steps and keep them...
    	//
        for (int i=0;i<steps.size();i++)
        {
            StepMeta stepMeta = steps.get(i).stepMeta;
            StepInterface step = steps.get(i).step;
            BaseStep baseStep = (BaseStep)step;
            
            StepPerformanceSnapShot snapShot = new StepPerformanceSnapShot(
            		new Date(),
            		stepMeta.getName(),
            		step.getCopy(),
            		step.getLinesRead(),
            		step.getLinesWritten(),
            		step.getLinesInput(),
            		step.getLinesOutput(),
            		step.getLinesUpdated(),
            		step.getLinesRejected(),
            		step.getErrors()
            		);
            List<StepPerformanceSnapShot> snapShotList = stepPerformanceSnapShots.get(step.toString());
            StepPerformanceSnapShot previous;
            if (snapShotList==null) {
            	snapShotList = new ArrayList<StepPerformanceSnapShot>();
            	stepPerformanceSnapShots.put(step.toString(), snapShotList);
            	previous = null;
            }
            else {
            	previous = snapShotList.get(snapShotList.size()-1); // the last one...
            }
            // Make the difference...
            //
            snapShot.diff(previous, baseStep.rowsetInputSize(), baseStep.rowsetOutputSize());
            snapShotList.add(snapShot);
        }
   	}
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:41,代碼來源:Trans.java

示例3: addStepPerformanceSnapShot

import org.pentaho.di.trans.step.StepInterface; //導入方法依賴的package包/類
protected void addStepPerformanceSnapShot() {
	
	if (stepPerformanceSnapShots==null) return; // Race condition somewhere?
	
	boolean pausedAndNotEmpty = isPaused() && !stepPerformanceSnapShots.isEmpty(); 
	boolean stoppedAndNotEmpty = isStopped() && !stepPerformanceSnapShots.isEmpty(); 
	
   	if (transMeta.isCapturingStepPerformanceSnapShots() && !pausedAndNotEmpty && !stoppedAndNotEmpty)
   	{
        // get the statistics from the steps and keep them...
    	//
   		int seqNr = stepPerformanceSnapshotSeqNr.incrementAndGet();
        for (int i=0;i<steps.size();i++)
        {
            StepMeta stepMeta = steps.get(i).stepMeta;
            StepInterface step = steps.get(i).step;
            
            StepPerformanceSnapShot snapShot = new StepPerformanceSnapShot(
            		seqNr,
            		getBatchId(),
            		new Date(),
            		getName(),
            		stepMeta.getName(),
            		step.getCopy(),
            		step.getLinesRead(),
            		step.getLinesWritten(),
            		step.getLinesInput(),
            		step.getLinesOutput(),
            		step.getLinesUpdated(),
            		step.getLinesRejected(),
            		step.getErrors()
            		);
            List<StepPerformanceSnapShot> snapShotList = stepPerformanceSnapShots.get(step.toString());
            StepPerformanceSnapShot previous;
            if (snapShotList==null) {
            	snapShotList = new ArrayList<StepPerformanceSnapShot>();
            	stepPerformanceSnapShots.put(step.toString(), snapShotList);
            	previous = null;
            }
            else {
            	previous = snapShotList.get(snapShotList.size()-1); // the last one...
            }
            // Make the difference...
            //
 	            snapShot.diff(previous, step.rowsetInputSize(), step.rowsetOutputSize());
               synchronized(stepPerformanceSnapShots) {
   	            snapShotList.add(snapShot);

   	            if (stepPerformanceSnapshotSizeLimit>0 && snapShotList.size()>stepPerformanceSnapshotSizeLimit) {
   	              snapShotList.remove(0);
   	            }
            }
        }
        
        lastStepPerformanceSnapshotSeqNrAdded = stepPerformanceSnapshotSeqNr.get();
   	}
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:58,代碼來源:Trans.java


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