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


Java StepMeta.getStepMetaInterface方法代碼示例

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


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

示例1: transCopy

import org.pentaho.di.trans.step.StepMeta; //導入方法依賴的package包/類
/**
* 將指定轉換複製到KettleUtils中的資源庫 <br/>
* @author jingma
* @param jobName 轉換名稱
* @param jobPath 轉換路徑
   * @param fromRepository 來源資源庫
   * @param toRepository 目標資源庫
* @throws KettleException
*/
public static void transCopy(String transName,String transPath,Repository fromRepository,
           Repository toRepository) throws KettleException {
	TransMeta tm = KettleUtils.loadTrans(transName, transPath, fromRepository);
	for(StepMeta sm:tm.getSteps()){
		if(sm.isJobExecutor()){
			JobExecutorMeta jem = (JobExecutorMeta)sm.getStepMetaInterface();
			jobCopy(jem.getJobName(),jem.getDirectoryPath(),fromRepository,toRepository);
		}
		else if(sm.getStepMetaInterface() instanceof TransExecutorMeta){
			TransExecutorMeta te = (TransExecutorMeta)sm.getStepMetaInterface();
			transCopy(te.getTransName(), te.getDirectoryPath(),fromRepository,toRepository);
		}
	}
	if(!isDirectoryExist(toRepository,transPath)){
		//所在目錄不存在則創建
	    toRepository.createRepositoryDirectory(toRepository.findDirectory("/"), transPath);
	}
	tm.setRepository(toRepository);
	tm.setMetaStore(toRepository.getMetaStore());
	KettleUtils.saveTrans(toRepository,tm);
}
 
開發者ID:majinju,項目名稱:KettleEasyExpand,代碼行數:31,代碼來源:KettleUtils.java

示例2: processGetFileNamesMeta

import org.pentaho.di.trans.step.StepMeta; //導入方法依賴的package包/類
/**
 * @param stepsMeta
 * @throws IOException
 */
private void processGetFileNamesMeta(List<StepMeta> stepsMeta) throws IOException {
  for (StepMeta step : stepsMeta) {
    if (step.getStepMetaInterface() instanceof GetFileNamesMeta) {
      GetFileNamesMeta stepMetaInterface = (GetFileNamesMeta) step.getStepMetaInterface();
      if (null != model.getCsvFilePath()) {
        boolean checkIsFolder = GraphExecutionUtil.checkIsFolder(model.getCsvFilePath());
        if (checkIsFolder) {
          stepMetaInterface.setFileName(new String[] { model.getCsvFilePath() });
          stepMetaInterface.setFileMask(new String[] { ".*\\.csv$|.*\\.inprogress" });
          stepMetaInterface.setExcludeFileMask(new String[] { "1" });
        } else {
          //If absolute file path is provided for the data load and stopped in between then csv
          // file will be
          // changed to inprogress, and when next time server start then we need to check the
          // file name extension.
          // can contain .csv.inprogress file.

          FileType fileType = FileFactory.getFileType(model.getCsvFilePath());

          boolean exists = FileFactory.isFileExist(model.getCsvFilePath(), fileType);

          if (exists) {
            stepMetaInterface.setFileName(new String[] { model.getCsvFilePath() });
            stepMetaInterface.setExcludeFileMask(new String[] { null });
          } else {
            stepMetaInterface.setFileName(new String[] {
                model.getCsvFilePath() + CarbonCommonConstants.FILE_INPROGRESS_STATUS });
            stepMetaInterface.setExcludeFileMask(new String[] { null });
          }
        }
      } else if (model.isDirectLoad()) {
        String[] files = new String[model.getFilesToProcess().size()];
        int i = 0;
        for (String file : model.getFilesToProcess()) {
          files[i++] = file;
        }
        stepMetaInterface.setFileName(files);
      }
      break;
    }
  }
}
 
開發者ID:carbondata,項目名稱:carbondata,代碼行數:47,代碼來源:DataGraphExecuter.java


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