You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ji...@apache.org on 2012/08/23 01:21:17 UTC
svn commit: r1376309 - in /incubator/ambari/branches/AMBARI-666: ./
ambari-agent/ ambari-agent/src/ ambari-agent/src/main/
ambari-agent/src/main/conf/ ambari-agent/test/ ambari-agent/test/resources/
ambari-server/ ambari-server/conf/ ambari-server/src/...
Author: jitendra
Date: Wed Aug 22 23:21:16 2012
New Revision: 1376309
URL: http://svn.apache.org/viewvc?rev=1376309&view=rev
Log:
AMBARI-676. Seperate directory for ambari-server.
Added:
incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt
incubator/ambari/branches/AMBARI-666/ambari-agent/
incubator/ambari/branches/AMBARI-666/ambari-agent/pom.xml
incubator/ambari/branches/AMBARI-666/ambari-agent/src/
incubator/ambari/branches/AMBARI-666/ambari-agent/src/main/
incubator/ambari/branches/AMBARI-666/ambari-agent/src/main/conf/
incubator/ambari/branches/AMBARI-666/ambari-agent/test/
incubator/ambari/branches/AMBARI-666/ambari-agent/test/resources/
incubator/ambari/branches/AMBARI-666/ambari-server/
incubator/ambari/branches/AMBARI-666/ambari-server/conf/
incubator/ambari/branches/AMBARI-666/ambari-server/conf/ambari-env.sh
incubator/ambari/branches/AMBARI-666/ambari-server/conf/auth.conf
incubator/ambari/branches/AMBARI-666/ambari-server/conf/log4j.properties
incubator/ambari/branches/AMBARI-666/ambari-server/pom.xml
incubator/ambari/branches/AMBARI-666/ambari-server/src/
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/conf/
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/conf/log4j.properties
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/configuration/
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/configuration/Configuration.java
incubator/ambari/branches/AMBARI-666/ambari-server/src/test/
incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/
incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/
incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/
incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/
incubator/ambari/branches/AMBARI-666/ambari-server/src/test/resources/
Added: incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt?rev=1376309&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt (added)
+++ incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt Wed Aug 22 23:21:16 2012
@@ -0,0 +1,22 @@
+Ambari Change log
+
+Notes:
+ - Committers should be listed using their login and non-committers
+should be listed by their full name.
+ - Please keep the file to a max of 80 characters wide.
+ - Put latest commits first in each section.
+
+AMBARI-666 branch (unreleased changes)
+
+ INCOMPATIBLE CHANGES
+
+ NEW FEATURES
+
+ AMBARI-676. Seperate directory for ambari-server. (jitendra)
+
+ IMPROVEMENTS
+
+ OPTIMIZATIONS
+
+ BUG FIXES
+
Added: incubator/ambari/branches/AMBARI-666/ambari-agent/pom.xml
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-agent/pom.xml?rev=1376309&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-agent/pom.xml (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-agent/pom.xml Wed Aug 22 23:21:16 2012
@@ -0,0 +1,127 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.ambari</groupId>
+ <artifactId>ambari-agent</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <name>ambari-agent</name>
+ <url>http://maven.apache.org</url>
+ <properties>
+ <jetty.version>7.0.0.pre5</jetty.version>
+ </properties>
+ <parent>
+ <groupId>org.apache.ambari</groupId>
+ <version>1.0-SNAPSHOT</version>
+ <artifactId>ambari</artifactId>
+ </parent>
+ <dependencies>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-ssl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-util</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-plus</artifactId>
+ </dependency>
+ <dependency>
+ <!-- the implementation of JAX-RS -->
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-server</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+ <!-- PROVIDED BY CONTAINER; HERE FOR COMPILE ONLY -->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+ <!-- TEST SCOPE DEPENDENCIES -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ <dependency>
+ <!-- used in integration tests -->
+ <groupId>javanettasks</groupId>
+ <artifactId>httpunit</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>1.6</version>
+ <configuration>
+ <createDependencyReducedPom>true</createDependencyReducedPom>
+ <filters>
+ <filter>
+ <artifact>*:*</artifact>
+ <excludes>
+ <exclude>META-INF/*.SF</exclude>
+ <exclude>META-INF/*.DSA</exclude>
+ <exclude>META-INF/*.RSA</exclude>
+ </excludes>
+ </filter>
+ </filters>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ <transformers>
+ <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
+ <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+ <mainClass>org.apache.ambari.agent.AmbariAgent</mainClass>
+ </transformer>
+ </transformers>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ <version>7.0.0.pre5</version>
+ <configuration>
+ <connectors>
+ <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <port>8080</port>
+ </connector>
+ <connector implementation="org.mortbay.jetty.ssl.SslSelectChannelConnector">
+ <port>8140</port>
+ <keystore>src/test/resources/server.keystore</keystore>
+ <keyPassword>123456</keyPassword>
+ <password>123456</password>
+ </connector>
+ </connectors>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-ssl</artifactId>
+ <version>7.0.0.pre5</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ <finalName>ambari-agent</finalName>
+ </build>
+</project>
Added: incubator/ambari/branches/AMBARI-666/ambari-server/conf/ambari-env.sh
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/conf/ambari-env.sh?rev=1376309&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/conf/ambari-env.sh (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/conf/ambari-env.sh Wed Aug 22 23:21:16 2012
@@ -0,0 +1,16 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+AMBARI_PID_DIR=/tmp
Added: incubator/ambari/branches/AMBARI-666/ambari-server/conf/auth.conf
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/conf/auth.conf?rev=1376309&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/conf/auth.conf (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/conf/auth.conf Wed Aug 22 23:21:16 2012
@@ -0,0 +1 @@
+controller: controller, user
Added: incubator/ambari/branches/AMBARI-666/ambari-server/conf/log4j.properties
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/conf/log4j.properties?rev=1376309&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/conf/log4j.properties (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/conf/log4j.properties Wed Aug 22 23:21:16 2012
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+log4j.rootLogger=INFO, R
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=${AMBARI_LOG_DIR}/ambari-controller.log
+log4j.appender.R.MaxFileSize=10MB
+log4j.appender.R.MaxBackupIndex=10
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d{ISO8601} %p %t %c{1} - %m%n
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.follow=true
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %p %t %c{1} - %m%n
+
Added: incubator/ambari/branches/AMBARI-666/ambari-server/pom.xml
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/pom.xml?rev=1376309&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/pom.xml (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/pom.xml Wed Aug 22 23:21:16 2012
@@ -0,0 +1,185 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.ambari</groupId>
+ <artifactId>ambari</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.ambari</groupId>
+ <artifactId>ambari-server</artifactId>
+ <packaging>jar</packaging>
+ <name>ambari-server</name>
+ <version>1.0-SNAPSHOT</version>
+ <description>Ambari Server</description>
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>1.6</version>
+ <configuration>
+ <createDependencyReducedPom>true</createDependencyReducedPom>
+ <filters>
+ <filter>
+ <artifact>*:*</artifact>
+ <excludes>
+ <exclude>META-INF/*.SF</exclude>
+ <exclude>META-INF/*.DSA</exclude>
+ <exclude>META-INF/*.RSA</exclude>
+ </excludes>
+ </filter>
+ </filters>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ <transformers>
+ <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
+ <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+ <mainClass>org.apache.ambari.controller.AmbariController</mainClass>
+ </transformer>
+ </transformers>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <profile>
+ <id>docs</id>
+ <activation>
+ <file>
+ <exists>/usr/bin/xsltproc</exists>
+ </file>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.jersey.contribs</groupId>
+ <artifactId>maven-wadl-plugin</artifactId>
+ <version>1.8</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey.contribs</groupId>
+ <artifactId>wadl-resourcedoc-doclet</artifactId>
+ <version>1.8</version>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>maven2-repository.dev.java.net</id>
+ <name>Java.net Repository for Maven</name>
+ <url>http://download.java.net/maven/2/</url>
+ <layout>default</layout>
+ </pluginRepository>
+ <pluginRepository>
+ <id>maven2-glassfish-repository.dev.java.net</id>
+ <name>Java.net Repository for Maven</name>
+ <url>http://download.java.net/maven/glassfish/</url>
+ </pluginRepository>
+ </pluginRepositories>
+ <dependencies>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.inject</groupId>
+ <artifactId>guice</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.inject.extensions</groupId>
+ <artifactId>guice-assistedinject</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ambari</groupId>
+ <artifactId>ambari-client</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-json</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-server</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-client</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey.contribs</groupId>
+ <artifactId>jersey-multipart</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey.jersey-test-framework</groupId>
+ <artifactId>jersey-test-framework-external</artifactId>
+ </dependency>
+ </dependencies>
+ <distributionManagement>
+ <site>
+ <id>apache-website</id>
+ <name>Apache website</name>
+ <url>scpexe://people.apache.org/www/incubator.apache.org/ambari/ambari-controller</url>
+ </site>
+ </distributionManagement>
+</project>
Added: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/conf/log4j.properties
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/conf/log4j.properties?rev=1376309&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/conf/log4j.properties (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/conf/log4j.properties Wed Aug 22 23:21:16 2012
@@ -0,0 +1,28 @@
+# Copyright 2011 The Apache Software Foundation
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Define some default values that can be overridden by system properties
+# Root logger option
+log4j.rootLogger=INFO, stdout
+
+# Direct log messages to stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
+
Added: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/configuration/Configuration.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/configuration/Configuration.java?rev=1376309&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/configuration/Configuration.java (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/configuration/Configuration.java Wed Aug 22 23:21:16 2012
@@ -0,0 +1,94 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ambari.configuration;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Properties;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import com.google.inject.Inject;
+
+/**
+ * Ambari configuration.
+ * Reads properties from ambari.properties
+ */
+public class Configuration {
+ private static final String AMBARI_CONF_VAR = "AMBARI_CONF_DIR";
+ private static final String CONFIG_FILE = "ambari.properties";
+
+ private static final Log LOG = LogFactory.getLog(Configuration.class);
+
+ private final URI dataStore;
+
+ @Inject
+ Configuration() {
+ this(readConfigFile());
+ }
+
+ protected Configuration(Properties properties) {
+ // get the data store
+ String dataStoreString = properties.getProperty("data.store",
+ "test://test/");
+ try {
+ dataStore = new URI(dataStoreString);
+ } catch (URISyntaxException e) {
+ throw new IllegalArgumentException("Can't parse data.store: " +
+ dataStoreString, e);
+ }
+ }
+
+ /**
+ * Find, read, and parse the configuration file.
+ * @return the properties that were found or empty if no file was found
+ */
+ private static Properties readConfigFile() {
+ Properties properties = new Properties();
+
+ // get the configuration directory and filename
+ String confDir = System.getenv(AMBARI_CONF_VAR);
+ if (confDir == null) {
+ confDir = "/etc/ambari";
+ }
+ String filename = confDir + "/" + CONFIG_FILE;
+
+ // load the properties
+ try {
+ properties.load(new FileInputStream(filename));
+ } catch (FileNotFoundException fnf) {
+ LOG.info("No configuration file " + filename + " found.", fnf);
+ } catch (IOException ie) {
+ throw new IllegalArgumentException("Can't read configuration file " +
+ filename, ie);
+ }
+ return properties;
+ }
+
+ /**
+ * Get the URI for the persistent data store.
+ * @return the data store URI
+ */
+ public URI getDataStore() {
+ return dataStore;
+ }
+}