You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@usergrid.apache.org by keyurkarnik <gi...@git.apache.org> on 2018/08/29 01:48:42 UTC

[GitHub] usergrid pull request #597: Patchset of changes made by Mike Dunker from ano...

GitHub user keyurkarnik opened a pull request:

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

    Patchset of changes made by Mike Dunker from another fork

    

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

    $ git pull https://github.com/keyurkarnik/usergrid dunker_patch_set

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

    https://github.com/apache/usergrid/pull/597.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 #597
    
----
commit 455bdde7004f1f610f6ac2395298167ee9a3e7b2
Author: Mike Dunker <md...@...>
Date:   2018-02-24T20:09:52Z

    fix NPE with push notifications and sendMessageToLocalRegion

commit e8dc09bb3961ae91f5631b14344c7bcd62539263
Author: Mike Dunker <md...@...>
Date:   2018-02-24T23:59:39Z

    bypass ES for push notification devices specified by UUID

commit ec7c6b48730ad233284dc536907dc73f6c01d8e1
Author: Mike Dunker <md...@...>
Date:   2018-03-01T15:41:32Z

    update to later tomcat version

commit a4f32fab8b8b044d4a0d3f9436225a147d9ab6f8
Author: Mike Dunker <md...@...>
Date:   2018-03-06T18:50:43Z

    check for deleted entity candidates before checking for stale candidates

commit 35a22edd3fe7e3356254f2770f2c22d8c7685789
Author: Mike Dunker <md...@...>
Date:   2018-03-06T20:19:35Z

    exclude CollectionDeleteTest for now

commit 1feb3dbab88145c9d5483b05bced03c2f6bafa79
Author: Mike Dunker <md...@...>
Date:   2018-03-08T08:32:39Z

    Several indexing fixes:
    
    1. remove possible duplicate entities from query results when using collection
       setting indexConsistency=latest
    2. deindex all but latest candidate for an entity, even when using
       indexConsistency=latest
    3. fix indexing bug when collection settings have been added but fields
       setting does not exist
    4. by default deindex deleted entity even when indexing is off for the
       collection (this will clean up old index documents) - this is controlled by
       usergrid.entityManager.deindex_deleted_when_collection_indexing_off
       property.

commit c98a5e92d1f2bf2424624e6c1f76511a345f5d69
Author: Mike Dunker <md...@...>
Date:   2018-03-08T23:05:09Z

    fix deindex on update -- was deindexing current version along with old versions

commit 0632ceff5b40b3a23f1561589cb911c3ca45cb6b
Author: Mike Dunker <md...@...>
Date:   2018-03-12T19:19:56Z

    improvements to CollectionIterator tool for duplicate and orphaned connections

commit 38c7313dce04550e72e5bac434d831675ad5bf2d
Author: Mike Dunker <md...@...>
Date:   2018-04-06T23:04:38Z

    Add password when soft deleting an application
    
    Will need the password when attempting to restore.

commit 57afad20a6c152550cc7f9fb3d35d445dbb90a25
Author: Mike Dunker <md...@...>
Date:   2018-04-06T23:05:56Z

    Add ability to query by name/uuid without using Elasticsearch
    
    example ql: "direct widget1,56d8fac2-39ef-11e8-b467-0ed5f89f718b,widget3"

commit 59e7a24e9ebd577bd892812bd36f2626fa011677
Author: Mike Dunker <md...@...>
Date:   2018-04-06T23:08:41Z

    Create AppDeleter tool to delete data for an application

commit 98a2f5d23d4736219d23c637223a891c47216eed
Author: Mike Dunker <md...@...>
Date:   2018-04-13T01:03:47Z

    fix NPE for missing names in direct queries and block requests based on direct query count before deduping

commit 0a3333c90b9beb00037f83af9cd49044a83618d5
Author: Mike Dunker <md...@...>
Date:   2018-04-13T01:27:31Z

    return 400 when direct query has too many items

----


---

