usergrid git commit: De-dup management app as part of migration script and fix re-index so it passes the APP uuid into the API call.

2015-11-03 Thread mrusso
Repository: usergrid
Updated Branches:
  refs/heads/2.1-release b04c4cc92 -> dfc70f45c (forced update)


De-dup management app as part of migration script and fix re-index so it passes 
the APP uuid into the API call.


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

Branch: refs/heads/2.1-release
Commit: dfc70f45cc1100776ed81cb346668dd73ca3288b
Parents: 244fa52
Author: Michael Russo 
Authored: Tue Nov 3 14:33:03 2015 -0800
Committer: Michael Russo 
Committed: Tue Nov 3 14:37:28 2015 -0800

--
 stack/scripts/multitenant_migrate.py | 20 
 1 file changed, 16 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/usergrid/blob/dfc70f45/stack/scripts/multitenant_migrate.py
--
diff --git a/stack/scripts/multitenant_migrate.py 
b/stack/scripts/multitenant_migrate.py
index f728671..c31783c 100644
--- a/stack/scripts/multitenant_migrate.py
+++ b/stack/scripts/multitenant_migrate.py
@@ -232,7 +232,6 @@ class Migrate:
 break
 
 # Migrate app info
-
 if self.is_appinfo_migrated():
 self.logger.info('AppInfo already migrated. Resetting version 
for re-migration.')
 self.reset_appinfo_migration()
@@ -251,11 +250,24 @@ class Migrate:
 break
 self.logger.info('AppInfo Migration Ended.')
 
+# De-dup management app
+job = self.start_dedup(MANAGEMENT_APP_ID)
+self.logger.info('Started management dedup.  App=[%s], Job=[%s]', 
MANAGEMENT_APP_ID, job)
+is_running = True
+while is_running:
+time.sleep(STATUS_INTERVAL_SECONDS)
+is_running = self.is_dedup_running(job)
+if not is_running:
+break
+
+self.logger.info("Finished dedup. App=[%s], Job=[%s]", 
MANAGEMENT_APP_ID, job)
+self.metrics['dedup_end_' + MANAGEMENT_APP_ID] = get_current_time()
+
 # Reindex management app
 
 job = self.start_app_reindex(MANAGEMENT_APP_ID)
 self.metrics['reindex_start'] = get_current_time()
-self.logger.info('Started Re-index.  Job=[%s]', job)
+self.logger.info('Started management Re-index.  Job=[%s]', job)
 is_running = True
 while is_running:
 time.sleep(STATUS_INTERVAL_SECONDS)
@@ -263,7 +275,7 @@ class Migrate:
 if not is_running:
 break
 
-self.logger.info("Finished Re-index. Job=[%s]", job)
+self.logger.info("Finished management Re-index. Job=[%s]", job)
 self.metrics['reindex_end'] = get_current_time()
 
 # Dedup and re-index all of organization's apps
@@ -517,7 +529,7 @@ class Migrate:
 body = json.dumps({'updated': self.start_date})
 
 try:
-r = requests.post(url=self.get_reindex_url(), data=body, 
auth=(self.super_user, self.super_pass))
+r = requests.post(url=self.get_reindex_url() + "/" + appId, 
data=body, auth=(self.super_user, self.super_pass))
 
 if r.status_code == 200:
 response = r.json()



usergrid git commit: De-dup management app as part of migration script and fix re-index so it passes the APP uuid into the API call.

2015-11-03 Thread mrusso
Repository: usergrid
Updated Branches:
  refs/heads/2.1-release 244fa52ee -> b04c4cc92


De-dup management app as part of migration script and fix re-index so it passes 
the APP uuid into the API call.


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

Branch: refs/heads/2.1-release
Commit: b04c4cc92daefa1db80aa2ce0cc2e15197d81dba
Parents: 244fa52
Author: Michael Russo 
Authored: Tue Nov 3 14:33:03 2015 -0800
Committer: Michael Russo 
Committed: Tue Nov 3 14:33:03 2015 -0800

--
 stack/scripts/multitenant_migrate.py | 20 
 1 file changed, 16 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/usergrid/blob/b04c4cc9/stack/scripts/multitenant_migrate.py
--
diff --git a/stack/scripts/multitenant_migrate.py 
b/stack/scripts/multitenant_migrate.py
index f728671..0b64a51 100644
--- a/stack/scripts/multitenant_migrate.py
+++ b/stack/scripts/multitenant_migrate.py
@@ -231,8 +231,20 @@ class Migrate:
 if index_mapping_updated:
 break
 
-# Migrate app info
+# De-dup management app
+job = self.start_dedup(MANAGEMENT_APP_ID)
+self.logger.info('Started management dedup.  App=[%s], Job=[%s]', 
MANAGEMENT_APP_ID, job)
+is_running = True
+while is_running:
+time.sleep(STATUS_INTERVAL_SECONDS)
+is_running = self.is_dedup_running(job)
+if not is_running:
+break
 
+self.logger.info("Finished dedup. App=[%s], Job=[%s]", 
MANAGEMENT_APP_ID, job)
+self.metrics['dedup_end_' + MANAGEMENT_APP_ID] = get_current_time()
+
+# Migrate app info
 if self.is_appinfo_migrated():
 self.logger.info('AppInfo already migrated. Resetting version 
for re-migration.')
 self.reset_appinfo_migration()
@@ -255,7 +267,7 @@ class Migrate:
 
 job = self.start_app_reindex(MANAGEMENT_APP_ID)
 self.metrics['reindex_start'] = get_current_time()
-self.logger.info('Started Re-index.  Job=[%s]', job)
+self.logger.info('Started management Re-index.  Job=[%s]', job)
 is_running = True
 while is_running:
 time.sleep(STATUS_INTERVAL_SECONDS)
@@ -263,7 +275,7 @@ class Migrate:
 if not is_running:
 break
 
-self.logger.info("Finished Re-index. Job=[%s]", job)
+self.logger.info("Finished management Re-index. Job=[%s]", job)
 self.metrics['reindex_end'] = get_current_time()
 
 # Dedup and re-index all of organization's apps
@@ -517,7 +529,7 @@ class Migrate:
 body = json.dumps({'updated': self.start_date})
 
 try:
-r = requests.post(url=self.get_reindex_url(), data=body, 
auth=(self.super_user, self.super_pass))
+r = requests.post(url=self.get_reindex_url() + "/" + appId, 
data=body, auth=(self.super_user, self.super_pass))
 
 if r.status_code == 200:
 response = r.json()