use of org.apache.oozie.client.OozieClientException in project oozie by apache.
the class ServerInfoCollector method storeServerConfiguration.
void storeServerConfiguration(File outputDir) {
try {
System.out.print("Getting Configuration...");
final Map<String, String> serverConfigMap = client.getServerConfiguration();
final Configuration serverConfig = new Configuration(false);
for (Map.Entry<String, String> ent : serverConfigMap.entrySet()) {
serverConfig.set(ent.getKey(), ent.getValue());
}
try (OutputStream outputStream = new FileOutputStream(new File(outputDir, "effective-oozie-site.xml"))) {
serverConfig.writeXml(outputStream);
}
System.out.println("Done");
} catch (OozieClientException | IOException e) {
System.err.printf("Exception occurred during the retrieval of effective Oozie server configuration " + "\"oozie-site.xml\": %s%n", e.getMessage());
}
}
Aggregations