[GitHub] usergrid pull request #597: Patchset of changes made by Mike Dunker from ano...

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

    https://github.com/apache/usergrid/pull/597#discussion_r227159176
  
    --- Diff: stack/core/src/main/java/org/apache/usergrid/corepersistence/service/ApplicationRestorePasswordServiceImpl.java ---
    @@ -0,0 +1,72 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *      http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.usergrid.corepersistence.service;
    +
    +import com.google.common.base.Preconditions;
    +import com.google.inject.Inject;
    +import org.apache.commons.lang.StringUtils;
    +import org.apache.usergrid.corepersistence.util.CpNamingUtils;
    +import org.apache.usergrid.persistence.map.MapManager;
    +import org.apache.usergrid.persistence.map.MapManagerFactory;
    +import org.apache.usergrid.persistence.map.impl.MapScopeImpl;
    +import org.apache.usergrid.persistence.model.entity.Id;
    +
    +import java.util.UUID;
    +
    +public class ApplicationRestorePasswordServiceImpl implements ApplicationRestorePasswordService {
    +    private final MapManagerFactory mapManagerFactory;
    +    final static String restorePasswordNamespace = "appRestorePassword";
    --- End diff --
    
    Will take this refactoring up as a separate task


---

[GitHub] usergrid issue #597: Patchset of changes made by Mike Dunker from another fo...

Posted by keyurkarnik <gi...@git.apache.org>.
Github user keyurkarnik commented on the issue:

    https://github.com/apache/usergrid/pull/597
  
    All failing tests fixed, bugs fixed and verified to be working :  
    
    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Summary:
    [INFO]
    [INFO] Usergrid Parent 2.2.0-SNAPSHOT ..................... SUCCESS [  8.872 s]
    [INFO] Usergrid Build Tools ............................... SUCCESS [  1.380 s]
    [INFO] Usergrid Config .................................... SUCCESS [  0.431 s]
    [INFO] Usergrid Persistence ............................... SUCCESS [  0.383 s]
    [INFO] Usergrid Model ..................................... SUCCESS [  3.321 s]
    [INFO] Usergrid Common .................................... SUCCESS [ 22.213 s]
    [INFO] Usergrid ActorSystem ............................... SUCCESS [  4.686 s]
    [INFO] Usergrid Collection ................................ SUCCESS [ 56.760 s]
    [INFO] Usergrid Map ....................................... SUCCESS [ 19.979 s]
    [INFO] Usergrid Queue ..................................... SUCCESS [03:34 min]
    [INFO] Usergrid QueryIndex ................................ SUCCESS [ 16.520 s]
    [INFO] Usergrid Test Utils ................................ SUCCESS [  6.158 s]
    [INFO] Usergrid Graph ..................................... SUCCESS [02:14 min]
    [INFO] Usergrid Cache ..................................... SUCCESS [  7.138 s]
    [INFO] Usergrid Token ..................................... SUCCESS [  3.435 s]
    [INFO] Usergrid Core ...................................... SUCCESS [02:20 min]
    [INFO] Usergrid Services .................................. SUCCESS [09:06 min]
    [INFO] Usergrid REST ...................................... SUCCESS [09:34 min]
    [INFO] Usergrid Tools ..................................... SUCCESS [03:30 min]
    [INFO] Usergrid Query Validator 2.2.0-SNAPSHOT ............ SUCCESS [ 39.672 s]
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 33:31 min
    [INFO] Finished at: 2018-09-24T11:09:46-07:00
    [INFO] ------------------------------------------------------------------------
    
    
    👍 


---

[GitHub] usergrid pull request #597: Patchset of changes made by Mike Dunker from ano...

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

    https://github.com/apache/usergrid/pull/597#discussion_r220598055
  
    --- Diff: stack/core/src/main/java/org/apache/usergrid/corepersistence/service/ApplicationRestorePasswordServiceImpl.java ---
    @@ -0,0 +1,72 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *      http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.usergrid.corepersistence.service;
    +
    +import com.google.common.base.Preconditions;
    +import com.google.inject.Inject;
    +import org.apache.commons.lang.StringUtils;
    +import org.apache.usergrid.corepersistence.util.CpNamingUtils;
    +import org.apache.usergrid.persistence.map.MapManager;
    +import org.apache.usergrid.persistence.map.MapManagerFactory;
    +import org.apache.usergrid.persistence.map.impl.MapScopeImpl;
    +import org.apache.usergrid.persistence.model.entity.Id;
    +
    +import java.util.UUID;
    +
    +public class ApplicationRestorePasswordServiceImpl implements ApplicationRestorePasswordService {
    --- End diff --
    
    Keyur, please add JIRA


---

[GitHub] usergrid pull request #597: Patchset of changes made by Mike Dunker from ano...

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

    https://github.com/apache/usergrid/pull/597#discussion_r220033772
  
    --- Diff: stack/core/src/test/java/org/apache/usergrid/persistence/CollectionDeleteTest.java ---
    @@ -42,6 +43,7 @@
     
     
     @NotThreadSafe
    +@Ignore("fix later")
    --- End diff --
    
    Created JIRA ticket https://issues.apache.org/jira/browse/USERGRID-1348
    Fixed the issue as well.


---

[GitHub] usergrid pull request #597: Patchset of changes made by Mike Dunker from ano...

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

    https://github.com/apache/usergrid/pull/597#discussion_r219960051
  
    --- Diff: stack/core/src/test/java/org/apache/usergrid/persistence/CollectionDeleteTest.java ---
    @@ -42,6 +43,7 @@
     
     
     @NotThreadSafe
    +@Ignore("fix later")
    --- End diff --
    
    Can we get a JIRA ticket opened with detail only this and link the ignore comment to the JIRA ticket.


---

[GitHub] usergrid issue #597: Patchset of changes made by Mike Dunker from another fo...

Posted by michaelarusso <gi...@git.apache.org>.
Github user michaelarusso commented on the issue:

    https://github.com/apache/usergrid/pull/597
  
    LGTM


---

[GitHub] usergrid pull request #597: Patchset of changes made by Mike Dunker from ano...

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

    https://github.com/apache/usergrid/pull/597#discussion_r220597642
  
    --- Diff: stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/CandidateResult.java ---
    @@ -54,25 +99,69 @@ public String getDocId() {
             return docId;
         }
     
    +    public String getDirectEntityName() {
    +        return directEntityName;
    +    }
    +
    +    public UUID getDirectEntityUUID() {
    +        return directEntityUUID;
    +    }
    +
    +    public String getDirectEntityType() {
    +        return directEntityType;
    +    }
    +
    +    // use to set id for direct query after resolution
    +    public void setId(Id entityId) {
    +        this.entityId = entityId;
    +    }
    +
     
         @Override
         public boolean equals( final Object o ) {
             if ( this == o ) {
                 return true;
             }
    +        if ( o == null ) {
    +            return false;
    +        }
             if ( !( o instanceof CandidateResult ) ) {
                 return false;
             }
     
             final CandidateResult that = ( CandidateResult ) o;
     
    -        if ( !entityId.equals( that.entityId ) ) {
    +        if ( entityId == null && that.entityId != null) {
    --- End diff --
    
    I'm guessing you looked and there weren't -- Keyur, please add.


---

[GitHub] usergrid pull request #597: Patchset of changes made by Mike Dunker from ano...

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

    https://github.com/apache/usergrid/pull/597#discussion_r219960557
  
    --- Diff: stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/PipelineContext.java ---
    @@ -43,16 +47,24 @@
         // it can happen if ES was not updated or has yet to be updated.
         private final boolean keepStaleEntries;
         private String query;
    +    private ParsedQuery parsedQuery;
     
     
         public PipelineContext( final ApplicationScope applicationScope, final RequestCursor requestCursor, final int limit, final int id, boolean keepStaleEntries, String query ) {
     
             this.applicationScope = applicationScope;
    -        this.requestCursor = requestCursor;
    -        this.limit = limit;
             this.id = id;
             this.keepStaleEntries = keepStaleEntries;
             this.query = query;
    +        this.parsedQuery = ParsedQueryBuilder.build(query);
    +        if (parsedQuery != null && parsedQuery.isDirectQuery()) {
    --- End diff --
    
    I can tell the direct query is allowing the request to specify a bunch of UUIDs to batch fetch it seems, or something of that nature. We should open a JIRA with the details and link to this PR so that others can be aware of the new feature.


---

[GitHub] usergrid pull request #597: Patchset of changes made by Mike Dunker from ano...

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

    https://github.com/apache/usergrid/pull/597#discussion_r227163860
  
    --- Diff: stack/core/src/main/java/org/apache/usergrid/corepersistence/service/ApplicationRestorePasswordServiceImpl.java ---
    @@ -0,0 +1,72 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *      http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.usergrid.corepersistence.service;
    +
    +import com.google.common.base.Preconditions;
    +import com.google.inject.Inject;
    +import org.apache.commons.lang.StringUtils;
    +import org.apache.usergrid.corepersistence.util.CpNamingUtils;
    +import org.apache.usergrid.persistence.map.MapManager;
    +import org.apache.usergrid.persistence.map.MapManagerFactory;
    +import org.apache.usergrid.persistence.map.impl.MapScopeImpl;
    +import org.apache.usergrid.persistence.model.entity.Id;
    +
    +import java.util.UUID;
    +
    +public class ApplicationRestorePasswordServiceImpl implements ApplicationRestorePasswordService {
    +    private final MapManagerFactory mapManagerFactory;
    +    final static String restorePasswordNamespace = "appRestorePassword";
    --- End diff --
    
    https://issues.apache.org/jira/browse/USERGRID-1351


---

[GitHub] usergrid pull request #597: Patchset of changes made by Mike Dunker from ano...

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

    https://github.com/apache/usergrid/pull/597#discussion_r220589766
  
    --- Diff: stack/core/src/main/java/org/apache/usergrid/corepersistence/service/ApplicationRestorePasswordServiceImpl.java ---
    @@ -0,0 +1,72 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *      http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.usergrid.corepersistence.service;
    +
    +import com.google.common.base.Preconditions;
    +import com.google.inject.Inject;
    +import org.apache.commons.lang.StringUtils;
    +import org.apache.usergrid.corepersistence.util.CpNamingUtils;
    +import org.apache.usergrid.persistence.map.MapManager;
    +import org.apache.usergrid.persistence.map.MapManagerFactory;
    +import org.apache.usergrid.persistence.map.impl.MapScopeImpl;
    +import org.apache.usergrid.persistence.model.entity.Id;
    +
    +import java.util.UUID;
    +
    +public class ApplicationRestorePasswordServiceImpl implements ApplicationRestorePasswordService {
    --- End diff --
    
    This is a feature for managed usergrid apps. When soft deleting an application, a password can be supplied so that an orgadmin for the org containing the app cannot restore the app without supplying the password. This can be used during the GDPR process -- if the owner of the app requests data deletion, that owner should not be able to restore. Sys admin can restore without knowing the password.


---

[GitHub] usergrid pull request #597: Patchset of changes made by Mike Dunker from ano...

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

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


---

[GitHub] usergrid pull request #597: Patchset of changes made by Mike Dunker from ano...

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

    https://github.com/apache/usergrid/pull/597#discussion_r219960259
  
    --- Diff: stack/core/src/main/java/org/apache/usergrid/corepersistence/service/ApplicationRestorePasswordServiceImpl.java ---
    @@ -0,0 +1,72 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *      http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.usergrid.corepersistence.service;
    +
    +import com.google.common.base.Preconditions;
    +import com.google.inject.Inject;
    +import org.apache.commons.lang.StringUtils;
    +import org.apache.usergrid.corepersistence.util.CpNamingUtils;
    +import org.apache.usergrid.persistence.map.MapManager;
    +import org.apache.usergrid.persistence.map.MapManagerFactory;
    +import org.apache.usergrid.persistence.map.impl.MapScopeImpl;
    +import org.apache.usergrid.persistence.model.entity.Id;
    +
    +import java.util.UUID;
    +
    +public class ApplicationRestorePasswordServiceImpl implements ApplicationRestorePasswordService {
    +    private final MapManagerFactory mapManagerFactory;
    +    final static String restorePasswordNamespace = "appRestorePassword";
    --- End diff --
    
    Maybe these defaults should be configurable.


---

[GitHub] usergrid pull request #597: Patchset of changes made by Mike Dunker from ano...

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

    https://github.com/apache/usergrid/pull/597#discussion_r227163374
  
    --- Diff: stack/core/src/main/java/org/apache/usergrid/corepersistence/service/ApplicationRestorePasswordServiceImpl.java ---
    @@ -0,0 +1,72 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *      http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.usergrid.corepersistence.service;
    +
    +import com.google.common.base.Preconditions;
    +import com.google.inject.Inject;
    +import org.apache.commons.lang.StringUtils;
    +import org.apache.usergrid.corepersistence.util.CpNamingUtils;
    +import org.apache.usergrid.persistence.map.MapManager;
    +import org.apache.usergrid.persistence.map.MapManagerFactory;
    +import org.apache.usergrid.persistence.map.impl.MapScopeImpl;
    +import org.apache.usergrid.persistence.model.entity.Id;
    +
    +import java.util.UUID;
    +
    +public class ApplicationRestorePasswordServiceImpl implements ApplicationRestorePasswordService {
    --- End diff --
    
    https://issues.apache.org/jira/browse/USERGRID-1350


---

[GitHub] usergrid pull request #597: Patchset of changes made by Mike Dunker from ano...

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

    https://github.com/apache/usergrid/pull/597#discussion_r219963200
  
    --- Diff: stack/core/src/main/java/org/apache/usergrid/corepersistence/service/ApplicationRestorePasswordServiceImpl.java ---
    @@ -0,0 +1,72 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *      http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.usergrid.corepersistence.service;
    +
    +import com.google.common.base.Preconditions;
    +import com.google.inject.Inject;
    +import org.apache.commons.lang.StringUtils;
    +import org.apache.usergrid.corepersistence.util.CpNamingUtils;
    +import org.apache.usergrid.persistence.map.MapManager;
    +import org.apache.usergrid.persistence.map.MapManagerFactory;
    +import org.apache.usergrid.persistence.map.impl.MapScopeImpl;
    +import org.apache.usergrid.persistence.model.entity.Id;
    +
    +import java.util.UUID;
    +
    +public class ApplicationRestorePasswordServiceImpl implements ApplicationRestorePasswordService {
    --- End diff --
    
    Also probably good to create JIRA ticket about the new feature and link to this PR.


---

[GitHub] usergrid pull request #597: Patchset of changes made by Mike Dunker from ano...

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

    https://github.com/apache/usergrid/pull/597#discussion_r219960121
  
    --- Diff: stack/core/src/main/java/org/apache/usergrid/persistence/PathQuery.java ---
    @@ -122,10 +126,30 @@ protected Results getHeadResults( EntityManager em ) throws Exception {
     
             EntityRef ref = new SimpleEntityRef(type,uuid);
     
    -        // if it's a single name identifier, just directly fetch that
    -        if ( !query.getQl().isPresent() && query.getSingleNameOrEmailIdentifier() != null){
    +        if ( !query.getQl().isPresent() && query.getSingleUuidIdentifier() != null) {
    --- End diff --
    
    What is the reasoning behind this change?


---

[GitHub] usergrid pull request #597: Patchset of changes made by Mike Dunker from ano...

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

    https://github.com/apache/usergrid/pull/597#discussion_r220591244
  
    --- Diff: stack/core/src/main/java/org/apache/usergrid/corepersistence/service/ApplicationRestorePasswordServiceImpl.java ---
    @@ -0,0 +1,72 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *      http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.usergrid.corepersistence.service;
    +
    +import com.google.common.base.Preconditions;
    +import com.google.inject.Inject;
    +import org.apache.commons.lang.StringUtils;
    +import org.apache.usergrid.corepersistence.util.CpNamingUtils;
    +import org.apache.usergrid.persistence.map.MapManager;
    +import org.apache.usergrid.persistence.map.MapManagerFactory;
    +import org.apache.usergrid.persistence.map.impl.MapScopeImpl;
    +import org.apache.usergrid.persistence.model.entity.Id;
    +
    +import java.util.UUID;
    +
    +public class ApplicationRestorePasswordServiceImpl implements ApplicationRestorePasswordService {
    +    private final MapManagerFactory mapManagerFactory;
    +    final static String restorePasswordNamespace = "appRestorePassword";
    --- End diff --
    
    Are you talking about "appRestorePassword"? It probably makes sense to move this constant to a central location so that there are no conflicts. Also move constants for every class using MapManagerFactory:createMapManager to the central loc -- this is a common pattern currently to define the map scope name in the file where it is used.
    



---

[GitHub] usergrid pull request #597: Patchset of changes made by Mike Dunker from ano...

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

    https://github.com/apache/usergrid/pull/597#discussion_r219960347
  
    --- Diff: stack/core/src/main/java/org/apache/usergrid/corepersistence/service/ApplicationRestorePasswordServiceImpl.java ---
    @@ -0,0 +1,72 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *      http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.usergrid.corepersistence.service;
    +
    +import com.google.common.base.Preconditions;
    +import com.google.inject.Inject;
    +import org.apache.commons.lang.StringUtils;
    +import org.apache.usergrid.corepersistence.util.CpNamingUtils;
    +import org.apache.usergrid.persistence.map.MapManager;
    +import org.apache.usergrid.persistence.map.MapManagerFactory;
    +import org.apache.usergrid.persistence.map.impl.MapScopeImpl;
    +import org.apache.usergrid.persistence.model.entity.Id;
    +
    +import java.util.UUID;
    +
    +public class ApplicationRestorePasswordServiceImpl implements ApplicationRestorePasswordService {
    --- End diff --
    
    Can you add a comment that describes what this class is for?


---

[GitHub] usergrid pull request #597: Patchset of changes made by Mike Dunker from ano...

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

    https://github.com/apache/usergrid/pull/597#discussion_r220595460
  
    --- Diff: stack/core/src/main/java/org/apache/usergrid/persistence/PathQuery.java ---
    @@ -122,10 +126,30 @@ protected Results getHeadResults( EntityManager em ) throws Exception {
     
             EntityRef ref = new SimpleEntityRef(type,uuid);
     
    -        // if it's a single name identifier, just directly fetch that
    -        if ( !query.getQl().isPresent() && query.getSingleNameOrEmailIdentifier() != null){
    +        if ( !query.getQl().isPresent() && query.getSingleUuidIdentifier() != null) {
    --- End diff --
    
    I believe this was because push notification devices being specified by UUID were being returned using ES instead of direct access.


---

[GitHub] usergrid pull request #597: Patchset of changes made by Mike Dunker from ano...

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

    https://github.com/apache/usergrid/pull/597#discussion_r220072009
  
    --- Diff: stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/PipelineContext.java ---
    @@ -43,16 +47,24 @@
         // it can happen if ES was not updated or has yet to be updated.
         private final boolean keepStaleEntries;
         private String query;
    +    private ParsedQuery parsedQuery;
     
     
         public PipelineContext( final ApplicationScope applicationScope, final RequestCursor requestCursor, final int limit, final int id, boolean keepStaleEntries, String query ) {
     
             this.applicationScope = applicationScope;
    -        this.requestCursor = requestCursor;
    -        this.limit = limit;
             this.id = id;
             this.keepStaleEntries = keepStaleEntries;
             this.query = query;
    +        this.parsedQuery = ParsedQueryBuilder.build(query);
    +        if (parsedQuery != null && parsedQuery.isDirectQuery()) {
    --- End diff --
    
    https://issues.apache.org/jira/browse/USERGRID-1349


---

[GitHub] usergrid pull request #597: Patchset of changes made by Mike Dunker from ano...

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

    https://github.com/apache/usergrid/pull/597#discussion_r219968111
  
    --- Diff: stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/CandidateResult.java ---
    @@ -54,25 +99,69 @@ public String getDocId() {
             return docId;
         }
     
    +    public String getDirectEntityName() {
    +        return directEntityName;
    +    }
    +
    +    public UUID getDirectEntityUUID() {
    +        return directEntityUUID;
    +    }
    +
    +    public String getDirectEntityType() {
    +        return directEntityType;
    +    }
    +
    +    // use to set id for direct query after resolution
    +    public void setId(Id entityId) {
    +        this.entityId = entityId;
    +    }
    +
     
         @Override
         public boolean equals( final Object o ) {
             if ( this == o ) {
                 return true;
             }
    +        if ( o == null ) {
    +            return false;
    +        }
             if ( !( o instanceof CandidateResult ) ) {
                 return false;
             }
     
             final CandidateResult that = ( CandidateResult ) o;
     
    -        if ( !entityId.equals( that.entityId ) ) {
    +        if ( entityId == null && that.entityId != null) {
    --- End diff --
    
    Do we have extra tests for all these additional conditions to equals()


---

[GitHub] usergrid pull request #597: Patchset of changes made by Mike Dunker from ano...

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

    https://github.com/apache/usergrid/pull/597#discussion_r220072588
  
    --- Diff: stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/PipelineContext.java ---
    @@ -43,16 +47,24 @@
         // it can happen if ES was not updated or has yet to be updated.
         private final boolean keepStaleEntries;
         private String query;
    +    private ParsedQuery parsedQuery;
     
     
         public PipelineContext( final ApplicationScope applicationScope, final RequestCursor requestCursor, final int limit, final int id, boolean keepStaleEntries, String query ) {
     
             this.applicationScope = applicationScope;
    -        this.requestCursor = requestCursor;
    -        this.limit = limit;
             this.id = id;
             this.keepStaleEntries = keepStaleEntries;
             this.query = query;
    +        this.parsedQuery = ParsedQueryBuilder.build(query);
    +        if (parsedQuery != null && parsedQuery.isDirectQuery()) {
    --- End diff --
    
    Direct query introduces an operator 'direct' so that a ql with multiple UUIDs and names hits C* only and not ES


---