You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ma...@apache.org on 2013/01/12 00:41:09 UTC
svn commit: r1432332 [1/3] - in /incubator/ambari/branches/branch-1.2: ./
ambari-agent/ ambari-agent/src/main/puppet/modules/hdp-mysql/files/
ambari-agent/src/main/puppet/modules/hdp-oozie/manifests/
ambari-agent/src/main/python/ambari_agent/ ambari-ag...
Author: mahadev
Date: Fri Jan 11 23:41:06 2013
New Revision: 1432332
URL: http://svn.apache.org/viewvc?rev=1432332&view=rev
Log:
Preparing for 1.2 release
Added:
incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/main/admin/item.js
incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/main/alert.js
incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/main/charts/horizon_chart.js
incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/main/rack.js
incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/main/service/info/metrics.js
incubator/ambari/branches/branch-1.2/ambari-web/app/models/component.js
incubator/ambari/branches/branch-1.2/ambari-web/app/models/service_metrics.js
incubator/ambari/branches/branch-1.2/ambari-web/app/templates/main/admin/security.hbs
incubator/ambari/branches/branch-1.2/ambari-web/app/templates/main/charts/horizon.hbs
incubator/ambari/branches/branch-1.2/ambari-web/app/templates/main/charts/horizon/chart.hbs
incubator/ambari/branches/branch-1.2/ambari-web/app/templates/main/host/audit.hbs
incubator/ambari/branches/branch-1.2/ambari-web/app/templates/main/service/info/metrics.hbs
incubator/ambari/branches/branch-1.2/ambari-web/app/templates/main/test.hbs
incubator/ambari/branches/branch-1.2/ambari-web/app/views/common/combobox.js
incubator/ambari/branches/branch-1.2/ambari-web/app/views/common/empty_view.js
incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/admin/security.js
incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/apps/runs_view.js
incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/charts/horizon.js
incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/charts/horizon/chart.js
incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/audit.js
incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/hosts.js
incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/audit.js
incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics.js
incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/test.js
Removed:
incubator/ambari/branches/branch-1.2/ambari-agent/.project
incubator/ambari/branches/branch-1.2/ambari-agent/.pydevproject
incubator/ambari/branches/branch-1.2/ambari-agent/ambari-agent.iml
incubator/ambari/branches/branch-1.2/ambari-agent/src/main/puppet/modules/hdp-mysql/files/startMysql.sh
incubator/ambari/branches/branch-1.2/ambari-project/ambari-project.iml
incubator/ambari/branches/branch-1.2/ambari-server/.classpath
incubator/ambari/branches/branch-1.2/ambari-server/.project
incubator/ambari/branches/branch-1.2/ambari-server/.pydevproject
incubator/ambari/branches/branch-1.2/ambari-server/.settings/org.eclipse.jdt.core.prefs
incubator/ambari/branches/branch-1.2/ambari-server/.settings/org.eclipse.jdt.ui.prefs
incubator/ambari/branches/branch-1.2/ambari-server/ambari-server.iml
incubator/ambari/branches/branch-1.2/ambari-server/derby.log
incubator/ambari/branches/branch-1.2/ambari-server/pass.txt
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/api/handlers/DelegatingRequestHandler.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/api/services/BasePersistenceManager.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/api/services/CreatePersistenceManager.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/api/services/DeletePersistenceManager.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/api/services/PersistenceManager.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/api/services/QueryCreateRequest.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/api/services/RequestImpl.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/api/services/ResponseFactory.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/api/services/UpdatePersistenceManager.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/HostsMap.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/gsinstaller/ClusterDefinition.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/gsinstaller/GSInstallerClusterProvider.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/gsinstaller/GSInstallerComponentProvider.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/gsinstaller/GSInstallerHostComponentProvider.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/gsinstaller/GSInstallerHostProvider.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/gsinstaller/GSInstallerNoOpProvider.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/gsinstaller/GSInstallerProviderModule.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/gsinstaller/GSInstallerResourceProvider.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/gsinstaller/GSInstallerServiceProvider.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/api/handlers/DelegatingRequestHandlerTest.java
incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/api/services/CreatePersistenceManagerTest.java
incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/api/services/DeletePersistenceManagerTest.java
incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/api/services/RequestImplTest.java
incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/controller/gsinstaller/GSInstallerClusterProviderTest.java
incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/controller/gsinstaller/GSInstallerComponentProviderTest.java
incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/controller/gsinstaller/GSInstallerHostComponentProviderTest.java
incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/controller/gsinstaller/GSInstallerHostProviderTest.java
incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/controller/gsinstaller/GSInstallerServiceProviderTest.java
incubator/ambari/branches/branch-1.2/ambari-server/src/test/resources/gsInstaller-hosts.txt
incubator/ambari/branches/branch-1.2/ambari-web/app/utils/component.js
incubator/ambari/branches/branch-1.2/contrib/ambari-log4j/.classpath
incubator/ambari/branches/branch-1.2/contrib/ambari-log4j/.project
incubator/ambari/branches/branch-1.2/contrib/ambari-log4j/src/test/java/org/apache/ambari/TestMapReduceJobHistoryUpdater.java
incubator/ambari/branches/branch-1.2/docs/pom.xml
incubator/ambari/branches/branch-1.2/docs/src/site/apt/index.apt
incubator/ambari/branches/branch-1.2/docs/src/site/apt/install-0.9.apt
incubator/ambari/branches/branch-1.2/docs/src/site/apt/install.apt
incubator/ambari/branches/branch-1.2/docs/src/site/apt/privacy-policy.apt
incubator/ambari/branches/branch-1.2/docs/src/site/apt/whats-new.apt
incubator/ambari/branches/branch-1.2/docs/src/site/resources/images/apache-ambari-project.png
incubator/ambari/branches/branch-1.2/docs/src/site/site.xml
Modified:
incubator/ambari/branches/branch-1.2/CHANGES.txt
incubator/ambari/branches/branch-1.2/ambari-agent/src/main/puppet/modules/hdp-oozie/manifests/service.pp
incubator/ambari/branches/branch-1.2/ambari-agent/src/main/python/ambari_agent/puppetExecutor.py
incubator/ambari/branches/branch-1.2/ambari-agent/src/main/python/ambari_agent/servicesToPidNames.dict
incubator/ambari/branches/branch-1.2/ambari-agent/src/test/python/TestPuppetExecutor.py
incubator/ambari/branches/branch-1.2/ambari-agent/src/test/python/examples/debug_testcase_example.py
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DefaultProviderModule.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ResourceImpl.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/jdbc/JDBCProviderModule.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/ProviderModule.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigMappingDAO.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java
incubator/ambari/branches/branch-1.2/ambari-server/src/main/python/ambari-server.py
incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionDBAccessorImpl.java
incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionManager.java
incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestStage.java
incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java
incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ResourceImplTest.java
incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java
incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/utils/TestStageUtils.java
incubator/ambari/branches/branch-1.2/ambari-web/app/controllers.js
incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/global/cluster_controller.js
incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/main/host.js
incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/main/host/add_controller.js
incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/main/host/details.js
incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/main/service/add_controller.js
incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/main/service/info/configs.js
incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/main/service/item.js
incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/wizard.js
incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/wizard/step10_controller.js
incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/wizard/step3_controller.js
incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/wizard/step5_controller.js
incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/wizard/step9_controller.js
incubator/ambari/branches/branch-1.2/ambari-web/app/data/config_properties.js
incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/hosts_mapper.js
incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/server_data_mapper.js
incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/service_mapper.js
incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/status_mapper.js
incubator/ambari/branches/branch-1.2/ambari-web/app/messages.js
incubator/ambari/branches/branch-1.2/ambari-web/app/models.js
incubator/ambari/branches/branch-1.2/ambari-web/app/models/host.js
incubator/ambari/branches/branch-1.2/ambari-web/app/models/host_component.js
incubator/ambari/branches/branch-1.2/ambari-web/app/models/service.js
incubator/ambari/branches/branch-1.2/ambari-web/app/models/service_config.js
incubator/ambari/branches/branch-1.2/ambari-web/app/routes/installer.js
incubator/ambari/branches/branch-1.2/ambari-web/app/styles/application.less
incubator/ambari/branches/branch-1.2/ambari-web/app/styles/apps.less
incubator/ambari/branches/branch-1.2/ambari-web/app/templates/main.hbs
incubator/ambari/branches/branch-1.2/ambari-web/app/templates/main/apps/list_row.hbs
incubator/ambari/branches/branch-1.2/ambari-web/app/templates/main/dashboard/service/hbase.hbs
incubator/ambari/branches/branch-1.2/ambari-web/app/templates/main/dashboard/service/hdfs.hbs
incubator/ambari/branches/branch-1.2/ambari-web/app/templates/main/dashboard/service/mapreduce.hbs
incubator/ambari/branches/branch-1.2/ambari-web/app/templates/main/service/info/summary.hbs
incubator/ambari/branches/branch-1.2/ambari-web/app/templates/main/service/info/summary/ganglia.hbs
incubator/ambari/branches/branch-1.2/ambari-web/app/templates/main/service/info/summary/oozie.hbs
incubator/ambari/branches/branch-1.2/ambari-web/app/templates/main/service/item.hbs
incubator/ambari/branches/branch-1.2/ambari-web/app/templates/wizard/step2.hbs
incubator/ambari/branches/branch-1.2/ambari-web/app/templates/wizard/step9HostTasksLogPopup.hbs
incubator/ambari/branches/branch-1.2/ambari-web/app/utils/data_table.js
incubator/ambari/branches/branch-1.2/ambari-web/app/utils/validator.js
incubator/ambari/branches/branch-1.2/ambari-web/app/views.js
incubator/ambari/branches/branch-1.2/ambari-web/app/views/common/quick_view_link_view.js
incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/apps/item/dag_view.js
incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/apps_view.js
incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/dashboard/service.js
incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/dashboard/service/hbase.js
incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/dashboard/service/hdfs.js
incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/dashboard/service/mapreduce.js
incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host.js
incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/summary.js
incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/summary.js
incubator/ambari/branches/branch-1.2/ambari-web/app/views/wizard/step2_view.js
incubator/ambari/branches/branch-1.2/contrib/ambari-log4j/src/main/java/org/apache/ambari/log4j/hadoop/mapreduce/jobhistory/MapReduceJobHistoryUpdater.java
incubator/ambari/branches/branch-1.2/contrib/ambari-log4j/src/test/java/org/apache/ambari/TestJobHistoryParsing.java
Modified: incubator/ambari/branches/branch-1.2/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/CHANGES.txt?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/CHANGES.txt (original)
+++ incubator/ambari/branches/branch-1.2/CHANGES.txt Fri Jan 11 23:41:06 2013
@@ -1,5 +1,7 @@
Ambari Change log
+AMBARI-1.2 branch - date: 11/01/2013
+
Notes:
- Committers should be listed using their login and non-committers
should be listed by their full name.
Modified: incubator/ambari/branches/branch-1.2/ambari-agent/src/main/puppet/modules/hdp-oozie/manifests/service.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-agent/src/main/puppet/modules/hdp-oozie/manifests/service.pp?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-agent/src/main/puppet/modules/hdp-oozie/manifests/service.pp (original)
+++ incubator/ambari/branches/branch-1.2/ambari-agent/src/main/puppet/modules/hdp-oozie/manifests/service.pp Fri Jan 11 23:41:06 2013
@@ -45,8 +45,8 @@ class hdp-oozie::service(
$cmd3 = "cd /usr/lib/oozie && chown ${user}:hadoop ${oozie_tmp}"
$cmd4 = "cd ${oozie_tmp} && /usr/lib/oozie/bin/oozie-setup.sh -hadoop 0.20.200 $jar_location -extjs $ext_js_path $lzo_jar_suffix"
$cmd5 = "cd ${oozie_tmp} && /usr/lib/oozie/bin/ooziedb.sh create -sqlfile oozie.sql -run ; echo 0"
- $cmd6 = "su - ${user} -c 'hadoop dfs -put /usr/lib/oozie/share share ; hadoop dfs -chmod -R 755 /user/${user}/share'"
- #$cmd7 = "/usr/lib/oozie/bin/oozie-start.sh"
+ $cmd6 = "hadoop dfs -put /usr/lib/oozie/share share ; hadoop dfs -chmod -R 755 /user/${user}/share"
+ $cmd7 = "/usr/lib/oozie/bin/oozie-start.sh"
if ($ensure == 'installed_and_configured') {
$sh_cmds = [$cmd1, $cmd2, $cmd3]
@@ -75,16 +75,9 @@ class hdp-oozie::service(
hdp-oozie::service::exec_user{$user_cmds:}
Hdp-oozie::Service::Directory<||> -> Hdp-oozie::Service::Exec_sh[$cmd1] -> Hdp-oozie::Service::Exec_sh[$cmd2] ->Hdp-oozie::Service::Exec_sh[$cmd3] -> Hdp-oozie::Service::Exec_user[$cmd4] ->Hdp-oozie::Service::Exec_user[$cmd5] -> Anchor['hdp-oozie::service::end']
} elsif ($ensure == 'running') {
- hdp::exec { "exec $cmd6" :
- command => $cmd6,
- unless => "hadoop dfs -ls /user/oozie/share | awk 'BEGIN {count=0;} /share/ {count++} END {if (count > 0) {exit 0} else {exit 1}}'"
- }
- hdp::exec { "exec $start_cmd":
- command => $start_cmd,
- unless => $no_op_test,
- initial_wait => $initial_wait,
- require => Exec["exec $cmd6"]
- }
+ $user_cmds = [$cmd6, $cmd7]
+ hdp-oozie::service::exec_user{$user_cmds:}
+ Hdp-oozie::Service::Exec_user[$cmd6] -> Hdp-oozie::Service::Exec_user[$cmd7] -> Anchor['hdp-oozie::service::end']
} elsif ($ensure == 'stopped') {
hdp::exec { "exec $stop_cmd":
command => $stop_cmd,
Modified: incubator/ambari/branches/branch-1.2/ambari-agent/src/main/python/ambari_agent/puppetExecutor.py
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-agent/src/main/python/ambari_agent/puppetExecutor.py?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-agent/src/main/python/ambari_agent/puppetExecutor.py (original)
+++ incubator/ambari/branches/branch-1.2/ambari-agent/src/main/python/ambari_agent/puppetExecutor.py Fri Jan 11 23:41:06 2013
@@ -26,7 +26,6 @@ from RepoInstaller import RepoInstaller
import pprint, threading
from Grep import Grep
from threading import Thread
-import shell
import traceback
logger = logging.getLogger()
@@ -213,12 +212,10 @@ class puppetExecutor:
self.event.wait(self.PUPPET_TIMEOUT_SECONDS)
if puppet.returncode is None:
logger.error("Task timed out and will be killed")
- self.runShellKillPgrp(puppet)
+ puppet.terminate()
self.last_puppet_has_been_killed = True
pass
- def runShellKillPgrp(self, puppet):
- shell.killprocessgrp(puppet.pid)
def main():
logging.basicConfig(level=logging.DEBUG)
Modified: incubator/ambari/branches/branch-1.2/ambari-agent/src/main/python/ambari_agent/servicesToPidNames.dict
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-agent/src/main/python/ambari_agent/servicesToPidNames.dict?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-agent/src/main/python/ambari_agent/servicesToPidNames.dict (original)
+++ incubator/ambari/branches/branch-1.2/ambari-agent/src/main/python/ambari_agent/servicesToPidNames.dict Fri Jan 11 23:41:06 2013
@@ -13,19 +13,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-NAMENODE=hadoop-[A-Za-z0-9_]+-namenode.pid$
-SECONDARY_NAMENODE=hadoop-[A-Za-z0-9_]+-secondarynamenode.pid$
-DATANODE=hadoop-[A-Za-z0-9_]+-datanode.pid$
-JOBTRACKER=hadoop-[A-Za-z0-9_]+-jobtracker.pid$
-TASKTRACKER=hadoop-[A-Za-z0-9_]+-tasktracker.pid$
+NAMENODE=hadoop-[a-z_]+-namenode.pid$
+SECONDARY_NAMENODE=hadoop-[a-z_]+-secondarynamenode.pid$
+DATANODE=hadoop-[a-z_]+-datanode.pid$
+JOBTRACKER=hadoop-[a-z_]+-jobtracker.pid$
+TASKTRACKER=hadoop-[a-z_]+-tasktracker.pid$
OOZIE_SERVER=oozie.pid
ZOOKEEPER_SERVER=zookeeper_server.pid
TEMPLETON_SERVER=templeton.pid
NAGIOS_SERVER=nagios.pid
GANGLIA_SERVER=gmetad.pid
GANGLIA_MONITOR=gmond.pid
-HBASE_MASTER=hbase-[A-Za-z0-9_]+-master.pid
-HBASE_REGIONSERVER=hbase-[A-Za-z0-9_]+-regionserver.pid
+HBASE_MASTER=hbase-[a-z_]+-master.pid
+HBASE_REGIONSERVER=hbase-[a-z_]+-regionserver.pid
NAGIOS_SERVER=nagios.pid
HCATALOG_SERVER=hcat.pid
KERBEROS_SERVER=kadmind.pid
Modified: incubator/ambari/branches/branch-1.2/ambari-agent/src/test/python/TestPuppetExecutor.py
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-agent/src/test/python/TestPuppetExecutor.py?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-agent/src/test/python/TestPuppetExecutor.py (original)
+++ incubator/ambari/branches/branch-1.2/ambari-agent/src/test/python/TestPuppetExecutor.py Fri Jan 11 23:41:06 2013
@@ -143,9 +143,6 @@ class TestPuppetExecutor(TestCase):
self.subprocess_mockup.tmperr = tmperr
return self.subprocess_mockup
- def runShellKillPgrp(self, puppet):
- puppet.terminate() # note: In real code, subprocess.terminate() is not called
- pass
class Subprocess_mockup():
@@ -157,7 +154,6 @@ class TestPuppetExecutor(TestCase):
was_terminated = False
tmpout = None
tmperr = None
- pid=-1
def communicate(self):
self.started_event.set()
Modified: incubator/ambari/branches/branch-1.2/ambari-agent/src/test/python/examples/debug_testcase_example.py
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-agent/src/test/python/examples/debug_testcase_example.py?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-agent/src/test/python/examples/debug_testcase_example.py (original)
+++ incubator/ambari/branches/branch-1.2/ambari-agent/src/test/python/examples/debug_testcase_example.py Fri Jan 11 23:41:06 2013
@@ -26,16 +26,18 @@ from ambari_agent.ActionQueue import Act
from ambari_agent import AmbariConfig
from ambari_agent.NetUtil import NetUtil
import socket, ConfigParser, logging
-import os, pprint, json, sys, unittest
+import os, pprint, json, sys
from threading import Thread
import time
import Queue
+
+BAD_URL = 'http://localhost:54222/badurl/'
logger = logging.getLogger()
-class TestController(TestCase):
+class TestController():
-# This file should be put to ambari-agent/src/main/python/ambari-agent/debug_testcase_example.py.
+# This file should be put to ambari-agent/src/main/python/debug_testcase_example.py.
# After installing python plugin and adjusting test,
# it may be run in IntelliJ IDEA debugger
@@ -66,7 +68,10 @@ def main(argv=None):
stream_handler.setFormatter(formatter)
logger.addHandler(stream_handler)
- unittest.main()
+ test = TestController()
+ test.setUp()
+ test.test_custom()
+ test.tearDown()
if __name__ == '__main__':
main()
Modified: incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.java?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.java (original)
+++ incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.java Fri Jan 11 23:41:06 2013
@@ -24,7 +24,6 @@ import java.util.concurrent.atomic.Atomi
import org.apache.ambari.server.agent.ActionQueue;
import org.apache.ambari.server.agent.CommandReport;
-import org.apache.ambari.server.controller.HostsMap;
import org.apache.ambari.server.state.Clusters;
import org.apache.ambari.server.utils.StageUtils;
import org.slf4j.Logger;
@@ -43,19 +42,17 @@ public class ActionManager {
private final ActionScheduler scheduler;
private final ActionDBAccessor db;
private final ActionQueue actionQueue;
- private final HostsMap hostsMap;
private static Logger LOG = LoggerFactory.getLogger(ActionManager.class);
private final AtomicLong requestCounter;
@Inject
public ActionManager(@Named("schedulerSleeptime") long schedulerSleepTime,
@Named("actionTimeout") long actionTimeout,
- ActionQueue aq, Clusters fsm, ActionDBAccessor db, HostsMap hostsMap) {
+ ActionQueue aq, Clusters fsm, ActionDBAccessor db) {
this.actionQueue = aq;
this.db = db;
- this.hostsMap = hostsMap;
scheduler = new ActionScheduler(schedulerSleepTime, actionTimeout, db,
- actionQueue, fsm, 2, hostsMap);
+ actionQueue, fsm, 2);
requestCounter = new AtomicLong(
db.getLastPersistedRequestIdWhenInitialized());
}
Modified: incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java (original)
+++ incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java Fri Jan 11 23:41:06 2013
@@ -28,7 +28,6 @@ import org.apache.ambari.server.Role;
import org.apache.ambari.server.ServiceComponentNotFoundException;
import org.apache.ambari.server.agent.ActionQueue;
import org.apache.ambari.server.agent.ExecutionCommand;
-import org.apache.ambari.server.controller.HostsMap;
import org.apache.ambari.server.state.Cluster;
import org.apache.ambari.server.state.Clusters;
import org.apache.ambari.server.state.Service;
@@ -55,13 +54,11 @@ class ActionScheduler implements Runnabl
private final ActionQueue actionQueue;
private final Clusters fsmObject;
private boolean taskTimeoutAdjustment = true;
- private final HostsMap hostsMap;
public ActionScheduler(long sleepTimeMilliSec, long actionTimeoutMilliSec,
ActionDBAccessor db, ActionQueue actionQueue, Clusters fsmObject,
- int maxAttempts, HostsMap hostsMap) {
+ int maxAttempts) {
this.sleepTime = sleepTimeMilliSec;
- this.hostsMap = hostsMap;
this.actionTimeout = actionTimeoutMilliSec;
this.db = db;
this.actionQueue = actionQueue;
@@ -286,8 +283,6 @@ class ActionScheduler implements Runnabl
s.setLastAttemptTime(hostname, roleStr, now);
s.incrementAttemptCount(hostname, roleStr);
LOG.info("Scheduling command: "+cmd.toString()+" for host: "+hostname);
- /** change the hostname in the command for the host itself **/
- cmd.setHostname(hostsMap.getHostMap(hostname));
actionQueue.enqueue(hostname, cmd);
db.hostRoleScheduled(s, hostname, roleStr);
}
Modified: incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java (original)
+++ incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java Fri Jan 11 23:41:06 2013
@@ -105,9 +105,6 @@ public class Configuration {
public static final String OS_VERSION_KEY =
"server.os_type";
- public static final String SRVR_HOSTS_MAPPING =
- "server.hosts.mapping";
-
private static final String SRVR_KSTR_DIR_DEFAULT = ".";
public static final String SRVR_CRT_NAME_DEFAULT = "ca.crt";
public static final String SRVR_KEY_NAME_DEFAULT = "ca.key";
@@ -293,15 +290,6 @@ public class Configuration {
}
/**
- * Get the file that will be used for host mapping.
- * @return null if such a file is not present, value if present.
- */
- public String getHostsMapFile() {
- LOG.info("Hosts Mapping File " + properties.getProperty(SRVR_HOSTS_MAPPING));
- return properties.getProperty(SRVR_HOSTS_MAPPING);
- }
-
- /**
* Gets ambari stack-path
* @return String
*/
Modified: incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java (original)
+++ incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java Fri Jan 11 23:41:06 2013
@@ -105,9 +105,7 @@ public class AmbariManagementControllerI
private AmbariMetaInfo ambariMetaInfo;
@Inject
private Users users;
- @Inject
- private HostsMap hostsMap;
-
+
final private String masterHostname;
final private static String JDK_RESOURCE_LOCATION =
@@ -900,7 +898,7 @@ public class AmbariManagementControllerI
// Generate cluster host info
execCmd.setClusterHostInfo(
- StageUtils.getClusterHostInfo(cluster, hostsMap));
+ StageUtils.getClusterHostInfo(cluster));
Host host = clusters.getHost(scHost.getHostName());
@@ -1689,7 +1687,7 @@ public class AmbariManagementControllerI
// Generate cluster host info
stage.getExecutionCommandWrapper(clientHost, smokeTestRole)
.getExecutionCommand()
- .setClusterHostInfo(StageUtils.getClusterHostInfo(cluster, hostsMap));
+ .setClusterHostInfo(StageUtils.getClusterHostInfo(cluster));
}
RoleGraph rg = new RoleGraph(rco);
@@ -3158,7 +3156,7 @@ public class AmbariManagementControllerI
.getExecutionCommandWrapper(hostName, actionRequest.getActionName())
.getExecutionCommand()
.setClusterHostInfo(
- StageUtils.getClusterHostInfo(clusters.getCluster(clusterName), hostsMap));
+ StageUtils.getClusterHostInfo(clusters.getCluster(clusterName)));
}
private void addDecommissionDatanodeAction(
Modified: incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java (original)
+++ incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java Fri Jan 11 23:41:06 2013
@@ -51,18 +51,15 @@ public class ControllerModule extends Ab
private final Configuration configuration;
private final AmbariMetaInfo ambariMetaInfo;
- private final HostsMap hostsMap;
-
+
public ControllerModule() throws Exception {
configuration = new Configuration();
ambariMetaInfo = new AmbariMetaInfo(configuration);
- hostsMap = new HostsMap(configuration);
}
public ControllerModule(Properties properties) throws Exception {
configuration = new Configuration(properties);
ambariMetaInfo = new AmbariMetaInfo(configuration);
- hostsMap = new HostsMap(configuration);
}
@Override
@@ -72,8 +69,7 @@ public class ControllerModule extends Ab
bind(Configuration.class).toInstance(configuration);
bind(AmbariMetaInfo.class).toInstance(ambariMetaInfo);
- bind(HostsMap.class).toInstance(hostsMap);
-
+
bind(PasswordEncoder.class).toInstance(new StandardPasswordEncoder());
JpaPersistModule jpaPersistModule = new JpaPersistModule(configuration.getPersistenceType().getUnitName());
Modified: incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DefaultProviderModule.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DefaultProviderModule.java?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DefaultProviderModule.java (original)
+++ incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DefaultProviderModule.java Fri Jan 11 23:41:06 2013
@@ -18,20 +18,80 @@
package org.apache.ambari.server.controller.internal;
-import com.google.inject.Inject;
-import org.apache.ambari.server.controller.AmbariManagementController;
import org.apache.ambari.server.controller.AmbariServer;
-import org.apache.ambari.server.controller.spi.Resource;
-import org.apache.ambari.server.controller.spi.ResourceProvider;
+import org.apache.ambari.server.controller.ganglia.GangliaComponentPropertyProvider;
+import org.apache.ambari.server.controller.ganglia.GangliaHostComponentPropertyProvider;
+import org.apache.ambari.server.controller.ganglia.GangliaHostPropertyProvider;
+import org.apache.ambari.server.controller.ganglia.GangliaReportPropertyProvider;
+import org.apache.ambari.server.controller.ganglia.GangliaHostProvider;
+import org.apache.ambari.server.controller.jmx.JMXHostProvider;
+import org.apache.ambari.server.controller.jmx.JMXPropertyProvider;
+import org.apache.ambari.server.controller.spi.*;
+import org.apache.ambari.server.controller.utilities.PredicateBuilder;
import org.apache.ambari.server.controller.utilities.PropertyHelper;
+import org.apache.ambari.server.controller.AmbariManagementController;
+
+import com.google.inject.Inject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
/**
* The default provider module implementation.
*/
-public class DefaultProviderModule extends AbstractProviderModule {
+public class DefaultProviderModule implements ProviderModule, ResourceProviderObserver, JMXHostProvider, GangliaHostProvider {
+
+ private static final String HOST_CLUSTER_NAME_PROPERTY_ID = PropertyHelper.getPropertyId("HostRoles", "cluster_name");
+ private static final String HOST_NAME_PROPERTY_ID = PropertyHelper.getPropertyId("Hosts", "host_name");
+ private static final String HOST_IP_PROPERTY_ID = PropertyHelper.getPropertyId("Hosts", "ip");
+ private static final String HOST_ATTRIBUTES_PROPERTY_ID = PropertyHelper.getPropertyId("Hosts", "attributes");
+ private static final String CLUSTER_NAME_PROPERTY_ID = PropertyHelper.getPropertyId("Clusters", "cluster_name");
+ private static final String HOST_COMPONENT_CLUSTER_NAME_PROPERTY_ID = PropertyHelper.getPropertyId("HostRoles", "cluster_name");
+ private static final String HOST_COMPONENT_HOST_NAME_PROPERTY_ID = PropertyHelper.getPropertyId("HostRoles", "host_name");
+ private static final String HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID = PropertyHelper.getPropertyId("HostRoles", "component_name");
+ private static final String GANGLIA_SERVER = "GANGLIA_SERVER";
+ private static final String GANGLIA_SERVER_OLD = "GANGLIA_MONITOR_SERVER";
+
+ /**
+ * The map of resource providers.
+ */
+ private final Map<Resource.Type, ResourceProvider> resourceProviders = new HashMap<Resource.Type, ResourceProvider>();
+
+ /**
+ * The map of lists of property providers.
+ */
+ private final Map<Resource.Type,List<PropertyProvider>> propertyProviders = new HashMap<Resource.Type, List<PropertyProvider>>();
+
@Inject
private AmbariManagementController managementController;
+ /**
+ * The map of hosts.
+ */
+ private Map<String, Map<String, String>> clusterHostMap;
+
+ private Map<String, Map<String, String>> clusterHostComponentMap;
+
+ /**
+ * The host name of the Ganglia collector.
+ */
+ private Map<String, String> clusterGangliaCollectorMap;
+
+
+ private volatile boolean initialized = false;
+
+
+
+
+ protected final static Logger LOG =
+ LoggerFactory.getLogger(DefaultProviderModule.class);
+
+
// ----- Constructors ------------------------------------------------------
/**
@@ -44,11 +104,247 @@ public class DefaultProviderModule exten
}
- // ----- utility methods ---------------------------------------------------
+ // ----- ProviderModule ----------------------------------------------------
+
+ @Override
+ public ResourceProvider getResourceProvider(Resource.Type type) {
+ if (!propertyProviders.containsKey(type)) {
+ createResourceProvider(type);
+ }
+ return resourceProviders.get(type);
+ }
@Override
- protected ResourceProvider createResourceProvider(Resource.Type type) {
- return ResourceProviderImpl.getResourceProvider(type, PropertyHelper.getPropertyIds(type),
+ public List<PropertyProvider> getPropertyProviders(Resource.Type type) {
+
+ if (!propertyProviders.containsKey(type)) {
+ createPropertyProviders(type);
+ }
+ return propertyProviders.get(type);
+ }
+
+
+ // ----- ResourceProviderObserver ------------------------------------------
+
+ @Override
+ public void update(ResourceProviderEvent event) {
+ Resource.Type type = event.getResourceType();
+
+ if (type == Resource.Type.Cluster ||
+ type == Resource.Type.Host ||
+ type == Resource.Type.HostComponent) {
+ resetInit();
+ }
+ }
+
+
+ // ----- JMXHostProvider ---------------------------------------------------
+
+ @Override
+ public String getHostName(String clusterName, String componentName) throws SystemException {
+ checkInit();
+ return clusterHostComponentMap.get(clusterName).get(componentName);
+ }
+
+ @Override
+ public Map<String, String> getHostMapping(String clusterName) throws SystemException {
+ checkInit();
+ return clusterHostMap.get(clusterName);
+ }
+
+
+ // ----- GangliaHostProvider -----------------------------------------------
+
+ @Override
+ public String getGangliaCollectorHostName(String clusterName) throws SystemException {
+ checkInit();
+ return clusterGangliaCollectorMap.get(clusterName);
+ }
+
+
+ // ----- utility methods ---------------------------------------------------
+
+ protected void putResourceProvider(Resource.Type type, ResourceProvider resourceProvider) {
+ resourceProviders.put( type , resourceProvider);
+ }
+
+ protected void createResourceProvider(Resource.Type type) {
+ ResourceProvider resourceProvider =
+ ResourceProviderImpl.getResourceProvider(type, PropertyHelper.getPropertyIds(type),
PropertyHelper.getKeyPropertyIds(type), managementController);
+
+ if (resourceProvider instanceof ObservableResourceProvider) {
+ ((ObservableResourceProvider)resourceProvider).addObserver(this);
+ }
+
+ putResourceProvider(type, resourceProvider);
+ }
+
+ protected void putPropertyProviders(Resource.Type type, List<PropertyProvider> providers) {
+ propertyProviders.put(type, providers);
+ }
+
+ protected void createPropertyProviders(Resource.Type type) {
+
+ List<PropertyProvider> providers = new LinkedList<PropertyProvider>();
+
+ URLStreamProvider streamProvider = new URLStreamProvider();
+
+ switch (type){
+ case Cluster :
+ providers.add(new GangliaReportPropertyProvider(
+ PropertyHelper.getGangliaPropertyIds(type).get("*"),
+ streamProvider,
+ this,
+ PropertyHelper.getPropertyId("Clusters", "cluster_name")));
+ break;
+ case Host :
+ providers.add(new GangliaHostPropertyProvider(
+ PropertyHelper.getGangliaPropertyIds(type),
+ streamProvider,
+ this,
+ PropertyHelper.getPropertyId("Hosts", "cluster_name"),
+ PropertyHelper.getPropertyId("Hosts", "host_name")
+ ));
+ break;
+ case Component :
+ providers.add(new JMXPropertyProvider(
+ PropertyHelper.getJMXPropertyIds(type),
+ streamProvider,
+ this,
+ PropertyHelper.getPropertyId("ServiceComponentInfo", "cluster_name"),
+ null,
+ PropertyHelper.getPropertyId("ServiceComponentInfo", "component_name")));
+
+ providers.add(new GangliaComponentPropertyProvider(
+ PropertyHelper.getGangliaPropertyIds(type),
+ streamProvider,
+ this,
+ PropertyHelper.getPropertyId("ServiceComponentInfo", "cluster_name"),
+ PropertyHelper.getPropertyId("ServiceComponentInfo", "component_name")));
+ break;
+ case HostComponent:
+ providers.add(new JMXPropertyProvider(
+ PropertyHelper.getJMXPropertyIds(type),
+ streamProvider,
+ this,
+ PropertyHelper.getPropertyId("HostRoles", "cluster_name"),
+ PropertyHelper.getPropertyId("HostRoles", "host_name"),
+ PropertyHelper.getPropertyId("HostRoles", "component_name")));
+
+ providers.add(new GangliaHostComponentPropertyProvider(
+ PropertyHelper.getGangliaPropertyIds(type),
+ streamProvider,
+ this,
+ PropertyHelper.getPropertyId("HostRoles", "cluster_name"),
+ PropertyHelper.getPropertyId("HostRoles", "host_name"),
+ PropertyHelper.getPropertyId("HostRoles", "component_name")));
+ break;
+ default :
+ break;
+ }
+ putPropertyProviders(type, providers);
+ }
+
+ private void checkInit() throws SystemException{
+ if (!initialized) {
+ synchronized (this) {
+ if (!initialized) {
+ initProviderMaps();
+ initialized = true;
+ }
+ }
+ }
+ }
+
+ private void resetInit() {
+ if (initialized) {
+ synchronized (this) {
+ initialized = false;
+ }
+ }
+ }
+
+ private void initProviderMaps() throws SystemException{
+ ResourceProvider provider = getResourceProvider(Resource.Type.Cluster);
+ Request request = PropertyHelper.getReadRequest(CLUSTER_NAME_PROPERTY_ID);
+
+ try {
+ Set<Resource> clusters = provider.getResources(request, null);
+
+ clusterHostMap = new HashMap<String, Map<String, String>>();
+ clusterHostComponentMap = new HashMap<String, Map<String, String>>();
+ clusterGangliaCollectorMap = new HashMap<String, String>();
+
+ for (Resource cluster : clusters) {
+
+ String clusterName = (String) cluster.getPropertyValue(CLUSTER_NAME_PROPERTY_ID);
+
+ // initialize the host map from the known hosts...
+ provider = getResourceProvider(Resource.Type.Host);
+ request = PropertyHelper.getReadRequest(HOST_NAME_PROPERTY_ID, HOST_IP_PROPERTY_ID,
+ HOST_ATTRIBUTES_PROPERTY_ID);
+
+ Predicate predicate = new PredicateBuilder().property(HOST_CLUSTER_NAME_PROPERTY_ID).
+ equals(clusterName).toPredicate();
+
+ Set<Resource> hosts = provider.getResources(request, predicate);
+ Map<String, String> hostMap = clusterHostMap.get(clusterName);
+
+ if (hostMap == null) {
+ hostMap = new HashMap<String, String>();
+ clusterHostMap.put(clusterName, hostMap);
+ }
+
+ for (Resource host : hosts) {
+ hostMap.put((String) host.getPropertyValue(HOST_NAME_PROPERTY_ID),
+ (String) host.getPropertyValue(HOST_IP_PROPERTY_ID));
+ }
+
+ // initialize the host component map and Ganglia server from the known hosts components...
+ provider = getResourceProvider(Resource.Type.HostComponent);
+
+ request = PropertyHelper.getReadRequest(HOST_COMPONENT_HOST_NAME_PROPERTY_ID,
+ HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID);
+
+ predicate = new PredicateBuilder().property(HOST_COMPONENT_CLUSTER_NAME_PROPERTY_ID).
+ equals(clusterName).toPredicate();
+
+ Set<Resource> hostComponents = provider.getResources(request, predicate);
+ Map<String, String> hostComponentMap = clusterHostComponentMap.get(clusterName);
+
+ if (hostComponentMap == null) {
+ hostComponentMap = new HashMap<String, String>();
+ clusterHostComponentMap.put(clusterName, hostComponentMap);
+ }
+
+ for (Resource hostComponent : hostComponents) {
+ String componentName = (String) hostComponent.getPropertyValue(HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID);
+ String hostName = (String) hostComponent.getPropertyValue(HOST_COMPONENT_HOST_NAME_PROPERTY_ID);
+
+ hostComponentMap.put(componentName, hostMap.get(hostName));
+
+ // record the Ganglia server for the current cluster
+ if (componentName.equals(GANGLIA_SERVER) || componentName.equals(GANGLIA_SERVER_OLD)) {
+ clusterGangliaCollectorMap.put(clusterName, clusterHostMap.get(clusterName).get(hostName));
+ }
+ }
+ }
+ } catch (UnsupportedPropertyException e) {
+ if (LOG.isErrorEnabled()) {
+ LOG.error("Caught UnsupportedPropertyException while trying to get the host mappings.", e);
+ }
+ throw new SystemException("An exception occurred while initializing the host mappings: " + e, e);
+ } catch (NoSuchResourceException e) {
+ if (LOG.isErrorEnabled()) {
+ LOG.error("Caught NoSuchResourceException exception while trying to get the host mappings.", e);
+ }
+ throw new SystemException("An exception occurred while initializing the host mappings: " + e, e);
+ } catch (NoSuchParentResourceException e) {
+ if (LOG.isErrorEnabled()) {
+ LOG.error("Caught NoSuchParentResourceException exception while trying to get the host mappings.", e);
+ }
+ throw new SystemException("An exception occurred while initializing the host mappings: " + e, e);
+ }
}
}
Modified: incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ResourceImpl.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ResourceImpl.java?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ResourceImpl.java (original)
+++ incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ResourceImpl.java Fri Jan 11 23:41:06 2013
@@ -55,27 +55,6 @@ public class ResourceImpl implements Res
this.type = type;
}
- /**
- * Copy constructor
- *
- * @param resource the resource to copy
- */
- public ResourceImpl(Resource resource) {
- this.type = resource.getType();
-
- for (Map.Entry<String, Map<String, Object>> categoryEntry : resource.getPropertiesMap().entrySet()) {
- String category = categoryEntry.getKey();
- Map<String, Object> propertyMap = categoryEntry.getValue();
- if (propertyMap != null) {
- for (Map.Entry<String, Object> propertyEntry : propertyMap.entrySet()) {
- String propertyId = (category == null ? "" : category + "/") + propertyEntry.getKey();
- Object propertyValue = propertyEntry.getValue();
- setProperty(propertyId, propertyValue);
- }
- }
- }
- }
-
// ----- Resource ----------------------------------------------------------
Modified: incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/jdbc/JDBCProviderModule.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/jdbc/JDBCProviderModule.java?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/jdbc/JDBCProviderModule.java (original)
+++ incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/jdbc/JDBCProviderModule.java Fri Jan 11 23:41:06 2013
@@ -18,22 +18,32 @@
package org.apache.ambari.server.controller.jdbc;
-import org.apache.ambari.server.controller.internal.AbstractProviderModule;
+import org.apache.ambari.server.controller.internal.DefaultProviderModule;
import org.apache.ambari.server.controller.spi.Resource;
-import org.apache.ambari.server.controller.spi.ResourceProvider;
import org.apache.ambari.server.controller.utilities.DBHelper;
import org.apache.ambari.server.controller.utilities.PropertyHelper;
/**
- * A provider module implementation that uses the JDBC resource provider.
+ * The default provider module implementation.
*/
-public class JDBCProviderModule extends AbstractProviderModule {
+public class JDBCProviderModule extends DefaultProviderModule {
+
+
+ // ----- Constructors ------------------------------------------------------
+
+ /**
+ * Create a default provider module.
+ */
+ public JDBCProviderModule() {
+ super();
+ }
+
// ----- utility methods ---------------------------------------------------
@Override
- protected ResourceProvider createResourceProvider(Resource.Type type) {
- return new JDBCResourceProvider(DBHelper.CONNECTION_FACTORY, type,
+ protected void createResourceProvider(Resource.Type type) {
+ putResourceProvider( type, new JDBCResourceProvider(DBHelper.CONNECTION_FACTORY, type,
PropertyHelper.getPropertyIds(type),
- PropertyHelper.getKeyPropertyIds(type));
+ PropertyHelper.getKeyPropertyIds(type)));
}
}
Modified: incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/ProviderModule.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/ProviderModule.java?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/ProviderModule.java (original)
+++ incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/ProviderModule.java Fri Jan 11 23:41:06 2013
@@ -33,12 +33,5 @@ public interface ProviderModule {
*/
public ResourceProvider getResourceProvider(Resource.Type type);
- /**
- * Get the list of property providers for the given resource type.
- *
- * @param type the resource type
- *
- * @return the list of property providers
- */
public List<PropertyProvider> getPropertyProviders(Resource.Type type);
}
Modified: incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigMappingDAO.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigMappingDAO.java?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigMappingDAO.java (original)
+++ incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigMappingDAO.java Fri Jan 11 23:41:06 2013
@@ -58,7 +58,7 @@ public class ServiceConfigMappingDAO {
+ " WHERE "
+ " config.clusterId = ?1"
+ " AND config.serviceName = ?2"
- + " AND config.configType IN ?3",
+ + " AND config.configType IN ?5",
ServiceConfigMappingEntity.class);
return daoUtils.selectList(query, clusterId, serviceName, configTypes);
}
Modified: incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java (original)
+++ incubator/ambari/branches/branch-1.2/ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java Fri Jan 11 23:41:06 2013
@@ -17,26 +17,10 @@
*/
package org.apache.ambari.server.utils;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.nio.charset.Charset;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-
-import javax.xml.bind.JAXBException;
-
import org.apache.ambari.server.Role;
import org.apache.ambari.server.RoleCommand;
import org.apache.ambari.server.actionmanager.Stage;
import org.apache.ambari.server.agent.ExecutionCommand;
-import org.apache.ambari.server.controller.HostsMap;
import org.apache.ambari.server.state.Cluster;
import org.apache.ambari.server.state.ServiceComponent;
import org.apache.ambari.server.state.svccomphost.ServiceComponentHostInstallEvent;
@@ -48,6 +32,15 @@ import org.codehaus.jackson.map.JsonMapp
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;
+import javax.xml.bind.JAXBException;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.nio.charset.Charset;
+import java.util.*;
+
public class StageUtils {
private static Log LOG = LogFactory.getLog(StageUtils.class);
@@ -106,7 +99,6 @@ public class StageUtils {
Stage s = new Stage(requestId, "/tmp", "cluster1");
s.setStageId(stageId);
long now = System.currentTimeMillis();
- String filename = null;
s.addHostRoleExecutionCommand(hostname, Role.NAMENODE, RoleCommand.INSTALL,
new ServiceComponentHostInstallEvent("NAMENODE", hostname, now, "HDP-1.2.0"),
"cluster1", "HDFS");
@@ -158,8 +150,7 @@ public class StageUtils {
return mapper.readValue(is, clazz);
}
-
- public static Map<String, List<String>> getClusterHostInfo(Cluster cluster, HostsMap hostsMap) {
+ public static Map<String, List<String>> getClusterHostInfo(Cluster cluster) {
Map<String, List<String>> info = new HashMap<String, List<String>>();
if (cluster.getServices() != null) {
for (String serviceName : cluster.getServices().keySet()) {
@@ -177,13 +168,12 @@ public class StageUtils {
&& !scomp.getServiceComponentHosts().isEmpty()) {
List<String> hostList = new ArrayList<String>();
for (String host: scomp.getServiceComponentHosts().keySet()) {
- String mappedHost = hostsMap.getHostMap(host);
- hostList.add(mappedHost);
+ hostList.add(host);
}
info.put(clusterInfoKey, hostList);
}
//Add ambari db server
- info.put("ambari_db_server_host", Arrays.asList(hostsMap.getHostMap(getHostName())));
+ info.put("ambari_db_server_host", Arrays.asList(getHostName()));
}
}
}
Modified: incubator/ambari/branches/branch-1.2/ambari-server/src/main/python/ambari-server.py
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-server/src/main/python/ambari-server.py?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-server/src/main/python/ambari-server.py (original)
+++ incubator/ambari/branches/branch-1.2/ambari-server/src/main/python/ambari-server.py Fri Jan 11 23:41:06 2013
@@ -33,7 +33,6 @@ import stat
import fileinput
import urllib2
import time
-import getpass
# debug settings
VERBOSE = False
SILENT = False
@@ -65,14 +64,8 @@ IP_TBLS_DISABLED="Firewall is stopped.\n
IP_TBLS_SRVC_NT_FND="iptables: unrecognized service"
# server commands
-ambari_provider_module_option = ""
-ambari_provider_module = os.environ.get('AMBARI_PROVIDER_MODULE')
-
-if ambari_provider_module is not None:
- ambari_provider_module_option = "-Dprovider.module.class=" + ambari_provider_module + " "
-
-SERVER_START_CMD="{0}" + os.sep + "bin" + os.sep + "java -server -XX:NewRatio=2 -XX:+UseConcMarkSweepGC " + ambari_provider_module_option + os.getenv('AMBARI_JVM_ARGS','-Xms512m -Xmx2048m') + " -cp {1}"+ os.pathsep + "{2}" + "/* org.apache.ambari.server.controller.AmbariServer >/var/log/ambari-server/ambari-server.out 2>&1"
-SERVER_START_CMD_DEBUG="{0}" + os.sep + "bin" + os.sep + "java -server -XX:NewRatio=2 -XX:+UseConcMarkSweepGC " + ambari_provider_module_option + os.getenv('AMBARI_JVM_ARGS','-Xms512m -Xmx2048m') + " -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n -cp {1}"+ os.pathsep + ".." + os.sep + "lib" + os.sep + "ambari-server" + os.sep + "* org.apache.ambari.server.controller.AmbariServer"
+SERVER_START_CMD="{0}" + os.sep + "bin" + os.sep + "java -server -XX:NewRatio=2 -XX:+UseConcMarkSweepGC " + os.getenv('AMBARI_JVM_ARGS','-Xms512m -Xmx2048m') + " -cp {1}"+ os.pathsep + "{2}" + "/* org.apache.ambari.server.controller.AmbariServer >/var/log/ambari-server/ambari-server.out 2>&1"
+SERVER_START_CMD_DEBUG="{0}" + os.sep + "bin" + os.sep + "java -server -XX:NewRatio=2 -XX:+UseConcMarkSweepGC " + os.getenv('AMBARI_JVM_ARGS','-Xms512m -Xmx2048m') + " -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n -cp {1}"+ os.pathsep + ".." + os.sep + "lib" + os.sep + "ambari-server" + os.sep + "* org.apache.ambari.server.controller.AmbariServer"
AMBARI_CONF_VAR="AMBARI_CONF_DIR"
AMBARI_SERVER_LIB="AMBARI_SERVER_LIB"
JAVA_HOME="JAVA_HOME"
@@ -91,7 +84,6 @@ PG_HBA_CONF_FILE = PG_HBA_DIR + "pg_hba.
PG_HBA_CONF_FILE_BACKUP = PG_HBA_DIR + "pg_hba_bak.conf.old"
POSTGRESQL_CONF_FILE = PG_HBA_DIR + "postgresql.conf"
PG_HBA_RELOAD_CMD = "sudo -u postgres pg_ctl -D {0} reload"
-PG_DEFAULT_PASSWORD = "bigdata"
JDBC_USER_NAME_PROPERTY = "server.jdbc.user.name"
JDBC_PASSWORD_FILE_PROPERTY = "server.jdbc.user.passwd"
JDBC_PASSWORD_FILENAME = "password.dat"
@@ -524,7 +516,7 @@ accepting will cancel the Ambari Server
os.chdir(savedPath)
jdk_version = re.search('Creating (jdk.*)/jre', out).group(1)
print "Successfully installed JDK to {0}/{1}".format(JDK_INSTALL_DIR, jdk_version)
- writeProperty(JAVA_HOME_PROPERTY, "{0}/{1}".format(JDK_INSTALL_DIR, jdk_version))
+ writeProperty("java.home", "{0}/{1}".format(JDK_INSTALL_DIR, jdk_version))
return 0
def get_postgre_status():
@@ -592,7 +584,7 @@ def get_JAVA_HOME():
try:
properties.load(open(conf_file))
- java_home = properties[JAVA_HOME_PROPERTY]
+ java_home = properties['java.home']
if (not 0 == len(java_home)) and (os.path.exists(java_home)):
return java_home
except (Exception), e:
@@ -827,14 +819,12 @@ def getChoiceStringInput(prompt,default,
return False
return default
-def getValidatedStringInput(prompt, default, pattern, description, is_pass):
+def getValidatedStringInput(prompt, default, pattern, description):
input =""
while (not input):
if (SILENT):
print (prompt)
input = default
- elif is_pass:
- input = getpass.getpass(prompt)
else:
input = raw_input(prompt)
if(not input.strip()):
@@ -860,22 +850,6 @@ def saveUsernamePassword(pathtofile, use
shutil.move(pathtofile, pathtofile+'.bak.ambari')
tree.write(pathtofile)
-def configurePostgresPassword():
- # setup password
- passwordDefault = PG_DEFAULT_PASSWORD
- passwordPrompt = 'Password [' + passwordDefault + ']: '
- passwordPattern = "^[a-zA-Z0-9_-]*$"
- passwordDescr = "Invalid characters in password. Use only alphanumeric or _ or - characters"
-
- password = getValidatedStringInput(passwordPrompt, passwordDefault, passwordPattern, passwordDescr, True)
- if password != passwordDefault:
- password1 = getValidatedStringInput("Re-enter password: ", passwordDefault, passwordPattern, passwordDescr, True)
- if password != password1:
- print "Passwords do not match"
- password = configurePostgresPassword()
-
- return password
-
def configurePostgresUsernamePassword(args):
conf_file = search_file(AMBARI_PROPERTIES_FILE, get_conf_dir())
properties = Properties()
@@ -904,14 +878,17 @@ def configurePostgresUsernamePassword(ar
username = usernameDefault
# setup password
- password = PG_DEFAULT_PASSWORD
+ passwordDefault = 'bigdata'
+ passwordPrompt = 'Password [' + passwordDefault + ']: '
+ passwordPattern = "^[a-zA-Z0-9_-]*$"
+ passwordDescr = "Invalid characters in password. Use only alphanumeric or _ or - characters"
+ password = passwordDefault
ok = getYNInput("Enter advanced database configuration [y/n] (n)? ", False)
if ok == True:
- username = getValidatedStringInput(usernamePrompt, usernameDefault, usernamePattern, usernameDescr, False)
+ username = getValidatedStringInput(usernamePrompt, usernameDefault, usernamePattern, usernameDescr)
print "Database username set to: " + username
- password = configurePostgresPassword()
-
+ password = getValidatedStringInput(passwordPrompt, passwordDefault, passwordPattern, passwordDescr)
passFilePath = os.path.join(os.path.dirname(conf_file), JDBC_PASSWORD_FILENAME)
Modified: incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionDBAccessorImpl.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionDBAccessorImpl.java?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionDBAccessorImpl.java (original)
+++ incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionDBAccessorImpl.java Fri Jan 11 23:41:06 2013
@@ -28,7 +28,6 @@ import org.apache.ambari.server.Role;
import org.apache.ambari.server.RoleCommand;
import org.apache.ambari.server.agent.ActionQueue;
import org.apache.ambari.server.agent.CommandReport;
-import org.apache.ambari.server.controller.HostsMap;
import org.apache.ambari.server.orm.GuiceJpaInitializer;
import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
import org.apache.ambari.server.orm.dao.ExecutionCommandDAO;
@@ -77,9 +76,7 @@ public class TestActionDBAccessorImpl {
clusters.getHost(hostName).persist();
clusters.addCluster(clusterName);
db = injector.getInstance(ActionDBAccessorImpl.class);
-
- am = new ActionManager(5000, 1200000, new ActionQueue(), clusters, db,
- new HostsMap((String) null));
+ am = new ActionManager(5000, 1200000, new ActionQueue(), clusters, db);
}
@After
Modified: incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionManager.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionManager.java?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionManager.java (original)
+++ incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionManager.java Fri Jan 11 23:41:06 2013
@@ -31,7 +31,6 @@ import org.apache.ambari.server.Role;
import org.apache.ambari.server.RoleCommand;
import org.apache.ambari.server.agent.ActionQueue;
import org.apache.ambari.server.agent.CommandReport;
-import org.apache.ambari.server.controller.HostsMap;
import org.apache.ambari.server.orm.GuiceJpaInitializer;
import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
import org.apache.ambari.server.state.Clusters;
@@ -75,7 +74,7 @@ public class TestActionManager {
public void testActionResponse() {
ActionDBAccessor db = injector.getInstance(ActionDBAccessorImpl.class);
ActionManager am = new ActionManager(5000, 1200000, new ActionQueue(),
- clusters, db, new HostsMap((String) null));
+ clusters, db);
populateActionDB(db, hostname);
Stage stage = db.getAllStages(requestId).get(0);
Assert.assertEquals(stageId, stage.getStageId());
@@ -111,7 +110,7 @@ public class TestActionManager {
public void testLargeLogs() {
ActionDBAccessor db = injector.getInstance(ActionDBAccessorImpl.class);
ActionManager am = new ActionManager(5000, 1200000, new ActionQueue(),
- clusters, db, new HostsMap((String) null));
+ clusters, db);
populateActionDB(db, hostname);
Stage stage = db.getAllStages(requestId).get(0);
Assert.assertEquals(stageId, stage.getStageId());
Modified: incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java (original)
+++ incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java Fri Jan 11 23:41:06 2013
@@ -34,7 +34,6 @@ import org.apache.ambari.server.actionma
import org.apache.ambari.server.agent.ActionQueue;
import org.apache.ambari.server.agent.AgentCommand;
import org.apache.ambari.server.agent.ExecutionCommand;
-import org.apache.ambari.server.controller.HostsMap;
import org.apache.ambari.server.state.Cluster;
import org.apache.ambari.server.state.Clusters;
import org.apache.ambari.server.state.Service;
@@ -74,7 +73,7 @@ public class TestActionScheduler {
//Keep large number of attempts so that the task is not expired finally
//Small action timeout to test rescheduling
ActionScheduler scheduler = new ActionScheduler(100, 100, db, aq, fsm,
- 10000, new HostsMap((String) null));
+ 10000);
scheduler.setTaskTimeoutAdjustment(false);
// Start the thread
scheduler.start();
@@ -138,8 +137,7 @@ public class TestActionScheduler {
db.persistActions(stages);
//Small action timeout to test rescheduling
- ActionScheduler scheduler = new ActionScheduler(100, 50, db, aq, fsm, 3,
- new HostsMap((String) null));
+ ActionScheduler scheduler = new ActionScheduler(100, 50, db, aq, fsm, 3);
scheduler.setTaskTimeoutAdjustment(false);
// Start the thread
scheduler.start();
Modified: incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestStage.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestStage.java?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestStage.java (original)
+++ incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestStage.java Fri Jan 11 23:41:06 2013
@@ -21,7 +21,6 @@ import static org.junit.Assert.*;
import org.apache.ambari.server.Role;
import org.apache.ambari.server.RoleCommand;
-import org.apache.ambari.server.controller.HostsMap;
import org.apache.ambari.server.utils.StageUtils;
import org.junit.Test;
Modified: incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java (original)
+++ incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java Fri Jan 11 23:41:06 2013
@@ -54,7 +54,6 @@ import org.apache.ambari.server.actionma
import org.apache.ambari.server.agent.HostStatus.Status;
import org.apache.ambari.server.api.services.AmbariMetaInfo;
import org.apache.ambari.server.configuration.Configuration;
-import org.apache.ambari.server.controller.HostsMap;
import org.apache.ambari.server.orm.GuiceJpaInitializer;
import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
import org.apache.ambari.server.state.Cluster;
@@ -109,7 +108,7 @@ public class TestHeartbeatHandler {
@Test
public void testHeartbeat() throws Exception {
ActionManager am = new ActionManager(0, 0, null, null,
- new ActionDBInMemoryImpl(), new HostsMap((String) null));
+ new ActionDBInMemoryImpl());
Clusters fsm = clusters;
String hostname = "host1";
fsm.addHost(hostname);
@@ -149,7 +148,7 @@ public class TestHeartbeatHandler {
@Test
public void testStatusHeartbeat() throws Exception {
ActionManager am = new ActionManager(0, 0, null, null,
- new ActionDBInMemoryImpl(), new HostsMap((String) null));
+ new ActionDBInMemoryImpl());
final String hostname = "host1";
String clusterName = "cluster1";
String serviceName = "HDFS";
@@ -237,8 +236,7 @@ public class TestHeartbeatHandler {
clusters.getHost(hostname).persist();
clusters.addCluster(clusterName);
ActionDBAccessor db = injector.getInstance(ActionDBAccessorImpl.class);
- ActionManager am = new ActionManager(5000, 1200000, new ActionQueue(), clusters, db,
- new HostsMap((String) null));
+ ActionManager am = new ActionManager(5000, 1200000, new ActionQueue(), clusters, db);
populateActionDB(db, hostname);
Stage stage = db.getAllStages(requestId).get(0);
Assert.assertEquals(stageId, stage.getStageId());
@@ -269,7 +267,6 @@ public class TestHeartbeatHandler {
private void populateActionDB(ActionDBAccessor db, String hostname) {
Stage s = new Stage(requestId, "/a/b", "cluster1");
s.setStageId(stageId);
- String filename = null;
s.addHostRoleExecutionCommand(hostname, Role.HBASE_MASTER,
RoleCommand.START,
new ServiceComponentHostStartEvent(Role.HBASE_MASTER.toString(),
@@ -284,7 +281,7 @@ public class TestHeartbeatHandler {
public void testRegistration() throws AmbariException,
InvalidStateTransitionException {
ActionManager am = new ActionManager(0, 0, null, null,
- new ActionDBInMemoryImpl(), new HostsMap((String) null));
+ new ActionDBInMemoryImpl());
Clusters fsm = clusters;
String hostname = "host1";
HeartBeatHandler handler = new HeartBeatHandler(fsm, new ActionQueue(), am,
@@ -311,7 +308,7 @@ public class TestHeartbeatHandler {
@Test
public void testRegistrationPublicHostname() throws AmbariException, InvalidStateTransitionException {
ActionManager am = new ActionManager(0, 0, null, null,
- new ActionDBInMemoryImpl(), new HostsMap((String) null));
+ new ActionDBInMemoryImpl());
Clusters fsm = clusters;
String hostname = "host1";
HeartBeatHandler handler = new HeartBeatHandler(fsm, new ActionQueue(), am,
@@ -344,7 +341,7 @@ public class TestHeartbeatHandler {
public void testInvalidOSRegistration() throws AmbariException,
InvalidStateTransitionException {
ActionManager am = new ActionManager(0, 0, null, null,
- new ActionDBInMemoryImpl(), new HostsMap((String) null));
+ new ActionDBInMemoryImpl());
Clusters fsm = clusters;
String hostname = "host1";
HeartBeatHandler handler = new HeartBeatHandler(fsm, new ActionQueue(), am,
@@ -373,7 +370,7 @@ public class TestHeartbeatHandler {
public void testRegisterNewNode()
throws AmbariException, InvalidStateTransitionException {
ActionManager am = new ActionManager(0, 0, null, null,
- new ActionDBInMemoryImpl(), new HostsMap((String) null));
+ new ActionDBInMemoryImpl());
Clusters fsm = clusters;
String hostname = "host1";
fsm.addHost(hostname);
@@ -463,7 +460,7 @@ public class TestHeartbeatHandler {
when(hm.generateStatusCommands(anyString())).thenReturn(dummyCmds);
ActionManager am = new ActionManager(0, 0, null, null,
- new ActionDBInMemoryImpl(), new HostsMap((String) null));
+ new ActionDBInMemoryImpl());
Clusters fsm = clusters;
String hostname = "host1";
ActionQueue actionQueue = new ActionQueue();
@@ -490,7 +487,7 @@ public class TestHeartbeatHandler {
@Test
public void testTaskInProgressHandling() throws AmbariException, InvalidStateTransitionException {
ActionManager am = new ActionManager(0, 0, null, null,
- new ActionDBInMemoryImpl(), new HostsMap((String) null));
+ new ActionDBInMemoryImpl());
final String hostname = "host1";
String clusterName = "cluster1";
String serviceName = "HDFS";
Modified: incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java (original)
+++ incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java Fri Jan 11 23:41:06 2013
@@ -56,7 +56,7 @@ public class AmbariManagementControllerI
injector.injectMembers(capture(controllerCapture));
expect(injector.getInstance(Gson.class)).andReturn(null);
- // getCluster
+ // getClusters
expect(clusters.getCluster("cluster1")).andReturn(cluster);
expect(cluster.convertToResponse()).andReturn(response);
@@ -95,7 +95,7 @@ public class AmbariManagementControllerI
injector.injectMembers(capture(controllerCapture));
expect(injector.getInstance(Gson.class)).andReturn(null);
- // getCluster
+ // getClusters
expect(clusters.getCluster("cluster1")).andThrow(new ClusterNotFoundException("cluster1"));
// replay mocks
@@ -148,7 +148,7 @@ public class AmbariManagementControllerI
injector.injectMembers(capture(controllerCapture));
expect(injector.getInstance(Gson.class)).andReturn(null);
- // getCluster
+ // getClusters
expect(clusters.getCluster("cluster1")).andThrow(new ClusterNotFoundException("cluster1"));
expect(clusters.getCluster("cluster2")).andReturn(cluster);
expect(clusters.getCluster("cluster3")).andReturn(cluster2);
Modified: incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ResourceImplTest.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ResourceImplTest.java?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ResourceImplTest.java (original)
+++ incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ResourceImplTest.java Fri Jan 11 23:41:06 2013
@@ -66,38 +66,4 @@ public class ResourceImplTest {
resource.setProperty(propertyId, 65L);
Assert.assertEquals(65L, resource.getPropertyValue(propertyId));
}
-
- @Test
- public void testCopyConstructor() {
- Resource resource = new ResourceImpl(Resource.Type.Cluster);
-
- String p1 = PropertyHelper.getPropertyId(null, "p1");
- String p2 = PropertyHelper.getPropertyId("c1", "p2");
- String p3 = PropertyHelper.getPropertyId("c1/c2", "p3");
- String p4 = PropertyHelper.getPropertyId("c1/c2/c3", "p4");
- String p5 = PropertyHelper.getPropertyId("c1", "p5");
-
- resource.setProperty(p1, "foo");
- Assert.assertEquals("foo", resource.getPropertyValue(p1));
-
- resource.setProperty(p2, 1);
- Assert.assertEquals(1, resource.getPropertyValue(p2));
-
- resource.setProperty(p3, (float) 1.99);
- Assert.assertEquals((float) 1.99, resource.getPropertyValue(p3));
-
- resource.setProperty(p4, 1.99);
- Assert.assertEquals(1.99, resource.getPropertyValue(p4));
-
- resource.setProperty(p5, 65L);
- Assert.assertEquals(65L, resource.getPropertyValue(p5));
-
- Resource copy = new ResourceImpl(resource);
-
- Assert.assertEquals("foo", copy.getPropertyValue(p1));
- Assert.assertEquals(1, copy.getPropertyValue(p2));
- Assert.assertEquals((float) 1.99, copy.getPropertyValue(p3));
- Assert.assertEquals(1.99, copy.getPropertyValue(p4));
- Assert.assertEquals(65L, copy.getPropertyValue(p5));
- }
}
Modified: incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java (original)
+++ incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java Fri Jan 11 23:41:06 2013
@@ -25,7 +25,6 @@ import java.util.List;
import org.apache.ambari.server.Role;
import org.apache.ambari.server.RoleCommand;
import org.apache.ambari.server.actionmanager.Stage;
-import org.apache.ambari.server.controller.HostsMap;
import org.apache.ambari.server.metadata.RoleCommandOrder;
import org.apache.ambari.server.state.svccomphost.ServiceComponentHostStartEvent;
import org.apache.ambari.server.utils.StageUtils;
Modified: incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/utils/TestStageUtils.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/utils/TestStageUtils.java?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/utils/TestStageUtils.java (original)
+++ incubator/ambari/branches/branch-1.2/ambari-server/src/test/java/org/apache/ambari/server/utils/TestStageUtils.java Fri Jan 11 23:41:06 2013
@@ -30,8 +30,6 @@ import org.apache.ambari.server.actionma
import org.apache.ambari.server.actionmanager.Stage;
import org.apache.ambari.server.agent.ExecutionCommand;
import org.apache.ambari.server.api.services.AmbariMetaInfo;
-import org.apache.ambari.server.configuration.Configuration;
-import org.apache.ambari.server.controller.HostsMap;
import org.apache.ambari.server.orm.GuiceJpaInitializer;
import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
import org.apache.ambari.server.state.*;
@@ -170,7 +168,7 @@ public class TestStageUtils {
addHdfsService(fsm.getCluster("c1"), hostList, injector);
addHbaseService(fsm.getCluster("c1"), hostList, injector);
Map<String, List<String>> info = StageUtils.getClusterHostInfo(fsm
- .getCluster("c1"), new HostsMap(injector.getInstance(Configuration.class)));
+ .getCluster("c1"));
assertEquals(2, info.get("slave_hosts").size());
assertEquals(1, info.get("hbase_master_host").size());
assertEquals("h1", info.get("hbase_master_host").get(0));
Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/controllers.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/controllers.js?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/controllers.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/controllers.js Fri Jan 11 23:41:06 2013
@@ -26,6 +26,7 @@ require('controllers/installer');
require('controllers/global/background_operations_controller');
require('controllers/main');
require('controllers/main/admin');
+require('controllers/main/admin/item');
require('controllers/main/admin/user');
require('controllers/main/admin/user/edit');
require('controllers/main/admin/user/create');
@@ -34,9 +35,11 @@ require('controllers/main/admin/authenti
require('controllers/main/service');
require('controllers/main/service/item');
require('controllers/main/service/info/summary');
+require('controllers/main/service/info/metrics');
require('controllers/main/service/info/configs');
require('controllers/main/service/info/audit');
require('controllers/main/service/add_controller');
+require('controllers/main/alert');
require('controllers/main/host');
require('controllers/main/host/details');
require('controllers/main/host/add_controller');
@@ -56,6 +59,8 @@ require('controllers/main/charts/heatmap
require('controllers/main/charts/heatmap_metrics/heatmap_metric_mapreduce_reducesRunning');
require('controllers/main/charts/heatmap_metrics/heatmap_metric_mapreduce_memHeapUsed');
require('controllers/main/charts/heatmap');
+require('controllers/main/charts/horizon_chart');
+require('controllers/main/rack');
require('controllers/main/apps_controller');
require('controllers/main/apps/item_controller');
require('controllers/wizard/slave_component_groups_controller');
Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/global/cluster_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/global/cluster_controller.js?rev=1432332&r1=1432331&r2=1432332&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/global/cluster_controller.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/global/cluster_controller.js Fri Jan 11 23:41:06 2013
@@ -94,7 +94,7 @@ App.ClusterController = Em.Controller.ex
var svcs = App.Service.find();
var gangliaSvc = svcs.findProperty("serviceName", "GANGLIA");
if (gangliaSvc) {
- var svcComponents = gangliaSvc.get('hostComponents');
+ var svcComponents = gangliaSvc.get('components');
if (svcComponents) {
var gangliaSvcComponent = svcComponents.findProperty("componentName", "GANGLIA_SERVER");
if (gangliaSvcComponent) {
@@ -128,7 +128,7 @@ App.ClusterController = Em.Controller.ex
var svcs = App.Service.find();
var nagiosSvc = svcs.findProperty("serviceName", "NAGIOS");
if (nagiosSvc) {
- var svcComponents = nagiosSvc.get('hostComponents');
+ var svcComponents = nagiosSvc.get('components');
if (svcComponents) {
var nagiosSvcComponent = svcComponents.findProperty("componentName", "NAGIOS_SERVER");
if (nagiosSvcComponent) {
Added: incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/main/admin/item.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/main/admin/item.js?rev=1432332&view=auto
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/main/admin/item.js (added)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/main/admin/item.js Fri Jan 11 23:41:06 2013
@@ -0,0 +1,23 @@
+/**
+ * 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.
+ */
+
+var App = require('app');
+
+App.MainAdminItemController = Em.Controller.extend({
+ name:'mainAdminItemController'
+})
\ No newline at end of file