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


Java BaseStep类代码示例

本文整理汇总了Java中org.pentaho.di.trans.step.BaseStep的典型用法代码示例。如果您正苦于以下问题:Java BaseStep类的具体用法?Java BaseStep怎么用?Java BaseStep使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BaseStep类属于org.pentaho.di.trans.step包,在下文中一共展示了BaseStep类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getEnded

import org.pentaho.di.trans.step.BaseStep; //导入依赖的package包/类
public int getEnded()
{
	int nrEnded=0;

	if (steps==null) return 0;

	for (int i=0;i<steps.size();i++)
	{
		StepMetaDataCombi sid = steps.get(i);
		
           BaseStep thr=(BaseStep)sid.step;
           StepDataInterface data = sid.data;
           
		if ((thr!=null && !thr.isAlive()) ||  // Should normally not be needed anymore, status is kept in data.
                   data.getStatus()==StepDataInterface.STATUS_FINISHED || // Finished processing 
                   data.getStatus()==StepDataInterface.STATUS_HALTED ||   // Not launching because of init error
                   data.getStatus()==StepDataInterface.STATUS_STOPPED     // Stopped because of an error
                   )
           {
               nrEnded++;
           }
	}

	return nrEnded;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:26,代码来源:Trans.java

示例2: killAllNoWait

import org.pentaho.di.trans.step.BaseStep; //导入依赖的package包/类
/**
 * Ask all steps to stop but don't wait around for it to happen.
 * Special method for use with mappings.
 */
private void killAllNoWait()
{
	if (steps==null) return;
	
	for (int i=0;i<steps.size();i++)
	{
		StepMetaDataCombi sid = steps.get(i);
		BaseStep thr = (BaseStep)sid.step;

		if (log.isDebug()) log.logDebug(toString(), Messages.getString("Trans.Log.LookingAtStep")+thr.getStepname()); //$NON-NLS-1$
		
		thr.stopAll();
		try
		{
			Thread.sleep(20);
		}
		catch(Exception e)
		{
			log.logError(toString(), Messages.getString("Trans.Log.TransformationErrors")+e.toString()); //$NON-NLS-1$
			return;
		}
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:28,代码来源:Trans.java

示例3: getRunThread

import org.pentaho.di.trans.step.BaseStep; //导入依赖的package包/类
public BaseStep getRunThread(String name, int copy)
{
	if (steps==null) return null;

	int i;

	for( i=0;i<steps.size();i++)
	{
		StepMetaDataCombi sid = steps.get(i);
		BaseStep rt = (BaseStep)sid.step;
		if (rt.getStepname().equalsIgnoreCase(name) && rt.getCopy()==copy)
		{
			return rt;
		}
	}

	return null;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:19,代码来源:Trans.java

示例4: findBaseSteps

import org.pentaho.di.trans.step.BaseStep; //导入依赖的package包/类
public List<BaseStep> findBaseSteps(String stepname)
{
	List<BaseStep> baseSteps = new ArrayList<BaseStep>();
	
	if (steps==null) return baseSteps;

	for (int i=0;i<steps.size();i++)
	{
		StepMetaDataCombi sid = steps.get(i);
		BaseStep rt = (BaseStep)sid.step;
		if (rt.getStepname().equalsIgnoreCase(stepname)) {
			baseSteps.add(rt);
		}
	}
	return baseSteps;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:17,代码来源:Trans.java

示例5: lookupStatusStepNumbers

import org.pentaho.di.trans.step.BaseStep; //导入依赖的package包/类
private void lookupStatusStepNumbers()
{
    if (data.mappingTrans != null)
    {
        List<StepMetaDataCombi> steps = data.mappingTrans.getSteps();
        for (int i=0;i<steps.size();i++)
        {
            StepMetaDataCombi sid = steps.get(i);
            BaseStep rt = (BaseStep)sid.step;
            if (rt.getStepname().equals(data.mappingTransMeta.getTransLogTable().getStepnameRead()))     data.linesReadStepNr = i;
            if (rt.getStepname().equals(data.mappingTransMeta.getTransLogTable().getStepnameInput()))    data.linesInputStepNr = i;
            if (rt.getStepname().equals(data.mappingTransMeta.getTransLogTable().getStepnameWritten()))  data.linesWrittenStepNr = i;
            if (rt.getStepname().equals(data.mappingTransMeta.getTransLogTable().getStepnameOutput()))   data.linesOutputStepNr = i;
            if (rt.getStepname().equals(data.mappingTransMeta.getTransLogTable().getStepnameUpdated()))  data.linesUpdatedStepNr = i;
            if (rt.getStepname().equals(data.mappingTransMeta.getTransLogTable().getStepnameRejected())) data.linesRejectedStepNr = i;
        }
    }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:19,代码来源:Mapping.java

示例6: dispose

import org.pentaho.di.trans.step.BaseStep; //导入依赖的package包/类
public void dispose(StepMetaInterface smi, StepDataInterface sdi)
{
	meta = (GetFilesRowsCountMeta)smi;
	data = (GetFilesRowsCountData)sdi;
	if(data.file!=null) 
	{
		try
		{
			data.file.close();
			data.file=null;
		}catch  (Exception e)
		{
		}
	}
	if(data.fr!=null) {
     BaseStep.closeQuietly(data.fr);
	  data.fr=null;
	}
	if(data.lineStringBuffer!=null) data.lineStringBuffer=null;

	super.dispose(smi, sdi);
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:23,代码来源:GetFilesRowsCount.java

示例7: use

import org.pentaho.di.trans.step.BaseStep; //导入依赖的package包/类
/**
* 获取数据库操作对象 <br/>
* @author jingma
* @param ku 
* @param dbCode
* @return
*/
public static Db use(BaseStep ku, String dbCode) {
    try {
        DataSource dataSource = ( new DatabaseUtil() ).getNamedDataSource( dbCode );
        return new Db(dataSource,dbCode);
    } catch (KettleException e) {
        if(ku!=null){
            ku.logError("获取数据库失败:"+dbCode, e);
        }else{
            log.error("获取数据库失败:"+dbCode, e);
        }
    }
    return null;
}
 
开发者ID:majinju,项目名称:KettleEasyExpand,代码行数:21,代码来源:Db.java

示例8: addStepPerformanceSnapShot

import org.pentaho.di.trans.step.BaseStep; //导入依赖的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

示例9: killAll

import org.pentaho.di.trans.step.BaseStep; //导入依赖的package包/类
public void killAll()
{
	if (steps==null) return;
	
	int nrStepsFinished = 0;
	
	for (int i=0;i<steps.size();i++)
	{
		StepMetaDataCombi sid = steps.get(i);
		BaseStep thr = (BaseStep)sid.step;

		if (log.isDebug()) log.logDebug(toString(), Messages.getString("Trans.Log.LookingAtStep")+thr.getStepname()); //$NON-NLS-1$
		
		// If thr is a mapping, this is cause for an endless loop
		//
		while (thr.isAlive())
		{
			thr.stopAll();
			try
			{
				Thread.sleep(20);
			}
			catch(Exception e)
			{
				log.logError(toString(), Messages.getString("Trans.Log.TransformationErrors")+e.toString()); //$NON-NLS-1$
				return;
			}
		}
		
		if (!thr.isAlive()) nrStepsFinished++;
	}
	
	if (nrStepsFinished==steps.size()) finished.set(true);
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:35,代码来源:Trans.java

示例10: findRunThread

import org.pentaho.di.trans.step.BaseStep; //导入依赖的package包/类
public BaseStep findRunThread(String stepname)
{
	if (steps==null) return null;

	for (int i=0;i<steps.size();i++)
	{
		StepMetaDataCombi sid = steps.get(i);
		BaseStep rt = (BaseStep)sid.step;
		if (rt.getStepname().equalsIgnoreCase(stepname)) return rt;
	}
	return null;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:13,代码来源:Trans.java

示例11: findDataInterface

import org.pentaho.di.trans.step.BaseStep; //导入依赖的package包/类
public StepDataInterface findDataInterface(String name)
{
    if (steps==null) return null;

    for (int i=0;i<steps.size();i++)
    {
        StepMetaDataCombi sid = steps.get(i);
        BaseStep rt = (BaseStep)sid.step;
        if (rt.getStepname().equalsIgnoreCase(name)) return sid.data;
    }
    return null;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:13,代码来源:Trans.java

示例12: dispose

import org.pentaho.di.trans.step.BaseStep; //导入依赖的package包/类
public void dispose(StepMetaInterface smi, StepDataInterface sdi)
{
	meta = (GetXMLDataMeta) smi;
	data = (GetXMLDataData) sdi;
	if(data.file!=null) 
	{
		try{
		data.file.close();
		}catch (Exception e){}
	}
	if(data.an!=null){
		data.an.clear();
		data.an=null;
	}
	if(data.NAMESPACE!=null) {
		data.NAMESPACE.clear();
		data.NAMESPACE=null;
	}
	if(data.NSPath!=null) {
		data.NSPath.clear();
		data.NSPath=null;
	}
	if(data.readrow!=null) {
		data.readrow=null;
	}
	if(data.document!=null) {
		data.document=null;
	}
    if (data.fr != null) {
       BaseStep.closeQuietly(data.fr);
    }
    if (data.is != null) {
	       BaseStep.closeQuietly(data.is);
	    }
    if(data.files!=null) data.files=null;
	super.dispose(smi, sdi);
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:38,代码来源:GetXMLData.java

示例13: checkRowMixingStatically

import org.pentaho.di.trans.step.BaseStep; //导入依赖的package包/类
/**
 * Check a step to see if there are no multiple steps to read from.
 * If so, check to see if the receiving rows are all the same in layout.
 * We only want to ONLY use the DBCache for this to prevent GUI stalls.
 * 
 * @param stepMeta the step to check
 * @throws KettleRowException in case we detect a row mixing violation
 *
 */
public void checkRowMixingStatically(StepMeta stepMeta, ProgressMonitorListener monitor) throws KettleRowException
{
   int nrPrevious = findNrPrevSteps(stepMeta);
   if (nrPrevious>1)
   {
       RowMetaInterface referenceRow = null;
       // See if all previous steps send out the same rows...
       for (int i=0;i<nrPrevious;i++)
       {
           StepMeta previousStep = findPrevStep(stepMeta, i);
           try
           {
               RowMetaInterface row = getStepFields(previousStep, monitor); // Throws KettleStepException
               if (referenceRow==null)
               {
                   referenceRow = row;
               }
               else
                   if ( ! stepMeta.getStepMetaInterface().excludeFromRowLayoutVerification())
                   {
                   {
                	   BaseStep.safeModeChecking(referenceRow, row);
                   }                       
               }
           }
           catch(KettleStepException e)
           {
               // We ignore this one because we are in the process of designing the transformation, anything intermediate can go wrong.
           }
       }
   }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:42,代码来源:TransMeta.java

示例14: checkRowMixingStatically

import org.pentaho.di.trans.step.BaseStep; //导入依赖的package包/类
/**
 * Check a step to see if there are no multiple steps to read from.
 * If so, check to see if the receiving rows are all the same in layout.
 * We only want to ONLY use the DBCache for this to prevent GUI stalls.
 * 
 * @param stepMeta the step to check
 * @throws KettleRowException in case we detect a row mixing violation
 *
 */
public void checkRowMixingStatically(StepMeta stepMeta, ProgressMonitorListener monitor) throws KettleRowException
{
   int nrPrevious = findNrPrevSteps(stepMeta);
   if (nrPrevious>1)
   {
       RowMetaInterface referenceRow = null;
       // See if all previous steps send out the same rows...
       for (int i=0;i<nrPrevious;i++)
       {
           StepMeta previousStep = findPrevStep(stepMeta, i);
           try
           {
               RowMetaInterface row = getStepFields(previousStep, monitor); // Throws KettleStepException
               if (referenceRow==null)
               {
                   referenceRow = row;
               }
               else
               {
                   if ( ! stepMeta.getStepMetaInterface().excludeFromRowLayoutVerification())
                   {
                	   BaseStep.safeModeChecking(referenceRow, row);
                   }                       
               }
           }
           catch(KettleStepException e)
           {
               // We ignore this one because we are in the process of designing the transformation, anything intermediate can go wrong.
           }
       }
   }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:42,代码来源:TransMeta.java

示例15: AbstractFileErrorHandler

import org.pentaho.di.trans.step.BaseStep; //导入依赖的package包/类
public AbstractFileErrorHandler(Date date, String destinationDirectory,
		String fileExtension, String encoding, BaseStep baseStep) {
	this.destinationDirectory = destinationDirectory;
	this.fileExtension = fileExtension;
	this.encoding = encoding;
	this.baseStep = baseStep;
	this.writers = new HashMap<Object,Writer>();
	initDateFormatter(date);
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:10,代码来源:AbstractFileErrorHandler.java


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