[4/4] ambari git commit: AMBARI-8714. Refactor UpgradeHelper_HDP2.py script to be compliant with 2.0/2.1 stack upgrade (dlysnichenko)

2014-12-18 Thread dmitriusan
AMBARI-8714. Refactor UpgradeHelper_HDP2.py script to be compliant with 2.0/2.1 
stack upgrade (dlysnichenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/10659055
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/10659055
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/10659055

Branch: refs/heads/trunk
Commit: 10659055de1716a9216467325a0a940e50e2
Parents: 0e91ecb
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Thu Dec 18 20:41:16 2014 +0200
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Thu Dec 18 20:41:16 2014 +0200

--
 .../src/main/python/UpgradeHelper_HDP2.py   | 1245 --
 ambari-server/src/main/python/upgradeHelper.py  | 1183 +
 .../catalog/UpgradeCatalog_1.3_to_2.2.json  |  961 ++
 .../src/test/python/TestUpgradeHelper.py|   95 ++
 .../src/test/python/TestUpgradeScript_HDP2.py   |  646 -
 5 files changed, 2239 insertions(+), 1891 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/10659055/ambari-server/src/main/python/UpgradeHelper_HDP2.py
--
diff --git a/ambari-server/src/main/python/UpgradeHelper_HDP2.py 
b/ambari-server/src/main/python/UpgradeHelper_HDP2.py
deleted file mode 100644
index 396ec2b..000
--- a/ambari-server/src/main/python/UpgradeHelper_HDP2.py
+++ /dev/null
@@ -1,1245 +0,0 @@
-#!/usr/bin/env python
-
-'''
-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.
-'''
-
-import optparse
-from pprint import pprint
-import sys
-import datetime
-import os.path
-import logging
-import shutil
-import json
-import subprocess
-import time
-
-
-# action commands
-GET_MR_MAPPING_ACTION = save-mr-mapping
-DELETE_MR_ACTION = delete-mr
-ADD_YARN_MR2_ACTION = add-yarn-mr2
-MODIFY_CONFIG_ACTION = update-configs
-BACKUP_CONFIG_ACTION = backup-configs
-INSTALL_YARN_MR2_ACTION = install-yarn-mr2
-VALID_ACTIONS = ', '.join([GET_MR_MAPPING_ACTION, DELETE_MR_ACTION, 
ADD_YARN_MR2_ACTION, MODIFY_CONFIG_ACTION,
-   INSTALL_YARN_MR2_ACTION, BACKUP_CONFIG_ACTION])
-
-MR_MAPPING_FILE = mr_mapping
-UPGRADE_LOG_FILE = upgrade_log
-CAPACITY_SCHEDULER_TAG = capacity-scheduler
-MAPRED_SITE_TAG = mapred-site
-GLOBAL_TAG = global
-HDFS_SITE_TAG = hdfs-site
-CORE_SITE_TAG = core-site
-YARN_SITE_TAG = yarn-site
-HBASE_SITE_TAG = hbase-site
-HIVE_SITE_TAG = hive-site
-REPLACE_JH_HOST_NAME_TAG = REPLACE_JH_HOST
-REPLACE_RM_HOST_NAME_TAG = REPLACE_RM_HOST
-REPLACE_WITH_TAG = REPLACE_WITH_
-DELETE_OLD_TAG = DELETE_OLD
-
-AUTH_FORMAT = '{0}:{1}'
-ROOT_FORMAT = 'http://{0}:8080/api/v1'
-URL_FORMAT = ROOT_FORMAT+'/clusters/{1}'
-
-
-logger = logging.getLogger()
-
-# old : new
-PROPERTY_MAPPING = {
-  create.empty.dir.if.nonexist: mapreduce.jobcontrol.createdir.ifnotexist,
-  dfs.access.time.precision: dfs.namenode.accesstime.precision,
-  dfs.backup.address: dfs.namenode.backup.address,
-  dfs.backup.http.address: dfs.namenode.backup.http-address,
-  dfs.balance.bandwidthPerSec: dfs.datanode.balance.bandwidthPerSec,
-  dfs.block.size: dfs.blocksize,
-  dfs.data.dir: dfs.datanode.data.dir,
-  dfs.datanode.max.xcievers: dfs.datanode.max.transfer.threads,
-  dfs.df.interval: fs.df.interval,
-  dfs.federation.nameservice.id: dfs.nameservice.id,
-  dfs.federation.nameservices: dfs.nameservices,
-  dfs.http.address: dfs.namenode.http-address,
-  dfs.https.address: dfs.namenode.https-address,
-  dfs.https.client.keystore.resource: dfs.client.https.keystore.resource,
-  dfs.https.need.client.auth: dfs.client.https.need-auth,
-  dfs.max.objects: dfs.namenode.max.objects,
-  dfs.max-repl-streams: dfs.namenode.replication.max-streams,
-  dfs.name.dir: dfs.namenode.name.dir,
-  dfs.name.dir.restore: dfs.namenode.name.dir.restore,
-  dfs.name.edits.dir: dfs.namenode.edits.dir,
-  dfs.permissions: dfs.permissions.enabled,
-  dfs.permissions.supergroup: dfs.permissions.superusergroup,
-  dfs.read.prefetch.size: dfs.client.read.prefetch.size,
-  dfs.replication.considerLoad: 

[4/4] ambari git commit: AMBARI-8714. Refactor UpgradeHelper_HDP2.py script to be compliant with 2.0/2.1 stack upgrade (dlysnichenko)

2014-12-18 Thread dmitriusan
AMBARI-8714. Refactor UpgradeHelper_HDP2.py script to be compliant with 2.0/2.1 
stack upgrade (dlysnichenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c2b9a1a7
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c2b9a1a7
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c2b9a1a7

Branch: refs/heads/trunk
Commit: c2b9a1a72c434aceef7e905c86e85adf61f4cfd9
Parents: 68f9cb8
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Thu Dec 18 21:59:41 2014 +0200
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Thu Dec 18 21:59:41 2014 +0200

--
 ambari-server/pom.xml   |   20 +-
 .../src/main/python/UpgradeHelper_HDP2.py   | 1245 --
 ambari-server/src/main/python/upgradeHelper.py  | 1183 +
 .../catalog/UpgradeCatalog_1.3_to_2.2.json  |  961 ++
 .../src/test/python/TestUpgradeHelper.py|   95 ++
 .../src/test/python/TestUpgradeScript_HDP2.py   |  646 -
 6 files changed, 2257 insertions(+), 1893 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c2b9a1a7/ambari-server/pom.xml
--
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index 78012ba..f8f5487 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -500,7 +500,7 @@
   locationsrc/main/resources/scripts/location
 /source
 source
-  locationsrc/main/python/UpgradeHelper_HDP2.py/location
+  locationsrc/main/python/upgradeHelper.py/location
 /source
   /sources
 /mapping
@@ -544,6 +544,14 @@
   /sources
 /mapping
 mapping
+  
directory/var/lib/ambari-server/resources/upgrade/catalog/directory
+  sources
+source
+  locationsrc/main/resources/upgrade/catalog/location
+/source
+  /sources
+/mapping
+mapping
   
directory/var/lib/ambari-server/resources/stacks/${stack.distribution}/directory
   sources
 source
@@ -894,7 +902,7 @@
   /mapper
 /data
 data
-  srcsrc/main/python/UpgradeHelper_HDP2.py/src
+  srcsrc/main/python/upgradeHelper.py/src
   typefile/type
   mapper
 typeperm/type
@@ -919,6 +927,14 @@
   /mapper
 /data
 data
+  srcsrc/main/resources/upgrade/catalog/src
+  typedirectory/type
+  mapper
+typeperm/type
+
prefix/var/lib/ambari-server/resources/upgrade/catalog/prefix
+  /mapper
+/data
+data
   srctarget/classes/stacks/${stack.distribution}/src
   typedirectory/type
   mapper

http://git-wip-us.apache.org/repos/asf/ambari/blob/c2b9a1a7/ambari-server/src/main/python/UpgradeHelper_HDP2.py
--
diff --git a/ambari-server/src/main/python/UpgradeHelper_HDP2.py 
b/ambari-server/src/main/python/UpgradeHelper_HDP2.py
deleted file mode 100644
index 396ec2b..000
--- a/ambari-server/src/main/python/UpgradeHelper_HDP2.py
+++ /dev/null
@@ -1,1245 +0,0 @@
-#!/usr/bin/env python
-
-'''
-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.
-'''
-
-import optparse
-from pprint import pprint
-import sys
-import datetime
-import os.path
-import logging
-import shutil
-import json
-import subprocess
-import time
-
-
-# action commands
-GET_MR_MAPPING_ACTION = save-mr-mapping
-DELETE_MR_ACTION = delete-mr
-ADD_YARN_MR2_ACTION = add-yarn-mr2
-MODIFY_CONFIG_ACTION = update-configs
-BACKUP_CONFIG_ACTION = backup-configs
-INSTALL_YARN_MR2_ACTION = install-yarn-mr2
-VALID_ACTIONS = ', '.join([GET_MR_MAPPING_ACTION, DELETE_MR_ACTION, 
ADD_YARN_MR2_ACTION, MODIFY_CONFIG_ACTION,
-