You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2020/12/16 21:04:25 UTC

[GitHub] [geode] jdeppe-pivotal opened a new pull request #5858: GEODE-8795: Lucene queries should utilize post-processing if enabled

jdeppe-pivotal opened a new pull request #5858:
URL: https://github.com/apache/geode/pull/5858


   Thank you for submitting a contribution to Apache Geode.
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [ ] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
   
   - [ ] Has your PR been rebased against the latest commit within the target branch (typically `develop`)?
   
   - [ ] Is your initial contribution a single, squashed commit?
   
   - [ ] Does `gradlew build` run cleanly?
   
   - [ ] Have you written or updated unit tests to verify your changes?
   
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   
   ### Note:
   Please ensure that once the PR is submitted, check Concourse for build issues and
   submit an update to your PR as soon as possible. If you need help, please send an
   email to dev@geode.apache.org.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] jdeppe-pivotal commented on pull request #5858: GEODE-8795: Lucene queries should utilize post-processing if enabled

Posted by GitBox <gi...@apache.org>.
jdeppe-pivotal commented on pull request #5858:
URL: https://github.com/apache/geode/pull/5858#issuecomment-747025574


   Almost all the work is still from @nabarunnag. I had to make a different change to bring the principal into the `FunctionContext`.
   
   One difference is that the original fix was not passing a `PDXInstance` (if PDX was in use) to the post-processor but was instead deserializing to the domain object first. If we just pass whatever is retrieved (PDX or otherwise) the post processor can then make a decision how to handle it. Otherwise the user needs to ensure that their domain classes are available on the server.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] jdeppe-pivotal edited a comment on pull request #5858: GEODE-8795: Lucene queries should utilize post-processing if enabled

Posted by GitBox <gi...@apache.org>.
jdeppe-pivotal edited a comment on pull request #5858:
URL: https://github.com/apache/geode/pull/5858#issuecomment-747025574


   Almost all the work is still from @nabarunnag. I had to make a different change to bring the principal into the `FunctionContext`.
   
   One difference is that the original fix was not passing a `PDXInstance` (if PDX was in use) to the post-processor but was instead deserializing to the domain object first. If we just pass whatever is retrieved, PDX or otherwise, the post processor can then make a decision how to handle it. Otherwise the user needs to ensure that their domain classes are available on the server.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] lgtm-com[bot] commented on pull request #5858: GEODE-8795: Lucene queries should utilize post-processing if enabled

Posted by GitBox <gi...@apache.org>.
lgtm-com[bot] commented on pull request #5858:
URL: https://github.com/apache/geode/pull/5858#issuecomment-747060233


   This pull request **introduces 1 alert** when merging 28b988d39b048ef05524ae4d815dec4856d3c44e into 82f5df25df2603e2f5fefb82ea890edac9a98f15 - [view on LGTM.com](https://lgtm.com/projects/g/apache/geode/rev/pr-62b5ae2c39be905a93807e2b508d70c216462eca)
   
   **new alerts:**
   
   * 1 for Uncontrolled data used in path expression


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] upthewaterspout commented on a change in pull request #5858: GEODE-8795: Lucene queries should utilize post-processing if enabled

Posted by GitBox <gi...@apache.org>.
upthewaterspout commented on a change in pull request #5858:
URL: https://github.com/apache/geode/pull/5858#discussion_r551521495



##########
File path: geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/results/LuceneGetPageFunction.java
##########
@@ -65,15 +70,19 @@ public void execute(FunctionContext context) {
     }
   }
 
-  protected PageEntry getEntry(final Region region, final Object key) {
+  protected PageEntry getEntry(final Region region, final Object key,
+      SecurityService securityService, Object principal) {
     final EntrySnapshot entry = (EntrySnapshot) region.getEntry(key);
     if (entry == null) {
       return null;
     }
 
-    final Object value = entry.getRegionEntry().getValue(null);
+    Object value = entry.getRegionEntry().getValue(null);
     if (value == null || Token.isInvalidOrRemoved(value)) {
       return null;
+    } else if (securityService.needPostProcess()) {
+      value = securityService.postProcess(principal, region.getFullPath(), key, entry.getValue(),

Review comment:
       I'm a little concerned that `value` here might be a CachedDeserializable in some cases. I think this whole function and PageEntry class are designed to try to pass the value back to the user without deserializing it if it can. 
   
   However I can't think of a case that you didn't test already, so I guess it's doing the right thing.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] lgtm-com[bot] commented on pull request #5858: GEODE-8795: Lucene queries should utilize post-processing if enabled

Posted by GitBox <gi...@apache.org>.
lgtm-com[bot] commented on pull request #5858:
URL: https://github.com/apache/geode/pull/5858#issuecomment-747111384


   This pull request **introduces 1 alert** when merging f8f23bc72f33e4b5a0f87c4cc99b56f09829e5c9 into 82f5df25df2603e2f5fefb82ea890edac9a98f15 - [view on LGTM.com](https://lgtm.com/projects/g/apache/geode/rev/pr-9a3f7d126bbc685dbb257287e30e17d9483c647c)
   
   **new alerts:**
   
   * 1 for Uncontrolled data used in path expression


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] jdeppe-pivotal merged pull request #5858: GEODE-8795: Lucene queries should utilize post-processing if enabled

Posted by GitBox <gi...@apache.org>.
jdeppe-pivotal merged pull request #5858:
URL: https://github.com/apache/geode/pull/5858


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org