You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@usergrid.apache.org by snoopdave <gi...@git.apache.org> on 2015/12/21 14:57:02 UTC

[GitHub] usergrid pull request: Add index repair to merge duplicates.

GitHub user snoopdave opened a pull request:

    https://github.com/apache/usergrid/pull/451

    Add index repair to merge duplicates.

    Adding in Russo's new updateOrganizationUniqueIndex() to ensure that the keeper organization is the one that is in the unique name index.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/snoopdave/usergrid dup-org-repair

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/usergrid/pull/451.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #451
    
----
commit 9be5d3a3df999e54ef8fc081cc6a36da468c0db3
Author: Dave Johnson <sn...@apache.org>
Date:   2015-12-21T13:52:48Z

    Add index repair to merge duplicates.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] usergrid pull request: Add index repair to merge duplicates.

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/usergrid/pull/451


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] usergrid pull request: Add index repair to merge duplicates.

Posted by michaelarusso <gi...@git.apache.org>.
Github user michaelarusso commented on a diff in the pull request:

    https://github.com/apache/usergrid/pull/451#discussion_r48162531
  
    --- Diff: stack/tools/src/main/java/org/apache/usergrid/tools/DuplicateOrgRepair.java ---
    @@ -529,10 +529,22 @@ public void call(Subscriber<? super OrgUser> subscriber) {
             
             @Override
             public void removeOrg(Org keeper, Org duplicate) throws Exception {
    -            // we don't have a remove org API so rename org so that it is no longer a duplicate
    +            
    +            // rename org so that it is no longer a duplicate
                 OrganizationInfo orgInfo = managementService.getOrganizationByUuid( duplicate.getId() );
                 orgInfo.setName( "dup_" + keeper.getId() + "_" + RandomStringUtils.randomAlphanumeric(10) );
                 managementService.updateOrganization( orgInfo );
    +
    +            // fix the org name index
    +            OrganizationInfo orgInfoKeeper = managementService.getOrganizationByUuid( duplicate.getId() );
    +            try {
    +                managementService.updateOrganizationUniqueIndex( orgInfo, duplicate.getId() );
    --- End diff --
    
    this should take in the keeper org's OrganizationInfo, and the duplicate's ID.  Looks like we're passing in the duplicates OrganizationInfo as well as the ID. 
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---