• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ValueMetaPluginType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: setUpBeforeClass

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


示例17: setUpBeforeClass

import org.pentaho.di.core.row.value.ValueMetaPluginType; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws KettlePluginException {
  PluginRegistry.addPluginType( ValueMetaPluginType.getInstance() );
  PluginRegistry.init( true );
}
 
开发者ID:matthewtckr,项目名称:pdi-zendesk-plugin,代码行数:6,代码来源:ZendeskInputMetaTest.java


示例18: beforeClass

import org.pentaho.di.core.row.value.ValueMetaPluginType; //导入依赖的package包/类
@BeforeClass public static void beforeClass() throws KettlePluginException {
  PluginRegistry.addPluginType( ValueMetaPluginType.getInstance() );
  PluginRegistry.init();
}
 
开发者ID:pentaho-labs,项目名称:pentaho-cpython-plugin,代码行数:5,代码来源:CPythonScriptExecutorMetaTest.java


示例19: testReadSimpleFile

import org.pentaho.di.core.row.value.ValueMetaPluginType; //导入依赖的package包/类
public void testReadSimpleFile() throws Exception {
    ValueMetaPluginType pluginType = ValueMetaPluginType.getInstance();
    pluginType.searchPlugins();

    PluginRegistry.init();
    PluginRegistry.addPluginType(pluginType);

    final String filename = "target/simple_name_and_age_data.kettlestream";

    // create the source
    final RowMeta rowMeta = new RowMeta();
    rowMeta.addValueMeta(new ValueMeta("name", ValueMeta.TYPE_STRING));
    rowMeta.addValueMeta(new ValueMeta("age", ValueMeta.TYPE_NUMBER));

    DataOutputStream dataOutputStream = new DataOutputStream(new FileOutputStream(filename));
    try {
        dataOutputStream.writeUTF("hmm");
        dataOutputStream.writeUTF("Data Grid");
        rowMeta.writeMeta(dataOutputStream);
        rowMeta.writeData(dataOutputStream, new Object[] { "Kasper", 30.0 });
        rowMeta.writeData(dataOutputStream, new Object[] { "Trine", 30.0 });
        rowMeta.writeData(dataOutputStream, new Object[] { "Vera", 2.0 });
    } finally {
        dataOutputStream.flush();
        dataOutputStream.close();
    }

    KettleDataContext dc = new KettleDataContext(filename);

    assertEquals("[information_schema, hmm]", Arrays.toString(dc.getSchemaNames()));

    Table[] tables = dc.getDefaultSchema().getTables();
    assertEquals(1, tables.length);

    Table table = tables[0];
    assertEquals("Table[name=Data Grid,type=TABLE,remarks=null]", table.toString());

    assertEquals(2, table.getColumnCount());
    assertEquals("Column[name=name,columnNumber=0,type=VARCHAR,nullable=true,nativeType=String,columnSize=-1]",
            table.getColumns()[0].toString());
    assertEquals("Column[name=age,columnNumber=1,type=DOUBLE,nullable=true,nativeType=Number,columnSize=-1]",
            table.getColumns()[1].toString());

    DataSet ds = dc.query().from(table).select(table.getColumns()).execute();
    assertTrue(ds.next());
    assertEquals("Row[values=[Kasper, 30.0]]", ds.getRow().toString());
    assertTrue(ds.next());
    assertEquals("Row[values=[Trine, 30.0]]", ds.getRow().toString());
    assertTrue(ds.next());
    assertEquals("Row[values=[Vera, 2.0]]", ds.getRow().toString());
    assertFalse(ds.next());
    ds.close();
}
 
开发者ID:datacleaner,项目名称:pdi-datacleaner,代码行数:54,代码来源:KettleDataContextTest.java


示例20: beforeClass

import org.pentaho.di.core.row.value.ValueMetaPluginType; //导入依赖的package包/类
@BeforeClass public static void beforeClass() throws Exception {
  PluginRegistry.addPluginType( ValueMetaPluginType.getInstance() );
  PluginRegistry.init();
}
 
开发者ID:pentaho,项目名称:pentaho-mongodb-plugin,代码行数:5,代码来源:MongoDbOutputTest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PropertyParser类代码示例发布时间:2022-05-22
下一篇:
Java JCArrayAccess类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap