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


Java ValueMetaPluginType类代码示例

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


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

示例1: testRecordReader

import org.pentaho.di.core.row.value.ValueMetaPluginType; //导入依赖的package包/类
/**
 * Read the rows back from Orc file
 *
 * @throws Exception
 */
private void testRecordReader() throws Exception {

  PluginRegistry.addPluginType( ValueMetaPluginType.getInstance() );
  PluginRegistry.init( true );

  PentahoOrcInputFormat pentahoOrcInputFormat = new PentahoOrcInputFormat();
  pentahoOrcInputFormat.setSchema( schemaDescription );
  pentahoOrcInputFormat.setInputFile( filePath );
  IPentahoInputFormat.IPentahoRecordReader pentahoRecordReader = pentahoOrcInputFormat.createRecordReader( null );
  final AtomicInteger rowNumber = new AtomicInteger();
  for ( RowMetaAndData row : pentahoRecordReader ) {
    final AtomicInteger fieldNumber = new AtomicInteger();
    schemaDescription.forEach( field -> testValue( field, row, rowNumber, fieldNumber ) );
    rowNumber.incrementAndGet();
  }
}
 
开发者ID:pentaho,项目名称:pentaho-hadoop-shims,代码行数:22,代码来源:PentahoOrcReadWriteTest.java

示例2: init

import org.pentaho.di.core.row.value.ValueMetaPluginType; //导入依赖的package包/类
public static synchronized void init() throws KettleException {
	if (initialized!=null) {
		return;
	}
	
	createKettleHome();
	
	// Read the kettle.properties file before anything else
	//
	EnvUtil.environmentInit();
	
	// Load value meta data plugins
	//
	PluginRegistry.addPluginType(ValueMetaPluginType.getInstance());
	PluginRegistry.init(true);
	
	initialized=new Boolean(true);
}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:19,代码来源:KettleClientEnvironment.java

示例3: setUp

import org.pentaho.di.core.row.value.ValueMetaPluginType; //导入依赖的package包/类
@Before
public void setUp() throws KettlePluginException, SQLException {
  PluginRegistry.addPluginType( ValueMetaPluginType.getInstance() );
  PluginRegistry.init( true );

  loaderData = new VerticaBulkLoaderData();
  loaderMeta = spy( new VerticaBulkLoaderMeta() );

  TransMeta transMeta = new TransMeta();
  transMeta.setName( "loader" );

  PluginRegistry pluginRegistry = PluginRegistry.getInstance();

  String loaderPid = pluginRegistry.getPluginId( StepPluginType.class, loaderMeta );
  StepMeta stepMeta = new StepMeta( loaderPid, "loader", loaderMeta );
  Trans trans = new Trans( transMeta );
  transMeta.addStep( stepMeta );
  trans.setRunning( true );

  loaderMeta.setDatabaseMeta( mock( DatabaseMeta.class ) );

  loader = spy( new VerticaBulkLoader( stepMeta, loaderData, 1, transMeta, trans ) );
  loader.init( loaderMeta, loaderData );

  doReturn( mock( VerticaCopyStream.class ) ).when( loader ).createVerticaCopyStream( anyString() );
}
 
开发者ID:pentaho,项目名称:pentaho-vertica-bulkloader,代码行数:27,代码来源:VerticaBulkLoaderTest.java

示例4: setUpBeforeClass

import org.pentaho.di.core.row.value.ValueMetaPluginType; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  KettleEnvironment.init();

  // PluginRegistry.addPluginType(ValueMetaPluginType.getInstance());
  PluginRegistry.getInstance().registerPluginType( ValueMetaPluginType.class );

  Map<Class<?>, String> classes = new HashMap<Class<?>, String>();
  classes.put( ValueMetaInterface.class, "org.pentaho.di.core.row.value.ValueMetaString" );
  p1 =
      new Plugin( new String[] { "2" }, ValueMetaPluginType.class, ValueMetaInterface.class, "", "", "", "", false,
      true, classes, null, null, null );

  classes = new HashMap<Class<?>, String>();
  classes.put( ValueMetaInterface.class, "org.pentaho.di.core.row.value.ValueMetaInteger" );
  p2 =
      new Plugin( new String[] { "5" }, ValueMetaPluginType.class, ValueMetaInterface.class, "", "", "", "", false,
      true, classes, null, null, null );

  PluginRegistry.getInstance().registerPlugin( ValueMetaPluginType.class, p1 );
  PluginRegistry.getInstance().registerPlugin( ValueMetaPluginType.class, p2 );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:23,代码来源:MappingInputFieldsTest.java

示例5: setup

import org.pentaho.di.core.row.value.ValueMetaPluginType; //导入依赖的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

示例6: beforeClass

import org.pentaho.di.core.row.value.ValueMetaPluginType; //导入依赖的package包/类
@BeforeClass public static void beforeClass() throws KettleException {
  PluginRegistry.addPluginType( TwoWayPasswordEncoderPluginType.getInstance() );
  PluginRegistry.addPluginType( ValueMetaPluginType.getInstance() );
  PluginRegistry.init();
  String
      passwordEncoderPluginID =
      Const.NVL( EnvUtil.getSystemProperty( Const.KETTLE_PASSWORD_ENCODER_PLUGIN ), "Kettle" );
  Encr.init( passwordEncoderPluginID );
}
 
开发者ID:pentaho-labs,项目名称:pentaho-mqtt-plugin,代码行数:10,代码来源:MQTTSubscriberMetaTest.java

示例7: beforeClass

import org.pentaho.di.core.row.value.ValueMetaPluginType; //导入依赖的package包/类
@BeforeClass public static void beforeClass() throws KettleException {
  PluginRegistry.addPluginType( TwoWayPasswordEncoderPluginType.getInstance() );
  PluginRegistry.addPluginType( ValueMetaPluginType.getInstance() );
  PluginRegistry.init();
  String passwordEncoderPluginID = Const.NVL( EnvUtil.getSystemProperty( Const.KETTLE_PASSWORD_ENCODER_PLUGIN ), "Kettle" );
  Encr.init( passwordEncoderPluginID );
}
 
开发者ID:pentaho-labs,项目名称:pentaho-mqtt-plugin,代码行数:8,代码来源:MQTTPublisherMetaTest.java

示例8: before

import org.pentaho.di.core.row.value.ValueMetaPluginType; //导入依赖的package包/类
@BeforeClass
public static void before() throws KettleException {
  PluginRegistry.addPluginType( ValueMetaPluginType.getInstance() );
  PluginRegistry.init( true );
  transMeta = getTestTransMeta();
  transExecConfig = getTestTransExecConfig( transMeta );
}
 
开发者ID:pentaho,项目名称:pentaho-hadoop-shims,代码行数:8,代码来源:MRUtilTest.java

示例9: before

import org.pentaho.di.core.row.value.ValueMetaPluginType; //导入依赖的package包/类
@Before
public void before() throws KettlePluginException {
  MockitoAnnotations.initMocks( this );
  when( space.environmentSubstitute( any( String.class ) ) )
      .thenAnswer( new Answer<String>() {
        @Override public String answer( InvocationOnMock invocationOnMock ) throws Throwable {
          return (String) invocationOnMock.getArguments()[0];
        }
      } );
  PluginRegistry.addPluginType( ValueMetaPluginType.getInstance() );
  PluginRegistry.init();
}
 
开发者ID:pentaho,项目名称:pentaho-mongodb-plugin,代码行数:13,代码来源:MongoFieldTest.java

示例10: before

import org.pentaho.di.core.row.value.ValueMetaPluginType; //导入依赖的package包/类
@Before public void before() throws MongoDbException, KettlePluginException {
  MockitoAnnotations.initMocks( this );
  MongoWrapperUtil.setMongoWrapperClientFactory( clientFactory );
  when( clientFactory.createMongoClientWrapper( any( MongoProperties.class ), any( MongoUtilLogger.class ) ) )
      .thenReturn( clientWrapper );
  when( mockDb.getCollection( any( String.class ) ) ).thenReturn( collection );
  when( collection.find() ).thenReturn( cursor );
  when( cursor.limit( anyInt() ) ).thenReturn( cursor );
  PluginRegistry.addPluginType( ValueMetaPluginType.getInstance() );
  PluginRegistry.init();
}
 
开发者ID:pentaho,项目名称:pentaho-mongodb-plugin,代码行数:12,代码来源:MongodbInputDiscoverFieldsImplTest.java

示例11: loadValueMetaPlugins

import org.pentaho.di.core.row.value.ValueMetaPluginType; //导入依赖的package包/类
private void loadValueMetaPlugins() {
  // Need to load the ValueMeta plugins
  PluginRegistry registry = PluginRegistry.getInstance();
  assertNotNull( "Registry singleton was not found!", registry );

  // Register a new plugin type...
  //
  PluginRegistry.addPluginType( ValueMetaPluginType.getInstance() );

  // Plugin Registry should initialize without exception
  Exception initException = null;
  try {
    PluginRegistry.init();
  } catch ( Exception e ) {
    initException = e;
  }
  assertNull( initException );

  // There will always be a PluginRegistryPluginType, so see if we enough plugin types here.
  //
  List<Class<? extends PluginTypeInterface>> pluginTypes = registry.getPluginTypes();
  assertTrue( "At least two plugin types expected in the registry", pluginTypes.size() > 1 );

  // ... and have at least 1 ValueMetaPlugin
  List<PluginInterface> valueMetaPlugins = registry.getPlugins( ValueMetaPluginType.class );
  assertTrue( "Size of plugins list expected to be >1", valueMetaPlugins.size() > 1 );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:28,代码来源:StringEvaluatorIT.java

示例12: tearDownAfterClass

import org.pentaho.di.core.row.value.ValueMetaPluginType; //导入依赖的package包/类
@AfterClass
public static void tearDownAfterClass() throws Exception {
  if ( p1 != null ) {
    PluginRegistry.getInstance().removePlugin( ValueMetaPluginType.class, p1 );
  }
  if ( p2 != null ) {
    PluginRegistry.getInstance().removePlugin( ValueMetaPluginType.class, p2 );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:10,代码来源:MappingInputFieldsTest.java

示例13: init

import org.pentaho.di.core.row.value.ValueMetaPluginType; //导入依赖的package包/类
public static synchronized void init() throws KettleException {
  init( Arrays.asList( LoggingPluginType.getInstance(),
    ValueMetaPluginType.getInstance(),
    DatabasePluginType.getInstance(),
    ExtensionPointPluginType.getInstance(),
    TwoWayPasswordEncoderPluginType.getInstance() ) );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:8,代码来源:KettleClientEnvironment.java

示例14: testGetNativeDataTypeClass

import org.pentaho.di.core.row.value.ValueMetaPluginType; //导入依赖的package包/类
public void testGetNativeDataTypeClass() throws KettleException {
  PluginRegistry.addPluginType( ValueMetaPluginType.getInstance() );
  PluginRegistry.init();
  String[] valueMetaNames = ValueMetaFactory.getValueMetaNames();

  for ( int i = 0; i < valueMetaNames.length; i++ ) {
    int vmId = ValueMetaFactory.getIdForValueMeta( valueMetaNames[i] );
    ValueMeta vm = new ValueMeta( "", vmId );
    ValueMetaInterface vmi = ValueMetaFactory.createValueMeta( vmId );
    assertTrue( vm.getNativeDataTypeClass().equals( vmi.getNativeDataTypeClass() ) );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:13,代码来源:ValueMetaTest.java

示例15: setUpOnce

import org.pentaho.di.core.row.value.ValueMetaPluginType; //导入依赖的package包/类
@BeforeClass
public static void setUpOnce() throws KettlePluginException, KettleException {
  // Register Natives to create a default DatabaseMeta
  DatabasePluginType.getInstance().searchPlugins();
  ValueMetaPluginType.getInstance().searchPlugins();
  KettleClientEnvironment.init();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:8,代码来源:DatabaseMetaTest.java


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