本文整理汇总了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();
}
}
示例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);
}
示例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() );
}
示例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 );
}
示例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();
}
示例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 );
}
示例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 );
}
示例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 );
}
示例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();
}
示例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();
}
示例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 );
}
示例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 );
}
}
示例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() ) );
}
示例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() ) );
}
}
示例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();
}