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


Java KettlePluginException类代码示例

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


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

示例1: getFields

import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
public void getFields( RowMetaInterface inputRowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
  if ( !Const.isEmpty( this.valueFieldName ) ) {

    // Add value field meta if not found, else set it
    ValueMetaInterface v;
    try {
      v = ValueMetaFactory.createValueMeta( this.valueFieldName, ValueMeta.getType( this.valueTypeName ) );
    } catch ( KettlePluginException e ) {
      throw new KettleStepException( BaseMessages.getString( PKG,
          "HazelcastInputMeta.Exception.ValueTypeNameNotFound" ), e );
    }
    v.setOrigin( origin );
    int valueFieldIndex = inputRowMeta.indexOfValue( this.valueFieldName );
    if ( valueFieldIndex < 0 ) {
      inputRowMeta.addValueMeta( v );
    } else {
      inputRowMeta.setValueMeta( valueFieldIndex, v );
    }
  } else {
    throw new KettleStepException( BaseMessages
        .getString( PKG, "HazelcastInputMeta.Exception.ValueFieldNameNotFound" ) );
  }
}
 
开发者ID:mattyb149,项目名称:pdi-hazelcast-plugin,代码行数:25,代码来源:HazelcastInputMeta.java

示例2: getTestObject

import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
@Override public RowMetaInterface getTestObject() {
  int size = random.nextInt( 10 ) + 1;
  RowMetaInterface result = new RowMeta();

  for ( int i = 0; i < size; i++ ) {
    try {
      ValueMetaInterface vm =
          ValueMetaFactory.createValueMeta( "field" + i,
              i % 2 == 0 ? ValueMetaInterface.TYPE_STRING : ValueMetaInterface.TYPE_NUMBER );
      result.addValueMeta( vm );
    } catch ( KettlePluginException e ) {
      throw new RuntimeException( e );
    }
  }

  return result;
}
 
开发者ID:pentaho-labs,项目名称:pentaho-cpython-plugin,代码行数:18,代码来源:CPythonRowMetaInterfaceValidator.java

示例3: getFields

import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
@SuppressWarnings( "deprecation" )
@Override
public void getFields( RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
      VariableSpace space ) throws KettleStepException {
   try {
	if ( m_fields == null || m_fields.size() == 0 ){
	   // TODO: get the name "json" from dialog
		
	   ValueMetaInterface jsonValueMeta = ValueMetaFactory.createValueMeta("JSON", ValueMetaInterface.TYPE_STRING);
	   jsonValueMeta.setOrigin( origin );
	   rowMeta.addValueMeta( jsonValueMeta );
	}else{
	   // get the selected fields
	   for ( SequoiaDBInputField f : m_fields ){
	      ValueMetaInterface vm = ValueMetaFactory.createValueMeta(f.m_fieldName, ValueMetaFactory.getIdForValueMeta( f.m_kettleType ));
	      vm.setOrigin( origin );
	      rowMeta.addValueMeta( vm );
	   }
	}
} catch (KettlePluginException e) {
	throw new KettleStepException(e);
}
}
 
开发者ID:SequoiaDB,项目名称:pentaho-sequoiadb-plugin,代码行数:24,代码来源:SequoiaDBInputMeta.java

示例4: isBigDataPluginInstalled

import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
public boolean isBigDataPluginInstalled() throws KettleException
{
  if( PluginRegistry.getInstance().findPluginWithId( JobEntryPluginType.class, "HadoopTransJobExecutorPlugin" ) != null )
  {
    try {

      PluginRegistry.getInstance().loadClass(
        PluginRegistry.getInstance().findPluginWithId( JobEntryPluginType.class, "HadoopTransJobExecutorPlugin" ) );
    } catch (KettlePluginException ex)
    {
      throw new KettleException( ex.getMessage(), ex );
    }
    return true;
  }
  return false;
}
 
开发者ID:inquidia,项目名称:ParquetPlugin,代码行数:17,代码来源:ParquetOutputMeta.java

示例5: getFields

