Search in sources :

Example 21 with HadoopAccessorService

use of org.apache.oozie.service.HadoopAccessorService in project oozie by apache.

the class DiagBundleCollectorDriver method setHadoopConfig.

private boolean setHadoopConfig() {
    final String oozieHome = System.getenv("OOZIE_HOME");
    if (oozieHome == null) {
        System.err.println("OOZIE_HOME environment variable is not set. Make sure you've set it to an absolute path.");
        return false;
    }
    System.setProperty(Services.OOZIE_HOME_DIR, oozieHome);
    try {
        final Services services = initOozieServices();
        final HadoopAccessorService hadoopAccessorService = services.get(HadoopAccessorService.class);
        hadoopConfig = hadoopAccessorService.createConfiguration("*");
    } catch (ServiceException e) {
        System.err.printf("Could not initialize Hadoop configuration: %s%n", e.getMessage());
        return false;
    }
    return true;
}
Also used : Services(org.apache.oozie.service.Services) ServiceException(org.apache.oozie.service.ServiceException) HadoopAccessorService(org.apache.oozie.service.HadoopAccessorService)

Aggregations

HadoopAccessorService (org.apache.oozie.service.HadoopAccessorService)21 Configuration (org.apache.hadoop.conf.Configuration)17 XConfiguration (org.apache.oozie.util.XConfiguration)14 IOException (java.io.IOException)13 Path (org.apache.hadoop.fs.Path)12 FileSystem (org.apache.hadoop.fs.FileSystem)11 URI (java.net.URI)10 HadoopAccessorException (org.apache.oozie.service.HadoopAccessorException)10 URISyntaxException (java.net.URISyntaxException)6 CommandException (org.apache.oozie.command.CommandException)6 StringReader (java.io.StringReader)4 Element (org.jdom.Element)4 JDOMException (org.jdom.JDOMException)4 InputStreamReader (java.io.InputStreamReader)3 StringWriter (java.io.StringWriter)3 HashMap (java.util.HashMap)3 JPAExecutorException (org.apache.oozie.executor.jpa.JPAExecutorException)3 WorkflowAppService (org.apache.oozie.service.WorkflowAppService)3 SAXException (org.xml.sax.SAXException)3 Reader (java.io.Reader)2