public List<PluginInterface> findPluginsByFolder( URL folder ) { String path = folder.getPath(); try { path = folder.toURI().normalize().getPath(); } catch ( URISyntaxException e ) { log.logError( e.getLocalizedMessage(), e ); } if ( path.endsWith( "/" ) ) { path = path.substring( 0, path.length() - 1 ); } List<PluginInterface> result = new ArrayList<PluginInterface>(); lock.readLock().lock(); try { for ( Set<PluginInterface> typeInterfaces : pluginMap.values() ) { for ( PluginInterface plugin : typeInterfaces ) { URL pluginFolder = plugin.getPluginDirectory(); try { if ( pluginFolder != null && pluginFolder.toURI().normalize().getPath().startsWith( path ) ) { result.add( plugin ); } } catch ( URISyntaxException e ) { log.logError( e.getLocalizedMessage(), e ); } } } } finally { lock.readLock().unlock(); } return result; }
if ( plugin.getPluginDirectory() != null ) { folderBasedClassLoaderMap.remove( plugin.getPluginDirectory().toString() );
ucl = classLoaderGroupsMap.get( plugin.getClassLoaderGroup() ); } else { ucl = folderBasedClassLoaderMap.get( plugin.getPluginDirectory().toString() );
if ( plugin.getPluginDirectory() != null ) { ucl = folderBasedClassLoaderMap.get( plugin.getPluginDirectory().toString() ); if ( ucl == null ) { ucl = createClassLoader( plugin ); folderBasedClassLoaderMap.put( plugin.getPluginDirectory().toString(), ucl ); } else {
public String getVfsFilename( Configuration conf ) { return pluginInterface.getPluginDirectory().getPath() + Const.FILE_SEPARATOR + getProperty( conf, pmrProperties, PENTAHO_MAPREDUCE_PROPERTY_PMR_LIBRARIES_ARCHIVE_FILE, null ); } }
public String getPluginDir() { URL pluginBaseURL = PluginRegistry.getInstance().findPluginWithId(StepPluginType.class, "TypeExitRubyStep").getPluginDirectory(); File pluginBaseFile; try { pluginBaseFile = new File(pluginBaseURL.toURI()); } catch (URISyntaxException e) { pluginBaseFile = new File(pluginBaseURL.getPath()); } return pluginBaseFile.getAbsolutePath(); }
/** * Loads a properties file from the plugin directory for the plugin interface provided * * @param plugin * @return * @throws KettleFileException * @throws IOException */ protected Properties loadProperties( PluginInterface plugin, String relativeName ) throws KettleFileException, IOException { if ( plugin == null ) { throw new NullPointerException(); } FileObject propFile = KettleVFS.getFileObject( plugin.getPluginDirectory().getPath() + Const.FILE_SEPARATOR + relativeName ); if ( !propFile.exists() ) { throw new FileNotFoundException( propFile.toString() ); } try { return new PropertiesConfigurationProperties( propFile ); } catch ( Exception e ) { // Do not catch ConfigurationException. Different shims will use different // packages for this exception. throw new IOException( e ); } }
@VisibleForTesting PentahoMapReduceJobBuilderImpl( NamedCluster namedCluster, HadoopConfiguration hadoopConfiguration, LogChannelInterface log, VariableSpace variableSpace, PluginInterface pluginInterface, FileObject vfsPluginDirectory, Properties pmrProperties, TransFactory transFactory, PMRArchiveGetter pmrArchiveGetter, List<TransformationVisitorService> visitorServices ) { super( namedCluster, hadoopConfiguration.getHadoopShim(), log, variableSpace ); this.hadoopShim = hadoopConfiguration.getHadoopShim(); this.log = log; this.vfsPluginDirectory = vfsPluginDirectory; this.pmrProperties = pmrProperties; this.transFactory = transFactory; this.installId = buildInstallIdBase( hadoopConfiguration ); this.pmrArchiveGetter = pmrArchiveGetter; this.visitorServices = addDefaultVisitors( visitorServices ); }
/** * Find the location of the big data plugin. This relies on the Hadoop Job Executor job entry existing within the big * data plugin. * * @return The VFS location of the big data plugin * @throws KettleException */ public FileObject locatePluginDirectory() throws ConfigurationException { FileObject dir = null; boolean exists = false; try { dir = KettleVFS.getFileObject( getPluginInterface().getPluginDirectory().toExternalForm() ); exists = dir.exists(); } catch ( Exception e ) { throw new ConfigurationException( BaseMessages.getString( PKG, "HadoopConfigurationBootstrap.PluginDirectoryNotFound" ), e ); } if ( !exists ) { throw new ConfigurationException( BaseMessages.getString( PKG, "HadoopConfigurationBootstrap.PluginDirectoryNotFound" ) ); } return dir; }
pluginBaseDir = PluginRegistry.getInstance().findPluginWithId(StepPluginType.class, "TypeExitRubyStep").getPluginDirectory().toString(); URL pluginBaseURL = PluginRegistry.getInstance().findPluginWithId(StepPluginType.class, "TypeExitRubyStep").getPluginDirectory();