private static void shutdown( KettleLifecycleSupport kettleLifecycleSupport ) { if ( isInitialized() ) { try { kettleLifecycleSupport.onEnvironmentShutdown(); } catch ( Throwable t ) { System.err.println( BaseMessages.getString( PKG, "LifecycleSupport.ErrorInvokingKettleEnvironmentShutdownListeners" ) ); t.printStackTrace(); } } }
/** * Initialize the Kettle environment with settings from the provided configuration * * @param conf * Configuration to configure Kettle environment with */ private static void initKettleEnvironment( Configuration conf ) throws KettleException { if ( !KettleEnvironment.isInitialized() ) { String kettleHome = getKettleHomeProperty( conf ); String pluginDir = getPluginDirProperty( conf ); String metaStoreDir = getMetastoreDirProperty( conf ); System.setProperty( "KETTLE_HOME", kettleHome ); System.setProperty( Const.PLUGIN_BASE_FOLDERS_PROP, pluginDir ); System.setProperty( Const.PENTAHO_METASTORE_FOLDER, metaStoreDir ); System.out.println( BaseMessages.getString( MRUtil.class, "KettleHome.Info", kettleHome ) ); System.out.println( BaseMessages.getString( MRUtil.class, "PluginDirectory.Info", pluginDir ) ); System.out.println( BaseMessages.getString( MRUtil.class, "MetasStoreDirectory.Info", metaStoreDir ) ); KettleEnvironment.init(); } }
@Before public void setUp() throws Exception { KettleEnvironment.init(); if ( !KettleEnvironment.isInitialized() ) { throw new Exception( "Kettle Environment not initialized" ); } }