import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
public void getFields( RowMetaInterface inputRowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
  if ( !Const.isEmpty( this.valueFieldName ) ) {

    // Add value field meta if not found, else set it
    ValueMetaInterface v;
    try {
      v = ValueMetaFactory.createValueMeta( this.valueFieldName, ValueMeta.getType( this.valueTypeName ) );
    } catch ( KettlePluginException e ) {
      throw new KettleStepException( BaseMessages.getString( PKG,
          "MemcachedInputMeta.Exception.ValueTypeNameNotFound" ), e );
    }
    v.setOrigin( origin );
    int valueFieldIndex = inputRowMeta.indexOfValue( this.valueFieldName );
    if ( valueFieldIndex < 0 ) {
      inputRowMeta.addValueMeta( v );
    } else {
      inputRowMeta.setValueMeta( valueFieldIndex, v );
    }
  } else {
    throw new KettleStepException( BaseMessages
        .getString( PKG, "MemcachedInputMeta.Exception.ValueFieldNameNotFound" ) );
  }
}
 
开发者ID:mattyb149,项目名称:pdi-memcached-plugin,代码行数:25,代码来源:MemcachedInputMeta.java

示例6: getFields

import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
@Override
public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
    String outputField = space.environmentSubstitute(getOutputIDFieldName());
    ValueMetaInterface outputInterface = null;
    try {
        outputInterface = ValueMetaFactory.createValueMeta(outputField, ValueMetaInterface.TYPE_STRING);
    } catch (KettlePluginException e) {
        throw new KettleStepException(e);
    }
    boolean fieldFound = false;
    for (int i = 0; i < inputRowMeta.size(); i++) {
        ValueMetaInterface valueMetaInterface = inputRowMeta.getValueMeta(i);
        String interfaceName = valueMetaInterface.getName();
        if (outputField.equals(interfaceName)) {
            fieldFound = true;
            inputRowMeta.setValueMeta(i, outputInterface);
            break;
        }
    }
    if (!fieldFound) {
        inputRowMeta.addValueMeta(outputInterface);
    }
}
 
开发者ID:brosander,项目名称:kettle-plugins,代码行数:24,代码来源:FTLMeta.java

示例7: doGet

import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    resp.setContentType("image/png");
    String id = req.getParameter("name");
    PluginInterface pluginInterface = images.get(id);
    if (pluginInterface == null) {
        for (PluginInterface pluginInterface1 : registry.getPlugins(StepPluginType.class)) {
            if (pluginInterface1.getIds()[0].equalsIgnoreCase(id)) {
                pluginInterface = pluginInterface1;
            }
        }
    }
    OutputStream outputStream = resp.getOutputStream();
    try {
        IOUtils.copy(getImage(pluginInterface), outputStream);
    } catch (KettlePluginException e) {
        throw new ServletException(e);
    }
    outputStream.flush();
}
 
开发者ID:brosander,项目名称:kettle-plugins,代码行数:21,代码来源:KThinStepImageServlet.java

示例8: createPartitioner

import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
public void createPartitioner( String method ) throws KettlePluginException {
	methodType = getMethodType(method);
    switch ( methodType ) {
    case PARTITIONING_METHOD_SPECIAL: {
    	PluginRegistry registry = PluginRegistry.getInstance();
    	PluginInterface plugin = registry.findPluginWithId(PartitionerPluginType.class, method);
    	partitioner = (Partitioner) registry.loadClass(plugin);
    	partitioner.setId(plugin.getIds()[0]);
    	break;
    }
    case PARTITIONING_METHOD_NONE:
    default: partitioner = null;
    }
    if( partitioner != null ) 
    {
    	partitioner.setMeta(this);
    }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:19,代码来源:StepPartitioningMeta.java

示例9: registerXmlPlugins

import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
protected void registerXmlPlugins() throws KettlePluginException {
	for (PluginFolderInterface folder : pluginFolders) {
		
		if (folder.isPluginXmlFolder()) {
			List<FileObject> pluginXmlFiles = findPluginXmlFiles(folder.getFolder());
			for (FileObject file : pluginXmlFiles) {
				
				try {
					Document document = XMLHandler.loadXMLFile(file);
					Node pluginNode = XMLHandler.getSubNode(document, "partitioner-plugin");
					if (pluginNode!=null) {
						registerPluginFromXmlResource(pluginNode, KettleVFS.getFilename(file.getParent()), this.getClass(), false, file.getParent().getURL());
					}
				} catch(Exception e) {
					// We want to report this plugin.xml error, perhaps an XML typo or something like that...
					//
					log.logError("Error found while reading partitioning plugin.xml file: "+file.getName().toString(), e);
				}
			}
		}
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:23,代码来源:PartitionerPluginType.java

示例10: registerXmlPlugins

import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
protected void registerXmlPlugins() throws KettlePluginException {
	for (PluginFolderInterface folder : pluginFolders) {
		
		if (folder.isPluginXmlFolder()) {
			List<FileObject> pluginXmlFiles = findPluginXmlFiles(folder.getFolder());
			for (FileObject file : pluginXmlFiles) {
				
				try {
					Document document = XMLHandler.loadXMLFile(file);
					Node pluginNode = XMLHandler.getSubNode(document, "plugin");
					if (pluginNode!=null) {
						registerPluginFromXmlResource(pluginNode, KettleVFS.getFilename(file.getParent()), this.getClass(), false, file.getParent().getURL());
					}
				} catch(Exception e) {
					// We want to report this plugin.xml error, perhaps an XML typo or something like that...
					//
					log.logError("Error found while reading step plugin.xml file: "+file.getName().toString(), e);
				}
			}
		}
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:23,代码来源:StepPluginType.java

示例11: registerXmlPlugins

import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
protected void registerXmlPlugins() throws KettlePluginException {
	for (PluginFolderInterface folder : pluginFolders) {
		
		if (folder.isPluginXmlFolder()) {
			List<FileObject> pluginXmlFiles = findPluginXmlFiles(folder.getFolder());
			for (FileObject file : pluginXmlFiles) {
				
				try {
					Document document = XMLHandler.loadXMLFile(file);
					Node pluginNode = XMLHandler.getSubNode(document, "plugin");

					registerPluginFromXmlResource(pluginNode, KettleVFS.getFilename(file.getParent()), this.getClass(), false, file.getParent().getURL());
				} catch(Exception e) {
					// We want to report this plugin.xml error, perhaps an XML typo or something like that...
					//
					log.logError("Error found while reading job entry plugin.xml file: "+file.getName().toString(), e);
				}
			}
		}
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:22,代码来源:JobEntryPluginType.java

示例12: registerXmlPlugins

import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
protected void registerXmlPlugins() throws KettlePluginException {
	for (PluginFolderInterface folder : pluginFolders) {
		
		if (folder.isPluginXmlFolder()) {
			List<FileObject> pluginXmlFiles = findPluginXmlFiles(folder.getFolder());
			for (FileObject file : pluginXmlFiles) {
				
				try {
					Document document = XMLHandler.loadXMLFile(file);
					Node pluginNode = XMLHandler.getSubNode(document, "plugin");

					registerPluginFromXmlResource(pluginNode, KettleVFS.getFilename(file.getParent()), this.getClass(), false, file.getParent().getURL());
				} catch(Exception e) {
					// We want to report this plugin.xml error, perhaps an XML typo or something like that...
					//
					log.logError("Error found while reading repository plugin.xml file: "+file.getName().toString(), e);
				}
			}
		}
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:22,代码来源:RepositoryPluginType.java

示例13: registerXmlPlugins

import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
protected void registerXmlPlugins() throws KettlePluginException {
  for ( PluginFolderInterface folder : pluginFolders ) {

    if ( folder.isPluginXmlFolder() ) {
      List<FileObject> pluginXmlFiles = findPluginXmlFiles( folder.getFolder() );
      for ( FileObject file : pluginXmlFiles ) {

        try {
          Document document = XMLHandler.loadXMLFile( file );
          Node pluginNode = XMLHandler.getSubNode( document, "plugin" );
          if ( pluginNode != null ) {
            registerPluginFromXmlResource( pluginNode, KettleVFS.getFilename( file.getParent() ), this
              .getClass(), false, file.getParent().getURL() );
          }
        } catch ( Exception e ) {
          // We want to report this plugin.xml error, perhaps an XML typo or
          // something like that...
          //
          log.logError( "Error found while reading step plugin.xml file: " + file.getName().toString(), e );
        }
      }
    }
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:25,代码来源:CartePluginType.java

示例14: setup

import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
@Before
public void setup() throws IOException, KettlePluginException {
  PluginRegistry.addPluginType( ValueMetaPluginType.getInstance() );
  PluginRegistry.init();

  GaData gaData = new GaData();
  headers = new ArrayList<>();
  headers.add( createColumnHeader( "DIMENSION", "ga:date", null ) );
  headers.add( createColumnHeader( "DIMENSION", "ga:daysSinceLastVisit", null ) );
  headers.add( createColumnHeader( "DIMENSION", "ga:visitLength", null ) );
  headers.add( createColumnHeader( "DIMENSION", "ga:visitCount", null ) );
  headers.add( createColumnHeader( "DIMENSION", "ga:latitude", null ) );
  headers.add( createColumnHeader( "DIMENSION", "ga:longitude", null ) );
  headers.add( createColumnHeader( "DIMENSION", "ga:other", null ) );

  headers.add( createColumnHeader( "METRIC", "currency", "currency" ) );
  headers.add( createColumnHeader( "METRIC", "float", "float" ) );
  headers.add( createColumnHeader( "METRIC", "percent", "percent" ) );
  headers.add( createColumnHeader( "METRIC", "us_currency", "us_currency" ) );
  headers.add( createColumnHeader( "METRIC", "time", "time" ) );
  headers.add( createColumnHeader( "METRIC", "integer", "integer" ) );
  headers.add( createColumnHeader( "METRIC", "other", "other" ) );

  gaData.setColumnHeaders( headers );

  gaData.setProfileInfo( new GaData.ProfileInfo() );

  List<List<String>> data = new ArrayList<>();
  data.add( new ArrayList<String>() );

  gaData.setRows( data );
  doReturn( gaData ).when( query ).execute();
  doReturn( tableItem ).when( table ).getItem( anyInt() );
  tableView.table = table;
  doReturn( tableView ).when( dialog ).getTableView();
  doCallRealMethod().when( dialog ).getFields();
  doReturn( query ).when( dialog ).getPreviewQuery();
  doReturn( mock( GaInputStepMeta.class ) ).when( dialog ).getInput();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:40,代码来源:GaInputStepDialogTest.java

示例15: setup

import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
@Before
public void setup() throws KettlePluginException {
  mockSpace = mock( VariableSpace.class );
  doReturn("N" ).when( mockSpace ).getVariable( any(), anyString() );

  rowMeta = spy( new RowMeta() );
  memoryGroupByMeta = spy( new MemoryGroupByMeta() );

  mockStatic( ValueMetaFactory.class );
  when( ValueMetaFactory.createValueMeta( anyInt() ) ).thenCallRealMethod();
  when( ValueMetaFactory.createValueMeta( anyString(), anyInt() ) ).thenCallRealMethod();
  when( ValueMetaFactory.createValueMeta( "maxDate", 3, -1, -1 ) ).thenReturn( new ValueMetaDate( "maxDate" ) );
  when( ValueMetaFactory.createValueMeta( "minDate", 3, -1, -1 ) ).thenReturn( new ValueMetaDate( "minDate" ) );
  when( ValueMetaFactory.createValueMeta( "countDate", 5, -1, -1 ) ).thenReturn( new ValueMetaInteger( "countDate" ) );
  when( ValueMetaFactory.getValueMetaName( 3 ) ).thenReturn( "Date" );
  when( ValueMetaFactory.getValueMetaName( 5 ) ).thenReturn( "Integer" );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:18,代码来源:MemoryGroupByMetaGetFieldsTest.java


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