[GitHub] incubator-geode pull request #:

2016-11-07 Thread vectorijk
Github user vectorijk commented on the pull request:


https://github.com/apache/incubator-geode/commit/c1216eb1817df3c6b20afbaff49ba30e76d34b44#commitcomment-19733561
  
@upthewaterspout I think so. Maybe `1.1.0-incubating-SNAPSHOT` makes more 
sense.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Review Request 53566: GEODE-2078: Fix manifest classpath

2016-11-07 Thread Anthony Baker

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53566/
---

Review request for geode, Mark Bretl and Dan Smith.


Repository: geode


Description
---

The manifest classpath for *-dependencies.jar was pulling in
dependencies from geode-pulse and geode-web-api. Filter out those
projects before collecting the jars.


Diffs
-

  geode-assembly/build.gradle cc2518b834fee59d8c7fc91233f2206c6a379c96 

Diff: https://reviews.apache.org/r/53566/diff/


Testing
---


Thanks,

Anthony Baker



[GitHub] incubator-geode issue #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/276
  
A few changes requested:

1. use Autowire to auto wire the RestSecurityService.
2. In your RestSecurityPostProcessorTest, considering only using 
"customers" region for readability. You don't needs all these "/" + REGION_NAME 
+"/key1" at all.
3. Then you can use a customer domain object specific PostProcessor to 
change the field values and assert for the value returned.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86920722
  
--- Diff: 
geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/BaseControllerAdvice.java
 ---
@@ -50,6 +52,11 @@
 
   protected static final String REST_API_VERSION = "/v1";
 
+  public BaseControllerAdvice(final RestSecurityService securityService,
--- End diff --

use Autowire inside AbstractBaseController to auto wire the 
RestSecurityService instead of using constructors. 


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86920671
  
--- Diff: 
geode-assembly/src/test/java/org/apache/geode/rest/internal/web/RestSecurityPostProcessorTest.java
 ---
@@ -0,0 +1,185 @@
+/*
+ * 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.geode.rest.internal.web;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_BIND_ADDRESS;
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_PORT;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_POST_PROCESSOR;
+import static 
org.apache.geode.distributed.ConfigurationProperties.START_DEV_REST_API;
+import static org.apache.geode.rest.internal.web.GeodeRestClient.getCode;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getContentType;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonArray;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonObject;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.execute.FunctionService;
+import org.apache.geode.internal.AvailablePortHelper;
+import org.apache.geode.rest.internal.web.controllers.GetRegions;
+import org.apache.geode.security.templates.SamplePostProcessor;
+import org.apache.geode.security.templates.SampleSecurityManager;
+import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+import org.apache.geode.test.junit.categories.SecurityTest;
+import org.apache.http.HttpResponse;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.springframework.http.MediaType;
+
+import java.net.URLEncoder;
+import java.util.Properties;
+
+
+@Category({IntegrationTest.class, SecurityTest.class})
+public class RestSecurityPostProcessorTest {
+
+  static final String REGION_NAME = "AuthRegion";
+
+  static int restPort = AvailablePortHelper.getRandomAvailableTCPPort();
+  static Properties properties = new Properties() {
+{
+  setProperty(SampleSecurityManager.SECURITY_JSON,
+  
"org/apache/geode/management/internal/security/clientServer.json");
+  setProperty(SECURITY_MANAGER, SampleSecurityManager.class.getName());
+  setProperty(START_DEV_REST_API, "true");
+  setProperty(HTTP_SERVICE_BIND_ADDRESS, "localhost");
+  setProperty(HTTP_SERVICE_PORT, restPort + "");
+  setProperty(SECURITY_POST_PROCESSOR, 
SamplePostProcessor.class.getName());
+}
+  };
+
+  @ClassRule
+  public static ServerStarterRule serverStarter = new 
ServerStarterRule(properties);
+  private final GeodeRestClient restClient = new 
GeodeRestClient("localhost", restPort);
+
+  @BeforeClass
+  public static void before() throws Exception {
+serverStarter.startServer();
+Region region =
+
serverStarter.cache.createRegionFactory(RegionShortcut.REPLICATE).create(REGION_NAME);
+region.put("key1",
+
"{\"@type\":\"com.gemstone.gemfire.web.rest.domain.Order\",\"purchaseOrderNo\":1121,\"customerId\":1012,\"description\":\"Order
 for  XYZ 
Corp\",\"orderDate\":\"02/10/2014\",\"deliveryDate\":\"02/20/2014\",\"contact\":\"Jelly
 
Bean\",\"email\":\"jelly.b...@example.com\",\"phone\":\"01-2048096\",\"items\":[{\"itemNo\":1,\"description\":\"Product-100\",\"quantity\":12,\"unitPrice\":5,\"totalPrice\":60}],\"totalPrice\":225}");
+region.put("key2", "bar");
+

Re: Review Request 53557: GEODE-2080 Rest POST put call not working with region valueConstrain

2016-11-07 Thread Darrel Schneider

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53557/#review155241
---




geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java (line 
3273)


If pdx.getClassName() is not equals to JSON_CLASSNAME then would it make 
sense to set valueClassName to pdx.getClassName()? That way you could have 
"read-serialized" set to true and still have a meaningful value constraint with 
pdx



geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java (line 
3281)


Is ".equals" too specific? You want something like instanceof. For example 
if the value-constraint was "Number" you would want it to be satisfied if 
"valueClassName" was "Integer", "Long", etc.

You could do this with Class.isAssignableFrom(this.valueConstraint) but in 
that case you need to load a class for "valueClassName". One of the goals of 
pdx is that you do not need to be able to load the domain classes on the 
server, so you might not want to do this check. If you leave it with just a 
simple equals check you should document that in the case of pdx the 
value-constraint needs to exactly match (i.e. no instanceof support).


- Darrel Schneider


On Nov. 7, 2016, 2:13 p.m., Bruce Schuchardt wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53557/
> ---
> 
> (Updated Nov. 7, 2016, 2:13 p.m.)
> 
> 
> Review request for geode, Barry Oglesby, Hitesh Khamesra, and Udo Kohlmeyer.
> 
> 
> Bugs: GEODE-2080
> https://issues.apache.org/jira/browse/GEODE-2080
> 
> 
> Repository: geode
> 
> 
> Description
> ---
> 
> If you set a value constraint on a cache Region you will be unable to store 
> objects in the region via the Rest API.  This change-set modifies 
> LocalRegion's constraint check to look for a Rest document and use its type 
> name in the constraint check
> 
> 
> Diffs
> -
> 
>   geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java 
> 3873e6e159ebba4c1a288e9fccde5dbabd2a1140 
>   geode-core/src/test/java/org/apache/geode/pdx/PdxClientServerDUnitTest.java 
> 9a9680a7e14ddec91f005fa0f0c6c3da8d033df2 
> 
> Diff: https://reviews.apache.org/r/53557/diff/
> 
> 
> Testing
> ---
> 
> new test, precheckin
> 
> 
> Thanks,
> 
> Bruce Schuchardt
> 
>



Re: Review Request 53557: GEODE-2080 Rest POST put call not working with region valueConstrain

2016-11-07 Thread Udo Kohlmeyer

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53557/#review155238
---




geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java 
(lines 3269 - 3284)


Maybe this is better suited on the PDXInstance. Maybe a method like 
"isTypeOf(Class). Then at least we don't spread the PDX logic everywhere in the 
code.


- Udo Kohlmeyer


On Nov. 7, 2016, 10:13 p.m., Bruce Schuchardt wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53557/
> ---
> 
> (Updated Nov. 7, 2016, 10:13 p.m.)
> 
> 
> Review request for geode, Barry Oglesby, Hitesh Khamesra, and Udo Kohlmeyer.
> 
> 
> Bugs: GEODE-2080
> https://issues.apache.org/jira/browse/GEODE-2080
> 
> 
> Repository: geode
> 
> 
> Description
> ---
> 
> If you set a value constraint on a cache Region you will be unable to store 
> objects in the region via the Rest API.  This change-set modifies 
> LocalRegion's constraint check to look for a Rest document and use its type 
> name in the constraint check
> 
> 
> Diffs
> -
> 
>   geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java 
> 3873e6e159ebba4c1a288e9fccde5dbabd2a1140 
>   geode-core/src/test/java/org/apache/geode/pdx/PdxClientServerDUnitTest.java 
> 9a9680a7e14ddec91f005fa0f0c6c3da8d033df2 
> 
> Diff: https://reviews.apache.org/r/53557/diff/
> 
> 
> Testing
> ---
> 
> new test, precheckin
> 
> 
> Thanks,
> 
> Bruce Schuchardt
> 
>



Re: Review Request 53442: GEODE-1740: Correct potential region inconsistencies with concurrent clear and transaction commit

2016-11-07 Thread Darrel Schneider

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53442/#review155228
---




geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java 
(line 3695)


I see no reason for the !r.hasServerProxy check



geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java 
(line 3704)


I think lockForTXCacheModification is now dead code


- Darrel Schneider


On Nov. 3, 2016, 4:08 p.m., Scott Jewell wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53442/
> ---
> 
> (Updated Nov. 3, 2016, 4:08 p.m.)
> 
> 
> Review request for geode, Darrel Schneider and Eric Shu.
> 
> 
> Bugs: GEODE-1740
> https://issues.apache.org/jira/browse/GEODE-1740
> 
> 
> Repository: geode
> 
> 
> Description
> ---
> 
> GEODE-1740: Correct potential region inconsistencies with concurrent clear 
> and transaction commit
> 
> 
> Diffs
> -
> 
>   
> geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
>  de05b0d3991254834da94ed97ada9c9247aa69ab 
>   geode-core/src/main/java/org/apache/geode/internal/cache/RegionMap.java 
> ee8a84e57b5b72cc801cd2474a51dfd0bd3083f3 
>   geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java 
> 99a3b83d931dccd0faec482e42cda7ded18a13e7 
>   
> geode-core/src/test/java/org/apache/geode/internal/cache/ClearTXLockingDUnitTest.java
>  PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/53442/diff/
> 
> 
> Testing
> ---
> 
> New unit test ClearTXLockingDUnitTest
> 
> precheckin
> 
> 
> Thanks,
> 
> Scott Jewell
> 
>



[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread kjduling
Github user kjduling commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86900866
  
--- Diff: 
geode-core/src/main/java/org/apache/geode/security/PostProcessor.java ---
@@ -44,6 +47,9 @@ default void init(Properties securityProps) {}
*/
   Object processRegionValue(Object principal, String regionName, Object 
key, Object value);
 
+  Collection processQueryResult(Object principal, Query query, 
Collection regions,
--- End diff --

removed


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread kjduling
Github user kjduling commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86900814
  
--- Diff: 
geode-core/src/main/java/org/apache/geode/internal/security/IntegratedSecurityService.java
 ---
@@ -409,6 +435,34 @@ public Object postProcess(Object principal, String 
regionPath, Object key, Objec
 return newValue;
   }
 
+  private Object getPrincipal(Object principal) {
+if (principal == null) {
+  Subject subject = getSubject();
+  if (subject == null)
+return null;
+  principal = subject.getPrincipal();
+}
+return principal;
+  }
+
+  @Override
+  public Collection postProcess(Query query, Collection 
regionNames,
+  Collection results) {
+return postProcess(null, query, regionNames, results);
+  }
+
+  @Override
+  public Collection postProcess(Object principal, Query query,
--- End diff --

done


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread kjduling
Github user kjduling commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86900842
  
--- Diff: 
geode-core/src/main/java/org/apache/geode/internal/security/SecurityService.java
 ---
@@ -87,6 +89,12 @@
   Object postProcess(Object principal, String regionPath, Object key, 
Object value,
   boolean valueIsSerialized);
 
+  Collection postProcess(Query query, Collection 
regionNames,
+  Collection results);
+
+  Collection postProcess(Object principal, Query query, 
Collection regionNames,
--- End diff --

done


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread kjduling
Github user kjduling commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86900849
  
--- Diff: 
geode-core/src/main/java/org/apache/geode/internal/security/SecurityService.java
 ---
@@ -87,6 +89,12 @@
   Object postProcess(Object principal, String regionPath, Object key, 
Object value,
   boolean valueIsSerialized);
 
+  Collection postProcess(Query query, Collection 
regionNames,
--- End diff --

done


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #276: GEODE-1993: postprocess region/key

2016-11-07 Thread kjduling
Github user kjduling commented on the issue:

https://github.com/apache/incubator-geode/pull/276
  
precheckin successful


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Resend: [VIRTUAL] Geode Clubhouse Thurs, November 10 9AM Pacific - Best Practices for Testing Geode, or any Java Open Source Project

2016-11-07 Thread Gregory Chase
Resend with correct and consistent dates...

On Mon, Nov 7, 2016 at 3:22 PM, Gregory Chase  wrote:

> Dear Geode Community,
>
> Its been a while since we've had a contributor's topic.  We have a great
> discussion planned for this Thursday, November 10, at 9AM Pacific: "*Best
> Practices for Testing Geode, or any Java open source project*."
>
> Add to calendar
> 
> | Join the meeting 
>
> Kirk Lund, Committer for Apache Geode, will discuss the following:
>
> Unit testing -  how contributors and committers should be testing new code
> to be added to Apache Geode.
> Integration testing - the testing framework that runs for automatic builds
> Distributed testing - Geode-specific testing built upon JUnit, known as
> DUnit
>
> Lastly Kirk would like to talk about a possible future for DUnit to allow
> Geode users to test their scale-out applications based on Geode.
>
> *About the speaker*
> Kirk Lund is a software engineer with more than two decades experience
> developing and testing highly concurrent, distributed enterprise software.
> Kirk has been working with the Apache Geode and GemFire technology for well
> over a decade.
>
> See you this coming Thursday!
>
> Add to calendar
> 
>  | Join the meeting 
>
> --
> Greg Chase
>
> Global Head, Big Data Communities
> http://www.pivotal.io/big-data
>
> Pivotal Software
> http://www.pivotal.io/
>
> 650-215-0477
> @GregChase
> Blog: http://geekmarketing.biz/
>
>
>
>


-- 
Greg Chase

Global Head, Big Data Communities
http://www.pivotal.io/big-data

Pivotal Software
http://www.pivotal.io/

650-215-0477
@GregChase
Blog: http://geekmarketing.biz/


Re: [VIRTUAL] Geode Clubhouse Thurs, November 10 9AM Pacific - Best Practices for Testing Geode, or any Java Open Source Project

2016-11-07 Thread Gregory Chase
Thanks Dave...I think I'm confusing my 10's and 11's :)

On Mon, Nov 7, 2016 at 3:39 PM, Dave Barnes  wrote:

> Thanks for organizing these sessions, Greg. Please check the date -
> Thursday is the 10th, Friday is the 11th.
>
> On Mon, Nov 7, 2016 at 3:22 PM, Gregory Chase  wrote:
>
> > Dear Geode Community,
> >
> > Its been a while since we've had a contributor's topic.  We have a great
> > discussion planned for this Thursday, November 11, at 9AM Pacific: "*Best
> > Practices for Testing Geode, or any Java open source project*."
> >
> > Add to calendar
> >  > cXRpNm45cXFhdjRmY2d2dDNlNHVlYnZqY3MgcGl2b3RhbC5pb191OGtndnVh
> > aGprYm9oMWduZmh2NXRzMnY5Y0Bn=America/Los_Angeles>
> > | Join the meeting 
> >
> > Kirk Lund, Committer for Apache Geode, will discuss the following:
> >
> > Unit testing -  how contributors and committers should be testing new
> code
> > to be added to Apache Geode.
> > Integration testing - the testing framework that runs for automatic
> builds
> > Distributed testing - Geode-specific testing built upon JUnit, known as
> > DUnit
> >
> > Lastly Kirk would like to talk about a possible future for DUnit to allow
> > Geode users to test their scale-out applications based on Geode.
> >
> > *About the speaker*
> > Kirk Lund is a software engineer with more than two decades experience
> > developing and testing highly concurrent, distributed enterprise
> software.
> > Kirk has been working with the Apache Geode and GemFire technology for
> well
> > over a decade.
> >
> > See you this coming Thursday!
> >
> > Add to calendar
> >  > cXRpNm45cXFhdjRmY2d2dDNlNHVlYnZqY3MgcGl2b3RhbC5pb191OGtndnVh
> > aGprYm9oMWduZmh2NXRzMnY5Y0Bn=America/Los_Angeles>
> >  | Join the meeting 
> >
> > --
> > Greg Chase
> >
> > Global Head, Big Data Communities
> > http://www.pivotal.io/big-data
> >
> > Pivotal Software
> > http://www.pivotal.io/
> >
> > 650-215-0477
> > @GregChase
> > Blog: http://geekmarketing.biz/
> >
>



-- 
Greg Chase

Global Head, Big Data Communities
http://www.pivotal.io/big-data

Pivotal Software
http://www.pivotal.io/

650-215-0477
@GregChase
Blog: http://geekmarketing.biz/


Re: [VIRTUAL] Geode Clubhouse Thurs, November 10 9AM Pacific - Best Practices for Testing Geode, or any Java Open Source Project

2016-11-07 Thread Dave Barnes
Thanks for organizing these sessions, Greg. Please check the date -
Thursday is the 10th, Friday is the 11th.

On Mon, Nov 7, 2016 at 3:22 PM, Gregory Chase  wrote:

> Dear Geode Community,
>
> Its been a while since we've had a contributor's topic.  We have a great
> discussion planned for this Thursday, November 11, at 9AM Pacific: "*Best
> Practices for Testing Geode, or any Java open source project*."
>
> Add to calendar
>  cXRpNm45cXFhdjRmY2d2dDNlNHVlYnZqY3MgcGl2b3RhbC5pb191OGtndnVh
> aGprYm9oMWduZmh2NXRzMnY5Y0Bn=America/Los_Angeles>
> | Join the meeting 
>
> Kirk Lund, Committer for Apache Geode, will discuss the following:
>
> Unit testing -  how contributors and committers should be testing new code
> to be added to Apache Geode.
> Integration testing - the testing framework that runs for automatic builds
> Distributed testing - Geode-specific testing built upon JUnit, known as
> DUnit
>
> Lastly Kirk would like to talk about a possible future for DUnit to allow
> Geode users to test their scale-out applications based on Geode.
>
> *About the speaker*
> Kirk Lund is a software engineer with more than two decades experience
> developing and testing highly concurrent, distributed enterprise software.
> Kirk has been working with the Apache Geode and GemFire technology for well
> over a decade.
>
> See you this coming Thursday!
>
> Add to calendar
>  cXRpNm45cXFhdjRmY2d2dDNlNHVlYnZqY3MgcGl2b3RhbC5pb191OGtndnVh
> aGprYm9oMWduZmh2NXRzMnY5Y0Bn=America/Los_Angeles>
>  | Join the meeting 
>
> --
> Greg Chase
>
> Global Head, Big Data Communities
> http://www.pivotal.io/big-data
>
> Pivotal Software
> http://www.pivotal.io/
>
> 650-215-0477
> @GregChase
> Blog: http://geekmarketing.biz/
>


[VIRTUAL] Geode Clubhouse Thurs, November 10 9AM Pacific - Best Practices for Testing Geode, or any Java Open Source Project

2016-11-07 Thread Gregory Chase
Dear Geode Community,

Its been a while since we've had a contributor's topic.  We have a great
discussion planned for this Thursday, November 11, at 9AM Pacific: "*Best
Practices for Testing Geode, or any Java open source project*."

Add to calendar

| Join the meeting 

Kirk Lund, Committer for Apache Geode, will discuss the following:

Unit testing -  how contributors and committers should be testing new code
to be added to Apache Geode.
Integration testing - the testing framework that runs for automatic builds
Distributed testing - Geode-specific testing built upon JUnit, known as
DUnit

Lastly Kirk would like to talk about a possible future for DUnit to allow
Geode users to test their scale-out applications based on Geode.

*About the speaker*
Kirk Lund is a software engineer with more than two decades experience
developing and testing highly concurrent, distributed enterprise software.
Kirk has been working with the Apache Geode and GemFire technology for well
over a decade.

See you this coming Thursday!

Add to calendar

 | Join the meeting 

-- 
Greg Chase

Global Head, Big Data Communities
http://www.pivotal.io/big-data

Pivotal Software
http://www.pivotal.io/

650-215-0477
@GregChase
Blog: http://geekmarketing.biz/


[GitHub] incubator-geode pull request #280: GEODE-1740: Potential region inconsistenc...

2016-11-07 Thread gemzdude
GitHub user gemzdude opened a pull request:

https://github.com/apache/incubator-geode/pull/280

GEODE-1740: Potential region inconsistency with concurrent clear during 
commit processing

It was observed that region operations performed within a transaction were 
not
 * acquiring region modification locks during commit processing. This lock 
is used to ensure region
 * consistency during CLEAR processing.
 * 
 * The fix for GEODE-1740 was to acquire cache modification locks for 
regions involved during commit
 * processing. A read lock is taken for each region involved thus allowing 
concurrent region
 * operations while preventing CLEAR from being able to acquire the write 
lock and thus waiting
 * until transaction processing is complete.

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

$ git pull https://github.com/gemzdude/incubator-geode feature/GEODE-1740

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

https://github.com/apache/incubator-geode/pull/280.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 #280


commit 0cdcf254ae1238a52d3c07f25c9fa0da27e55e1e
Author: Scott Jewell 
Date:   2016-11-02T22:59:35Z

GEODE-1740: Correct potential region inconsistencies with concurrent clear 
and transaction commit

commit d93a3b4ebbb98786abb049f58417e9e7f66fc01e
Author: Scott Jewell 
Date:   2016-11-07T22:04:54Z

Merge branch 'develop' of github.com:apache/incubator-geode into 
feature/GEODE-1740

commit 1bf75fd0fed913d0e1d1b0424bdbc3ec26dde53e
Author: Scott Jewell 
Date:   2016-11-07T22:49:44Z

GEODE-1740: Potential region inconsistency with concurrent region operation 
during transaction commit processing




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Re: Review Request 53442: GEODE-1740: Correct potential region inconsistencies with concurrent clear and transaction commit

2016-11-07 Thread anilkumar gingade

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53442/#review155212
---




geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java (line 514)


What if one of the region is destroyed while iterating over the regions? 
Can we still operate on version vector (in lockRegionForAtomicTX())...Do we 
need to have some error handlling code?


- anilkumar gingade


On Nov. 3, 2016, 11:08 p.m., Scott Jewell wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53442/
> ---
> 
> (Updated Nov. 3, 2016, 11:08 p.m.)
> 
> 
> Review request for geode, Darrel Schneider and Eric Shu.
> 
> 
> Bugs: GEODE-1740
> https://issues.apache.org/jira/browse/GEODE-1740
> 
> 
> Repository: geode
> 
> 
> Description
> ---
> 
> GEODE-1740: Correct potential region inconsistencies with concurrent clear 
> and transaction commit
> 
> 
> Diffs
> -
> 
>   
> geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
>  de05b0d3991254834da94ed97ada9c9247aa69ab 
>   geode-core/src/main/java/org/apache/geode/internal/cache/RegionMap.java 
> ee8a84e57b5b72cc801cd2474a51dfd0bd3083f3 
>   geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java 
> 99a3b83d931dccd0faec482e42cda7ded18a13e7 
>   
> geode-core/src/test/java/org/apache/geode/internal/cache/ClearTXLockingDUnitTest.java
>  PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/53442/diff/
> 
> 
> Testing
> ---
> 
> New unit test ClearTXLockingDUnitTest
> 
> precheckin
> 
> 
> Thanks,
> 
> Scott Jewell
> 
>



Re: Review Request 53557: GEODE-2080 Rest POST put call not working with region valueConstrain

2016-11-07 Thread Hitesh Khamesra

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53557/#review155210
---


Ship it!




Ship It!

- Hitesh Khamesra


On Nov. 7, 2016, 10:13 p.m., Bruce Schuchardt wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53557/
> ---
> 
> (Updated Nov. 7, 2016, 10:13 p.m.)
> 
> 
> Review request for geode, Barry Oglesby, Hitesh Khamesra, and Udo Kohlmeyer.
> 
> 
> Bugs: GEODE-2080
> https://issues.apache.org/jira/browse/GEODE-2080
> 
> 
> Repository: geode
> 
> 
> Description
> ---
> 
> If you set a value constraint on a cache Region you will be unable to store 
> objects in the region via the Rest API.  This change-set modifies 
> LocalRegion's constraint check to look for a Rest document and use its type 
> name in the constraint check
> 
> 
> Diffs
> -
> 
>   geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java 
> 3873e6e159ebba4c1a288e9fccde5dbabd2a1140 
>   geode-core/src/test/java/org/apache/geode/pdx/PdxClientServerDUnitTest.java 
> 9a9680a7e14ddec91f005fa0f0c6c3da8d033df2 
> 
> Diff: https://reviews.apache.org/r/53557/diff/
> 
> 
> Testing
> ---
> 
> new test, precheckin
> 
> 
> Thanks,
> 
> Bruce Schuchardt
> 
>



Review Request 53557: GEODE-2080 Rest POST put call not working with region valueConstrain

2016-11-07 Thread Bruce Schuchardt

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53557/
---

Review request for geode, Barry Oglesby, Hitesh Khamesra, and Udo Kohlmeyer.


Bugs: GEODE-2080
https://issues.apache.org/jira/browse/GEODE-2080


Repository: geode


Description
---

If you set a value constraint on a cache Region you will be unable to store 
objects in the region via the Rest API.  This change-set modifies LocalRegion's 
constraint check to look for a Rest document and use its type name in the 
constraint check


Diffs
-

  geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java 
3873e6e159ebba4c1a288e9fccde5dbabd2a1140 
  geode-core/src/test/java/org/apache/geode/pdx/PdxClientServerDUnitTest.java 
9a9680a7e14ddec91f005fa0f0c6c3da8d033df2 

Diff: https://reviews.apache.org/r/53557/diff/


Testing
---

new test, precheckin


Thanks,

Bruce Schuchardt



Re: Review Request 53503: GEODE-2077: throw appropriate exceptions when get call in transactions failed with certain exceptions.

2016-11-07 Thread Darrel Schneider

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53503/#review155205
---


Ship it!




Ship It!

- Darrel Schneider


On Nov. 7, 2016, 1:53 p.m., Eric Shu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53503/
> ---
> 
> (Updated Nov. 7, 2016, 1:53 p.m.)
> 
> 
> Review request for geode, anilkumar gingade and Darrel Schneider.
> 
> 
> Repository: geode
> 
> 
> Description
> ---
> 
> Throws TransactionDataRebalancedException when get call on a key in a bucket 
> that has been moved.
> 
> 
> Diffs
> -
> 
>   
> geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
>  8f67e25 
>   geode-core/src/test/java/org/apache/geode/disttx/PRDistTXDUnitTest.java 
> 024776a 
>   
> geode-core/src/test/java/org/apache/geode/disttx/PRDistTXWithVersionsDUnitTest.java
>  aefb581 
>   
> geode-core/src/test/java/org/apache/geode/internal/cache/execute/PRColocationDUnitTest.java
>  bedb1d4 
>   
> geode-core/src/test/java/org/apache/geode/internal/cache/execute/PRTransactionDUnitTest.java
>  37ea4e5 
> 
> Diff: https://reviews.apache.org/r/53503/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Eric Shu
> 
>



Re: Review Request 53442: GEODE-1740: Correct potential region inconsistencies with concurrent clear and transaction commit

2016-11-07 Thread Darrel Schneider

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53442/#review155204
---


Ship it!




Ship It!

- Darrel Schneider


On Nov. 3, 2016, 4:08 p.m., Scott Jewell wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53442/
> ---
> 
> (Updated Nov. 3, 2016, 4:08 p.m.)
> 
> 
> Review request for geode, Darrel Schneider and Eric Shu.
> 
> 
> Bugs: GEODE-1740
> https://issues.apache.org/jira/browse/GEODE-1740
> 
> 
> Repository: geode
> 
> 
> Description
> ---
> 
> GEODE-1740: Correct potential region inconsistencies with concurrent clear 
> and transaction commit
> 
> 
> Diffs
> -
> 
>   
> geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
>  de05b0d3991254834da94ed97ada9c9247aa69ab 
>   geode-core/src/main/java/org/apache/geode/internal/cache/RegionMap.java 
> ee8a84e57b5b72cc801cd2474a51dfd0bd3083f3 
>   geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java 
> 99a3b83d931dccd0faec482e42cda7ded18a13e7 
>   
> geode-core/src/test/java/org/apache/geode/internal/cache/ClearTXLockingDUnitTest.java
>  PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/53442/diff/
> 
> 
> Testing
> ---
> 
> New unit test ClearTXLockingDUnitTest
> 
> precheckin
> 
> 
> Thanks,
> 
> Scott Jewell
> 
>



Re: Review Request 53503: GEODE-2077: throw appropriate exceptions when get call in transactions failed with certain exceptions.

2016-11-07 Thread Eric Shu

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53503/
---

(Updated Nov. 7, 2016, 9:53 p.m.)


Review request for geode, anilkumar gingade and Darrel Schneider.


Changes
---

Fix review comments.


Repository: geode


Description
---

Throws TransactionDataRebalancedException when get call on a key in a bucket 
that has been moved.


Diffs (updated)
-

  
geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java 
8f67e25 
  geode-core/src/test/java/org/apache/geode/disttx/PRDistTXDUnitTest.java 
024776a 
  
geode-core/src/test/java/org/apache/geode/disttx/PRDistTXWithVersionsDUnitTest.java
 aefb581 
  
geode-core/src/test/java/org/apache/geode/internal/cache/execute/PRColocationDUnitTest.java
 bedb1d4 
  
geode-core/src/test/java/org/apache/geode/internal/cache/execute/PRTransactionDUnitTest.java
 37ea4e5 

Diff: https://reviews.apache.org/r/53503/diff/


Testing
---


Thanks,

Eric Shu



Re: Review Request 53553: GEODE-2082: fix flakiness in sameKeepsOneFile

2016-11-07 Thread Darrel Schneider

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53553/#review155203
---


Ship it!




Ship It!

- Darrel Schneider


On Nov. 7, 2016, 11:25 a.m., Kirk Lund wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53553/
> ---
> 
> (Updated Nov. 7, 2016, 11:25 a.m.)
> 
> 
> Review request for geode, Darrel Schneider, Jinmei Liao, and Kevin Duling.
> 
> 
> Bugs: GEODE-2082
> https://issues.apache.org/jira/browse/GEODE-2082
> 
> 
> Repository: geode
> 
> 
> Description
> ---
> 
> * rename sameKeepsOneFile to aboveZeroKeepsAtLeastOneFile
> * change test to be more flexible due to differences in file systems
> 
> 
> Diffs
> -
> 
>   
> geode-core/src/test/java/org/apache/geode/internal/statistics/DiskSpaceLimitIntegrationTest.java
>  2381a538e310467e97ae37003f04f22b149c367e 
> 
> Diff: https://reviews.apache.org/r/53553/diff/
> 
> 
> Testing
> ---
> 
> DiskSpaceLimitIntegrationTest
> 
> 
> Thanks,
> 
> Kirk Lund
> 
>



Re: Tweaking the IntelliJ and Eclipse formatters

2016-11-07 Thread Kirk Lund
FYI, I haven't had any time to work on this further and probably won't have
time this week. Looks like there's a newer, more active thread on this
anyway.

Thanks,
Kirk


On Thu, Oct 27, 2016 at 6:02 PM, Kenneth Howe  wrote:

> 1) +1 - How long were you proposing Kirk? I’d suggest something like
> 120-130. Regardless of the length chosen we could end up with anomaly
> Darrel pointed out with a comment at the end of a long line. In these cases
> it’s probably better to put the comment on a separate line.
> 2) +1
> 3) +1
> 4) +1
>
>
> > On Oct 27, 2016, at 3:37 PM, Darrel Schneider 
> wrote:
> >
> > something I noticed that may have been caused by the reformatting was an
> > end of line comment that ended up with one word on every line. A longer
> max
> > line probably would have prevented this but now that everything has been
> > reformatted with a max of 100 I doubt that it would combine comments like
> > this back to a single line.
> >
> > line 1708 of GMSMembershipManager has an end of line comment
> > that ends up with a single word on each line like so:
> >  List members =
> > (List) ex.getMembers(); // We
> >
> >   // need
> >
> >   // to
> >
> >   // return
> >
> >   // this
> >
> >   // list
> >
> >   // of
> >
> >   // failures
> >
> >
> > On Thu, Oct 27, 2016 at 3:27 PM, Udo Kohlmeyer 
> > wrote:
> >
> >> 1) 0
> >> 2) +1
> >> 3) +1
> >> 4) 0
> >>
> >>
> >> On 27/10/16 3:11 pm, Kirk Lund wrote:
> >>
> >>> I'd like to propose making a few changes to our IntelliJ and Eclipse
> >>> formatters as well as the Eclipse importorder (all in etc/):
> >>>
> >>> 1) increase max line length (100 is way too short)
> >>> 2) make (hopefully minor) changes to make the two formatters more
> >>> consistent with each other
> >>> 3) change Eclipse importorder to follow the google style as closely as
> >>> possible
> >>> 4) update the import ordering in IntelliJ formatter to match Eclipse
> >>>
> >>> The goal is to make both formatters produce the exact same results
> >>> including ordering of imports while maintaining them to be as close to
> the
> >>> google style as possible. Right now if you run IntelliJ formatter, the
> >>> result will fail the spotlessCheck. We may have to make some small
> >>> compromises in our adherence to the google style but I think that's
> >>> reasonable in order to get the formatters both working consistently.
> >>>
> >>> The gradle spotless tasks currently use the Eclipse formatter. One
> further
> >>> change would be to add the Eclipse importorder file for spotless to
> use.
> >>>
> >>> -Kirk
> >>>
> >>>
> >>
>


Re: Build failed in Jenkins: Geode-nightly #646

2016-11-07 Thread Kirk Lund
I posted review https://reviews.apache.org/r/53553/ to fix flakiness
in DiskSpaceLimitIntegrationTest.

-Kirk


On Mon, Nov 7, 2016 at 7:57 AM, Jinmei Liao  wrote:

> I will take care of this.
>
> On Mon, Nov 7, 2016 at 7:42 AM, Apache Jenkins Server <
> jenk...@builds.apache.org> wrote:
>
> > See 
> >
> > --
> > [...truncated 526 lines...]
> > :geode-cq:check
> > :geode-cq:build
> > :geode-cq:distributedTest
> > :geode-cq:flakyTest
> > :geode-cq:integrationTest
> > :geode-json:assemble
> > :geode-json:compileTestJava UP-TO-DATE
> > :geode-json:processTestResources UP-TO-DATE
> > :geode-json:testClasses UP-TO-DATE
> > :geode-json:checkMissedTests UP-TO-DATE
> > :geode-json:spotlessJavaCheck
> > :geode-json:spotlessCheck
> > :geode-json:test UP-TO-DATE
> > :geode-json:check
> > :geode-json:build
> > :geode-json:distributedTest UP-TO-DATE
> > :geode-json:flakyTest UP-TO-DATE
> > :geode-json:integrationTest UP-TO-DATE
> > :geode-junit:javadoc
> > :geode-junit:javadocJar
> > :geode-junit:sourcesJar
> > :geode-junit:signArchives SKIPPED
> > :geode-junit:assemble
> > :geode-junit:compileTestJava
> > :geode-junit:processTestResources UP-TO-DATE
> > :geode-junit:testClasses
> > :geode-junit:checkMissedTests
> > :geode-junit:spotlessJavaCheck
> > :geode-junit:spotlessCheck
> > :geode-junit:test
> > :geode-junit:check
> > :geode-junit:build
> > :geode-junit:distributedTest
> > :geode-junit:flakyTest
> > :geode-junit:integrationTest
> > :geode-lucene:assemble
> > :geode-lucene:compileTestJavaNote: Some input files use or override a
> > deprecated API.
> > Note: Recompile with -Xlint:deprecation for details.
> > Note: Some input files use unchecked or unsafe operations.
> > Note: Recompile with -Xlint:unchecked for details.
> >
> > :geode-lucene:processTestResources
> > :geode-lucene:testClasses
> > :geode-lucene:checkMissedTests
> > :geode-lucene:spotlessJavaCheck
> > :geode-lucene:spotlessCheck
> > :geode-lucene:test
> > :geode-lucene:check
> > :geode-lucene:build
> > :geode-lucene:distributedTest
> > :geode-lucene:flakyTest
> > :geode-lucene:integrationTest
> > :geode-old-client-support:assemble
> > :geode-old-client-support:compileTestJava
> > :geode-old-client-support:processTestResources UP-TO-DATE
> > :geode-old-client-support:testClasses
> > :geode-old-client-support:checkMissedTests
> > :geode-old-client-support:spotlessJavaCheck
> > :geode-old-client-support:spotlessCheck
> > :geode-old-client-support:test
> > :geode-old-client-support:check
> > :geode-old-client-support:build
> > :geode-old-client-support:distributedTest
> > :geode-old-client-support:flakyTest
> > :geode-old-client-support:integrationTest
> > :geode-pulse:assemble
> > :geode-pulse:compileTestJavaNote:  > job/Geode-nightly/ws/geode-pulse/src/test/java/org/
> > apache/geode/tools/pulse/tests/ui/PulseAbstractTest.java> uses or
> > overrides a deprecated API.
> > Note: Recompile with -Xlint:deprecation for details.
> > Note: Some input files use unchecked or unsafe operations.
> > Note: Recompile with -Xlint:unchecked for details.
> >
> > :geode-pulse:processTestResources
> > :geode-pulse:testClasses
> > :geode-pulse:checkMissedTests
> > :geode-pulse:spotlessJavaCheck
> > :geode-pulse:spotlessCheck
> > :geode-pulse:test
> > :geode-pulse:check
> > :geode-pulse:build
> > :geode-pulse:distributedTest
> > :geode-pulse:flakyTest
> > :geode-pulse:integrationTest
> > :geode-rebalancer:assemble
> > :geode-rebalancer:compileTestJava
> > :geode-rebalancer:processTestResources UP-TO-DATE
> > :geode-rebalancer:testClasses
> > :geode-rebalancer:checkMissedTests
> > :geode-rebalancer:spotlessJavaCheck
> > :geode-rebalancer:spotlessCheck
> > :geode-rebalancer:test
> > :geode-rebalancer:check
> > :geode-rebalancer:build
> > :geode-rebalancer:distributedTest
> > :geode-rebalancer:flakyTest
> > :geode-rebalancer:integrationTest
> > :geode-wan:assemble
> > :geode-wan:compileTestJavaNote: Some input files use or override a
> > deprecated API.
> > Note: Recompile with -Xlint:deprecation for details.
> > Note: Some input files use unchecked or unsafe operations.
> > Note: Recompile with -Xlint:unchecked for details.
> >
> > :geode-wan:processTestResources
> > :geode-wan:testClasses
> > :geode-wan:checkMissedTests
> > :geode-wan:spotlessJavaCheck
> > :geode-wan:spotlessCheck
> > :geode-wan:test
> > :geode-wan:check
> > :geode-wan:build
> > :geode-wan:distributedTest
> > :geode-wan:flakyTest
> > :geode-wan:integrationTest
> > :geode-web:assemble
> > :geode-web:compileTestJavaNote: Some input files use or override a
> > deprecated API.
> > Note: Recompile with -Xlint:deprecation for details.
> > Note: Some input files use unchecked or unsafe operations.
> > Note: Recompile with -Xlint:unchecked for details.
> >
> > :geode-web:processTestResources UP-TO-DATE
> > :geode-web:testClasses
> > :geode-web:checkMissedTests
> > 

Re: Review Request 53503: GEODE-2077: throw appropriate exceptions when get call in transactions failed with certain exceptions.

2016-11-07 Thread Eric Shu

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53503/
---

(Updated Nov. 7, 2016, 8:19 p.m.)


Review request for geode, anilkumar gingade and Darrel Schneider.


Changes
---

Fix review comments.


Repository: geode


Description
---

Throws TransactionDataRebalancedException when get call on a key in a bucket 
that has been moved.


Diffs (updated)
-

  
geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java 
8f67e25 
  
geode-core/src/main/java/org/apache/geode/internal/cache/TXStateProxyImpl.java 
a89cdc4 
  geode-core/src/test/java/org/apache/geode/disttx/PRDistTXDUnitTest.java 
024776a 
  
geode-core/src/test/java/org/apache/geode/disttx/PRDistTXWithVersionsDUnitTest.java
 aefb581 
  
geode-core/src/test/java/org/apache/geode/internal/cache/execute/PRColocationDUnitTest.java
 bedb1d4 
  
geode-core/src/test/java/org/apache/geode/internal/cache/execute/PRTransactionDUnitTest.java
 37ea4e5 

Diff: https://reviews.apache.org/r/53503/diff/


Testing
---


Thanks,

Eric Shu



[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread kjduling
Github user kjduling commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86852018
  
--- Diff: 
geode-assembly/src/test/java/org/apache/geode/rest/internal/web/RestSecurityPostProcessorTest.java
 ---
@@ -0,0 +1,185 @@
+/*
+ * 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.geode.rest.internal.web;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_BIND_ADDRESS;
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_PORT;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_POST_PROCESSOR;
+import static 
org.apache.geode.distributed.ConfigurationProperties.START_DEV_REST_API;
+import static org.apache.geode.rest.internal.web.GeodeRestClient.getCode;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getContentType;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonArray;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonObject;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.execute.FunctionService;
+import org.apache.geode.internal.AvailablePortHelper;
+import org.apache.geode.rest.internal.web.controllers.GetRegions;
+import org.apache.geode.security.templates.SamplePostProcessor;
+import org.apache.geode.security.templates.SampleSecurityManager;
+import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+import org.apache.geode.test.junit.categories.SecurityTest;
+import org.apache.http.HttpResponse;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.springframework.http.MediaType;
+
+import java.net.URLEncoder;
+import java.util.Properties;
+
+
+@Category({IntegrationTest.class, SecurityTest.class})
+public class RestSecurityPostProcessorTest {
+
+  static final String REGION_NAME = "AuthRegion";
+
+  static int restPort = AvailablePortHelper.getRandomAvailableTCPPort();
+  static Properties properties = new Properties() {
+{
+  setProperty(SampleSecurityManager.SECURITY_JSON,
+  
"org/apache/geode/management/internal/security/clientServer.json");
+  setProperty(SECURITY_MANAGER, SampleSecurityManager.class.getName());
+  setProperty(START_DEV_REST_API, "true");
+  setProperty(HTTP_SERVICE_BIND_ADDRESS, "localhost");
+  setProperty(HTTP_SERVICE_PORT, restPort + "");
+  setProperty(SECURITY_POST_PROCESSOR, 
SamplePostProcessor.class.getName());
+}
+  };
+
+  @ClassRule
+  public static ServerStarterRule serverStarter = new 
ServerStarterRule(properties);
+  private final GeodeRestClient restClient = new 
GeodeRestClient("localhost", restPort);
+
+  @BeforeClass
+  public static void before() throws Exception {
+serverStarter.startServer();
+Region region =
+
serverStarter.cache.createRegionFactory(RegionShortcut.REPLICATE).create(REGION_NAME);
+region.put("key1",
+
"{\"@type\":\"com.gemstone.gemfire.web.rest.domain.Order\",\"purchaseOrderNo\":1121,\"customerId\":1012,\"description\":\"Order
 for  XYZ 
Corp\",\"orderDate\":\"02/10/2014\",\"deliveryDate\":\"02/20/2014\",\"contact\":\"Jelly
 
Bean\",\"email\":\"jelly.b...@example.com\",\"phone\":\"01-2048096\",\"items\":[{\"itemNo\":1,\"description\":\"Product-100\",\"quantity\":12,\"unitPrice\":5,\"totalPrice\":60}],\"totalPrice\":225}");
+region.put("key2", "bar");
+

[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread kjduling
Github user kjduling commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86852092
  
--- Diff: 
geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/BaseControllerAdvice.java
 ---
@@ -50,6 +52,11 @@
 
   protected static final String REST_API_VERSION = "/v1";
 
+  public BaseControllerAdvice(final RestSecurityService securityService,
--- End diff --

BaseControllerAdvice extends AbstractBaseController.  Since the 
RestSecurityService lives in AbstractBaseController, yes.  Otherwise, we define 
separate member variables in PdxBasedCrudController, CommonCrudController, and 
QueryAccessContoller.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Review Request 53553: GEODE-2082: fix flakiness in sameKeepsOneFile

2016-11-07 Thread Kirk Lund

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53553/
---

Review request for geode, Darrel Schneider, Jinmei Liao, and Kevin Duling.


Bugs: GEODE-2082
https://issues.apache.org/jira/browse/GEODE-2082


Repository: geode


Description
---

* rename sameKeepsOneFile to aboveZeroKeepsAtLeastOneFile
* change test to be more flexible due to differences in file systems


Diffs
-

  
geode-core/src/test/java/org/apache/geode/internal/statistics/DiskSpaceLimitIntegrationTest.java
 2381a538e310467e97ae37003f04f22b149c367e 

Diff: https://reviews.apache.org/r/53553/diff/


Testing
---

DiskSpaceLimitIntegrationTest


Thanks,

Kirk Lund



[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread kjduling
Github user kjduling commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86848834
  
--- Diff: 
geode-assembly/src/test/java/org/apache/geode/rest/internal/web/RestSecurityPostProcessorTest.java
 ---
@@ -0,0 +1,185 @@
+/*
+ * 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.geode.rest.internal.web;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_BIND_ADDRESS;
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_PORT;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_POST_PROCESSOR;
+import static 
org.apache.geode.distributed.ConfigurationProperties.START_DEV_REST_API;
+import static org.apache.geode.rest.internal.web.GeodeRestClient.getCode;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getContentType;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonArray;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonObject;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.execute.FunctionService;
+import org.apache.geode.internal.AvailablePortHelper;
+import org.apache.geode.rest.internal.web.controllers.GetRegions;
+import org.apache.geode.security.templates.SamplePostProcessor;
+import org.apache.geode.security.templates.SampleSecurityManager;
+import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+import org.apache.geode.test.junit.categories.SecurityTest;
+import org.apache.http.HttpResponse;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.springframework.http.MediaType;
+
+import java.net.URLEncoder;
+import java.util.Properties;
+
+
+@Category({IntegrationTest.class, SecurityTest.class})
+public class RestSecurityPostProcessorTest {
+
+  static final String REGION_NAME = "AuthRegion";
+
+  static int restPort = AvailablePortHelper.getRandomAvailableTCPPort();
+  static Properties properties = new Properties() {
+{
+  setProperty(SampleSecurityManager.SECURITY_JSON,
+  
"org/apache/geode/management/internal/security/clientServer.json");
+  setProperty(SECURITY_MANAGER, SampleSecurityManager.class.getName());
+  setProperty(START_DEV_REST_API, "true");
+  setProperty(HTTP_SERVICE_BIND_ADDRESS, "localhost");
+  setProperty(HTTP_SERVICE_PORT, restPort + "");
+  setProperty(SECURITY_POST_PROCESSOR, 
SamplePostProcessor.class.getName());
+}
+  };
+
+  @ClassRule
+  public static ServerStarterRule serverStarter = new 
ServerStarterRule(properties);
+  private final GeodeRestClient restClient = new 
GeodeRestClient("localhost", restPort);
+
+  @BeforeClass
+  public static void before() throws Exception {
+serverStarter.startServer();
+Region region =
+
serverStarter.cache.createRegionFactory(RegionShortcut.REPLICATE).create(REGION_NAME);
+region.put("key1",
+
"{\"@type\":\"com.gemstone.gemfire.web.rest.domain.Order\",\"purchaseOrderNo\":1121,\"customerId\":1012,\"description\":\"Order
 for  XYZ 
Corp\",\"orderDate\":\"02/10/2014\",\"deliveryDate\":\"02/20/2014\",\"contact\":\"Jelly
 
Bean\",\"email\":\"jelly.b...@example.com\",\"phone\":\"01-2048096\",\"items\":[{\"itemNo\":1,\"description\":\"Product-100\",\"quantity\":12,\"unitPrice\":5,\"totalPrice\":60}],\"totalPrice\":225}");
+region.put("key2", "bar");
+

[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread kjduling
Github user kjduling commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86847492
  
--- Diff: 
geode-assembly/src/test/java/org/apache/geode/rest/internal/web/RestSecurityPostProcessorTest.java
 ---
@@ -0,0 +1,185 @@
+/*
+ * 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.geode.rest.internal.web;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_BIND_ADDRESS;
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_PORT;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_POST_PROCESSOR;
+import static 
org.apache.geode.distributed.ConfigurationProperties.START_DEV_REST_API;
+import static org.apache.geode.rest.internal.web.GeodeRestClient.getCode;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getContentType;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonArray;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonObject;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.execute.FunctionService;
+import org.apache.geode.internal.AvailablePortHelper;
+import org.apache.geode.rest.internal.web.controllers.GetRegions;
+import org.apache.geode.security.templates.SamplePostProcessor;
+import org.apache.geode.security.templates.SampleSecurityManager;
+import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+import org.apache.geode.test.junit.categories.SecurityTest;
+import org.apache.http.HttpResponse;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.springframework.http.MediaType;
+
+import java.net.URLEncoder;
+import java.util.Properties;
+
+
+@Category({IntegrationTest.class, SecurityTest.class})
+public class RestSecurityPostProcessorTest {
+
+  static final String REGION_NAME = "AuthRegion";
+
+  static int restPort = AvailablePortHelper.getRandomAvailableTCPPort();
+  static Properties properties = new Properties() {
+{
+  setProperty(SampleSecurityManager.SECURITY_JSON,
+  
"org/apache/geode/management/internal/security/clientServer.json");
+  setProperty(SECURITY_MANAGER, SampleSecurityManager.class.getName());
+  setProperty(START_DEV_REST_API, "true");
+  setProperty(HTTP_SERVICE_BIND_ADDRESS, "localhost");
+  setProperty(HTTP_SERVICE_PORT, restPort + "");
+  setProperty(SECURITY_POST_PROCESSOR, 
SamplePostProcessor.class.getName());
+}
+  };
+
+  @ClassRule
+  public static ServerStarterRule serverStarter = new 
ServerStarterRule(properties);
+  private final GeodeRestClient restClient = new 
GeodeRestClient("localhost", restPort);
+
+  @BeforeClass
+  public static void before() throws Exception {
+serverStarter.startServer();
+Region region =
+
serverStarter.cache.createRegionFactory(RegionShortcut.REPLICATE).create(REGION_NAME);
+region.put("key1",
+
"{\"@type\":\"com.gemstone.gemfire.web.rest.domain.Order\",\"purchaseOrderNo\":1121,\"customerId\":1012,\"description\":\"Order
 for  XYZ 
Corp\",\"orderDate\":\"02/10/2014\",\"deliveryDate\":\"02/20/2014\",\"contact\":\"Jelly
 
Bean\",\"email\":\"jelly.b...@example.com\",\"phone\":\"01-2048096\",\"items\":[{\"itemNo\":1,\"description\":\"Product-100\",\"quantity\":12,\"unitPrice\":5,\"totalPrice\":60}],\"totalPrice\":225}");
--- End diff --

True.  The tests don't use the 

[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86836374
  
--- Diff: 
geode-core/src/main/java/org/apache/geode/internal/security/IntegratedSecurityService.java
 ---
@@ -409,6 +435,34 @@ public Object postProcess(Object principal, String 
regionPath, Object key, Objec
 return newValue;
   }
 
+  private Object getPrincipal(Object principal) {
+if (principal == null) {
+  Subject subject = getSubject();
+  if (subject == null)
+return null;
+  principal = subject.getPrincipal();
+}
+return principal;
+  }
+
+  @Override
+  public Collection postProcess(Query query, Collection 
regionNames,
--- End diff --

remove this.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86819415
  
--- Diff: 
geode-assembly/src/test/java/org/apache/geode/rest/internal/web/RestSecurityPostProcessorTest.java
 ---
@@ -0,0 +1,185 @@
+/*
+ * 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.geode.rest.internal.web;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_BIND_ADDRESS;
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_PORT;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_POST_PROCESSOR;
+import static 
org.apache.geode.distributed.ConfigurationProperties.START_DEV_REST_API;
+import static org.apache.geode.rest.internal.web.GeodeRestClient.getCode;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getContentType;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonArray;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonObject;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.execute.FunctionService;
+import org.apache.geode.internal.AvailablePortHelper;
+import org.apache.geode.rest.internal.web.controllers.GetRegions;
+import org.apache.geode.security.templates.SamplePostProcessor;
+import org.apache.geode.security.templates.SampleSecurityManager;
+import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+import org.apache.geode.test.junit.categories.SecurityTest;
+import org.apache.http.HttpResponse;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.springframework.http.MediaType;
+
+import java.net.URLEncoder;
+import java.util.Properties;
+
+
+@Category({IntegrationTest.class, SecurityTest.class})
+public class RestSecurityPostProcessorTest {
+
+  static final String REGION_NAME = "AuthRegion";
+
+  static int restPort = AvailablePortHelper.getRandomAvailableTCPPort();
+  static Properties properties = new Properties() {
+{
+  setProperty(SampleSecurityManager.SECURITY_JSON,
+  
"org/apache/geode/management/internal/security/clientServer.json");
+  setProperty(SECURITY_MANAGER, SampleSecurityManager.class.getName());
+  setProperty(START_DEV_REST_API, "true");
+  setProperty(HTTP_SERVICE_BIND_ADDRESS, "localhost");
+  setProperty(HTTP_SERVICE_PORT, restPort + "");
+  setProperty(SECURITY_POST_PROCESSOR, 
SamplePostProcessor.class.getName());
+}
+  };
+
+  @ClassRule
+  public static ServerStarterRule serverStarter = new 
ServerStarterRule(properties);
+  private final GeodeRestClient restClient = new 
GeodeRestClient("localhost", restPort);
+
+  @BeforeClass
+  public static void before() throws Exception {
+serverStarter.startServer();
+Region region =
+
serverStarter.cache.createRegionFactory(RegionShortcut.REPLICATE).create(REGION_NAME);
+region.put("key1",
+
"{\"@type\":\"com.gemstone.gemfire.web.rest.domain.Order\",\"purchaseOrderNo\":1121,\"customerId\":1012,\"description\":\"Order
 for  XYZ 
Corp\",\"orderDate\":\"02/10/2014\",\"deliveryDate\":\"02/20/2014\",\"contact\":\"Jelly
 
Bean\",\"email\":\"jelly.b...@example.com\",\"phone\":\"01-2048096\",\"items\":[{\"itemNo\":1,\"description\":\"Product-100\",\"quantity\":12,\"unitPrice\":5,\"totalPrice\":60}],\"totalPrice\":225}");
--- End diff --

You could create an Order object 

[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86836201
  
--- Diff: 
geode-core/src/main/java/org/apache/geode/security/PostProcessor.java ---
@@ -44,6 +47,9 @@ default void init(Properties securityProps) {}
*/
   Object processRegionValue(Object principal, String regionName, Object 
key, Object value);
 
+  Collection processQueryResult(Object principal, Query query, 
Collection regions,
--- End diff --

I don't think we want to add this method in the interface. For query,  
essentially it's still getting value from region. Customers should not be 
burdened with another method to implement if they just want to manipulate the 
data. See how query result get post processed in gfsh queries. 


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86836263
  
--- Diff: 
geode-core/src/main/java/org/apache/geode/internal/security/SecurityService.java
 ---
@@ -87,6 +89,12 @@
   Object postProcess(Object principal, String regionPath, Object key, 
Object value,
   boolean valueIsSerialized);
 
+  Collection postProcess(Query query, Collection 
regionNames,
--- End diff --

remove this.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86821510
  
--- Diff: 
geode-assembly/src/test/java/org/apache/geode/rest/internal/web/RestSecurityPostProcessorTest.java
 ---
@@ -0,0 +1,185 @@
+/*
+ * 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.geode.rest.internal.web;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_BIND_ADDRESS;
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_PORT;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_POST_PROCESSOR;
+import static 
org.apache.geode.distributed.ConfigurationProperties.START_DEV_REST_API;
+import static org.apache.geode.rest.internal.web.GeodeRestClient.getCode;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getContentType;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonArray;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonObject;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.execute.FunctionService;
+import org.apache.geode.internal.AvailablePortHelper;
+import org.apache.geode.rest.internal.web.controllers.GetRegions;
+import org.apache.geode.security.templates.SamplePostProcessor;
+import org.apache.geode.security.templates.SampleSecurityManager;
+import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+import org.apache.geode.test.junit.categories.SecurityTest;
+import org.apache.http.HttpResponse;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.springframework.http.MediaType;
+
+import java.net.URLEncoder;
+import java.util.Properties;
+
+
+@Category({IntegrationTest.class, SecurityTest.class})
+public class RestSecurityPostProcessorTest {
+
+  static final String REGION_NAME = "AuthRegion";
+
+  static int restPort = AvailablePortHelper.getRandomAvailableTCPPort();
+  static Properties properties = new Properties() {
+{
+  setProperty(SampleSecurityManager.SECURITY_JSON,
+  
"org/apache/geode/management/internal/security/clientServer.json");
+  setProperty(SECURITY_MANAGER, SampleSecurityManager.class.getName());
+  setProperty(START_DEV_REST_API, "true");
+  setProperty(HTTP_SERVICE_BIND_ADDRESS, "localhost");
+  setProperty(HTTP_SERVICE_PORT, restPort + "");
+  setProperty(SECURITY_POST_PROCESSOR, 
SamplePostProcessor.class.getName());
+}
+  };
+
+  @ClassRule
+  public static ServerStarterRule serverStarter = new 
ServerStarterRule(properties);
+  private final GeodeRestClient restClient = new 
GeodeRestClient("localhost", restPort);
+
+  @BeforeClass
+  public static void before() throws Exception {
+serverStarter.startServer();
--- End diff --

I think I just made a change in the rule that you don't need to call 
startServer anymore if you are using is as a rule.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86836714
  
--- Diff: 
geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/BaseControllerAdvice.java
 ---
@@ -50,6 +52,11 @@
 
   protected static final String REST_API_VERSION = "/v1";
 
+  public BaseControllerAdvice(final RestSecurityService securityService,
--- End diff --

do we need this?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86820194
  
--- Diff: 
geode-assembly/src/test/java/org/apache/geode/rest/internal/web/RestSecurityPostProcessorTest.java
 ---
@@ -0,0 +1,185 @@
+/*
+ * 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.geode.rest.internal.web;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_BIND_ADDRESS;
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_PORT;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_POST_PROCESSOR;
+import static 
org.apache.geode.distributed.ConfigurationProperties.START_DEV_REST_API;
+import static org.apache.geode.rest.internal.web.GeodeRestClient.getCode;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getContentType;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonArray;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonObject;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.execute.FunctionService;
+import org.apache.geode.internal.AvailablePortHelper;
+import org.apache.geode.rest.internal.web.controllers.GetRegions;
+import org.apache.geode.security.templates.SamplePostProcessor;
+import org.apache.geode.security.templates.SampleSecurityManager;
+import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+import org.apache.geode.test.junit.categories.SecurityTest;
+import org.apache.http.HttpResponse;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.springframework.http.MediaType;
+
+import java.net.URLEncoder;
+import java.util.Properties;
+
+
+@Category({IntegrationTest.class, SecurityTest.class})
+public class RestSecurityPostProcessorTest {
+
+  static final String REGION_NAME = "AuthRegion";
+
+  static int restPort = AvailablePortHelper.getRandomAvailableTCPPort();
+  static Properties properties = new Properties() {
+{
+  setProperty(SampleSecurityManager.SECURITY_JSON,
+  
"org/apache/geode/management/internal/security/clientServer.json");
+  setProperty(SECURITY_MANAGER, SampleSecurityManager.class.getName());
+  setProperty(START_DEV_REST_API, "true");
+  setProperty(HTTP_SERVICE_BIND_ADDRESS, "localhost");
+  setProperty(HTTP_SERVICE_PORT, restPort + "");
+  setProperty(SECURITY_POST_PROCESSOR, 
SamplePostProcessor.class.getName());
+}
+  };
+
+  @ClassRule
+  public static ServerStarterRule serverStarter = new 
ServerStarterRule(properties);
+  private final GeodeRestClient restClient = new 
GeodeRestClient("localhost", restPort);
+
+  @BeforeClass
+  public static void before() throws Exception {
+serverStarter.startServer();
+Region region =
+
serverStarter.cache.createRegionFactory(RegionShortcut.REPLICATE).create(REGION_NAME);
+region.put("key1",
+
"{\"@type\":\"com.gemstone.gemfire.web.rest.domain.Order\",\"purchaseOrderNo\":1121,\"customerId\":1012,\"description\":\"Order
 for  XYZ 
Corp\",\"orderDate\":\"02/10/2014\",\"deliveryDate\":\"02/20/2014\",\"contact\":\"Jelly
 
Bean\",\"email\":\"jelly.b...@example.com\",\"phone\":\"01-2048096\",\"items\":[{\"itemNo\":1,\"description\":\"Product-100\",\"quantity\":12,\"unitPrice\":5,\"totalPrice\":60}],\"totalPrice\":225}");
+region.put("key2", "bar");
+

[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86822046
  
--- Diff: 
geode-assembly/src/test/java/org/apache/geode/rest/internal/web/RestSecurityPostProcessorTest.java
 ---
@@ -0,0 +1,185 @@
+/*
+ * 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.geode.rest.internal.web;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_BIND_ADDRESS;
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_PORT;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_POST_PROCESSOR;
+import static 
org.apache.geode.distributed.ConfigurationProperties.START_DEV_REST_API;
+import static org.apache.geode.rest.internal.web.GeodeRestClient.getCode;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getContentType;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonArray;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonObject;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.execute.FunctionService;
+import org.apache.geode.internal.AvailablePortHelper;
+import org.apache.geode.rest.internal.web.controllers.GetRegions;
+import org.apache.geode.security.templates.SamplePostProcessor;
+import org.apache.geode.security.templates.SampleSecurityManager;
+import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+import org.apache.geode.test.junit.categories.SecurityTest;
+import org.apache.http.HttpResponse;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.springframework.http.MediaType;
+
+import java.net.URLEncoder;
+import java.util.Properties;
+
+
+@Category({IntegrationTest.class, SecurityTest.class})
+public class RestSecurityPostProcessorTest {
+
+  static final String REGION_NAME = "AuthRegion";
+
+  static int restPort = AvailablePortHelper.getRandomAvailableTCPPort();
+  static Properties properties = new Properties() {
+{
+  setProperty(SampleSecurityManager.SECURITY_JSON,
+  
"org/apache/geode/management/internal/security/clientServer.json");
+  setProperty(SECURITY_MANAGER, SampleSecurityManager.class.getName());
+  setProperty(START_DEV_REST_API, "true");
+  setProperty(HTTP_SERVICE_BIND_ADDRESS, "localhost");
+  setProperty(HTTP_SERVICE_PORT, restPort + "");
+  setProperty(SECURITY_POST_PROCESSOR, 
SamplePostProcessor.class.getName());
+}
+  };
+
+  @ClassRule
+  public static ServerStarterRule serverStarter = new 
ServerStarterRule(properties);
+  private final GeodeRestClient restClient = new 
GeodeRestClient("localhost", restPort);
+
+  @BeforeClass
+  public static void before() throws Exception {
+serverStarter.startServer();
+Region region =
+
serverStarter.cache.createRegionFactory(RegionShortcut.REPLICATE).create(REGION_NAME);
+region.put("key1",
+
"{\"@type\":\"com.gemstone.gemfire.web.rest.domain.Order\",\"purchaseOrderNo\":1121,\"customerId\":1012,\"description\":\"Order
 for  XYZ 
Corp\",\"orderDate\":\"02/10/2014\",\"deliveryDate\":\"02/20/2014\",\"contact\":\"Jelly
 
Bean\",\"email\":\"jelly.b...@example.com\",\"phone\":\"01-2048096\",\"items\":[{\"itemNo\":1,\"description\":\"Product-100\",\"quantity\":12,\"unitPrice\":5,\"totalPrice\":60}],\"totalPrice\":225}");
+region.put("key2", "bar");
+

[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86836287
  
--- Diff: 
geode-core/src/main/java/org/apache/geode/internal/security/SecurityService.java
 ---
@@ -87,6 +89,12 @@
   Object postProcess(Object principal, String regionPath, Object key, 
Object value,
   boolean valueIsSerialized);
 
+  Collection postProcess(Query query, Collection 
regionNames,
+  Collection results);
+
+  Collection postProcess(Object principal, Query query, 
Collection regionNames,
--- End diff --

remove this


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86822375
  
--- Diff: 
geode-assembly/src/test/java/org/apache/geode/rest/internal/web/RestSecurityPostProcessorTest.java
 ---
@@ -0,0 +1,185 @@
+/*
+ * 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.geode.rest.internal.web;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_BIND_ADDRESS;
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_PORT;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_POST_PROCESSOR;
+import static 
org.apache.geode.distributed.ConfigurationProperties.START_DEV_REST_API;
+import static org.apache.geode.rest.internal.web.GeodeRestClient.getCode;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getContentType;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonArray;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonObject;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.execute.FunctionService;
+import org.apache.geode.internal.AvailablePortHelper;
+import org.apache.geode.rest.internal.web.controllers.GetRegions;
+import org.apache.geode.security.templates.SamplePostProcessor;
+import org.apache.geode.security.templates.SampleSecurityManager;
+import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+import org.apache.geode.test.junit.categories.SecurityTest;
+import org.apache.http.HttpResponse;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.springframework.http.MediaType;
+
+import java.net.URLEncoder;
+import java.util.Properties;
+
+
+@Category({IntegrationTest.class, SecurityTest.class})
+public class RestSecurityPostProcessorTest {
+
+  static final String REGION_NAME = "AuthRegion";
+
+  static int restPort = AvailablePortHelper.getRandomAvailableTCPPort();
+  static Properties properties = new Properties() {
+{
+  setProperty(SampleSecurityManager.SECURITY_JSON,
+  
"org/apache/geode/management/internal/security/clientServer.json");
+  setProperty(SECURITY_MANAGER, SampleSecurityManager.class.getName());
+  setProperty(START_DEV_REST_API, "true");
+  setProperty(HTTP_SERVICE_BIND_ADDRESS, "localhost");
+  setProperty(HTTP_SERVICE_PORT, restPort + "");
+  setProperty(SECURITY_POST_PROCESSOR, 
SamplePostProcessor.class.getName());
+}
+  };
+
+  @ClassRule
+  public static ServerStarterRule serverStarter = new 
ServerStarterRule(properties);
+  private final GeodeRestClient restClient = new 
GeodeRestClient("localhost", restPort);
+
+  @BeforeClass
+  public static void before() throws Exception {
+serverStarter.startServer();
+Region region =
+
serverStarter.cache.createRegionFactory(RegionShortcut.REPLICATE).create(REGION_NAME);
+region.put("key1",
+
"{\"@type\":\"com.gemstone.gemfire.web.rest.domain.Order\",\"purchaseOrderNo\":1121,\"customerId\":1012,\"description\":\"Order
 for  XYZ 
Corp\",\"orderDate\":\"02/10/2014\",\"deliveryDate\":\"02/20/2014\",\"contact\":\"Jelly
 
Bean\",\"email\":\"jelly.b...@example.com\",\"phone\":\"01-2048096\",\"items\":[{\"itemNo\":1,\"description\":\"Product-100\",\"quantity\":12,\"unitPrice\":5,\"totalPrice\":60}],\"totalPrice\":225}");
+region.put("key2", "bar");
+

[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86836336
  
--- Diff: 
geode-core/src/main/java/org/apache/geode/internal/security/IntegratedSecurityService.java
 ---
@@ -409,6 +435,34 @@ public Object postProcess(Object principal, String 
regionPath, Object key, Objec
 return newValue;
   }
 
+  private Object getPrincipal(Object principal) {
+if (principal == null) {
+  Subject subject = getSubject();
+  if (subject == null)
+return null;
+  principal = subject.getPrincipal();
+}
+return principal;
+  }
+
+  @Override
+  public Collection postProcess(Query query, Collection 
regionNames,
+  Collection results) {
+return postProcess(null, query, regionNames, results);
+  }
+
+  @Override
+  public Collection postProcess(Object principal, Query query,
--- End diff --

remove this.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Re: Review Request 53503: GEODE-2077: throw appropriate exceptions when get call in transactions failed with certain exceptions.

2016-11-07 Thread Darrel Schneider

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53503/#review155168
---




geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java 
(line 3968)


I think your comment would be clearer if you said:
// only transactions set allRetry to false



geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java 
(line 3974)


You should not set the cause to "pde" since it is an internal package that 
should not be thrown to customer code.

It is probably worth at least a comment saying this else will currently 
never happen since all current constructors of PRLocallyDestroyedException
set the cause to RegionDestroyedException.



geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java 
(line 4013)


I see other places in the code that handle RegionDestroyedException by 
throwing a TransactionDataNotColocatedException.
This code does that for BucketNotFoundException.
Why did you chose on a RegionDestroyedException to throw 
TransactionDataRebalancedException instead of 
TransactionDataNotColocatedException?



geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java 
(line 4020)


I think the following wording is clearer:
// Make transaction fail so client can retry


- Darrel Schneider


On Nov. 4, 2016, 3:57 p.m., Eric Shu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53503/
> ---
> 
> (Updated Nov. 4, 2016, 3:57 p.m.)
> 
> 
> Review request for geode, anilkumar gingade and Darrel Schneider.
> 
> 
> Repository: geode
> 
> 
> Description
> ---
> 
> Throws TransactionDataRebalancedException when get call on a key in a bucket 
> that has been moved.
> 
> 
> Diffs
> -
> 
>   
> geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
>  8f67e25 
>   
> geode-core/src/main/java/org/apache/geode/internal/cache/TXStateProxyImpl.java
>  a89cdc4 
>   
> geode-core/src/test/java/org/apache/geode/internal/cache/execute/PRColocationDUnitTest.java
>  bedb1d4 
>   
> geode-core/src/test/java/org/apache/geode/internal/cache/execute/PRTransactionDUnitTest.java
>  37ea4e5 
> 
> Diff: https://reviews.apache.org/r/53503/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Eric Shu
> 
>



[GitHub] incubator-geode issue #276: GEODE-1993: postprocess region/key

2016-11-07 Thread kjduling
Github user kjduling commented on the issue:

https://github.com/apache/incubator-geode/pull/276
  
Precheckin successful except for one flaky test, 
QueueCommandsDUnitTest.testCreateUpdatesSharedConfig which doesn't appear to be 
related to this change.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Re: Review Request 53543: GEODE-2079: mark the test as flaky

2016-11-07 Thread Kevin Duling

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53543/#review155159
---


Ship it!




Ship It!

- Kevin Duling


On Nov. 7, 2016, 8:42 a.m., Jinmei Liao wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53543/
> ---
> 
> (Updated Nov. 7, 2016, 8:42 a.m.)
> 
> 
> Review request for geode, Kevin Duling and Kirk Lund.
> 
> 
> Repository: geode
> 
> 
> Description
> ---
> 
> GEODE-2079: mark the test as flaky
> 
> 
> Diffs
> -
> 
>   
> geode-core/src/test/java/org/apache/geode/management/ConnectToLocatorSSLDUnitTest.java
>  1c8079aafa32b2848dfae573f2cd4e8e9f28cc5b 
> 
> Diff: https://reviews.apache.org/r/53543/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Jinmei Liao
> 
>



Review Request 53543: GEODE-2079: mark the test as flaky

2016-11-07 Thread Jinmei Liao

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53543/
---

Review request for geode, Kevin Duling and Kirk Lund.


Repository: geode


Description
---

GEODE-2079: mark the test as flaky


Diffs
-

  
geode-core/src/test/java/org/apache/geode/management/ConnectToLocatorSSLDUnitTest.java
 1c8079aafa32b2848dfae573f2cd4e8e9f28cc5b 

Diff: https://reviews.apache.org/r/53543/diff/


Testing
---


Thanks,

Jinmei Liao



Re: classpath in geode release

2016-11-07 Thread Anthony Baker

> On Nov 7, 2016, at 1:11 AM, Gal Palmery  wrote:
> 
> Thanks Anthony.
> So, if I were to manually remove them from the manifest, do you expect any 
> issues at runtime?
> 

Since those jars are not present in the lib/ dir, the MANFEST classpath entry 
should be harmless either way.

> Also, you mentioned that these are only used when using cmd line. How is the 
> runtime classpath built when not using cmd ?
> 

The dependency jars are only used when launching the server.  Applications 
using the gemfire java client can use maven / gradle dependencies to pull in 
the correct jars.

> Thanks,
> Gal
> 
> 
> -Original Message-
> From: Anthony Baker [mailto:aba...@pivotal.io] 
> Sent: Monday, November 07, 2016 01:20
> To: geode
> Subject: Re: classpath in geode release
> 
> 
>> On Nov 6, 2016, at 7:47 AM, Gal Palmery  wrote:
>> 
>> Clarification - 
>> This is in the geode-dependencies.jar and gfsh-dependencies.jar that were 
>> created by the local build that I run on my PC. 
>> I downloaded the 1.0.0-incubating release and built it using the following 
>> command:
>>> gradlew clean build installDist -Dskip.tests=true
>> 
> 
> Yep, this looks like a bug, though probably harmless.  The geode-core 
> dependencies pull in v2.8.0 transitively:
> 
> +--- com.fasterxml.jackson.core:jackson-databind:2.8.2
> |+--- com.fasterxml.jackson.core:jackson-annotations:2.8.0
> |\--- com.fasterxml.jackson.core:jackson-core:2.8.2
> 
> while the geode-pulse and geode-web-api modules pull in v2.8.2 with an 
> explicit dependency.  These should be filtered when we build the classpath.  
> See GEODE-2078.
> 
>> where can I find these jars (geode-dependencies.jar and 
>> gfsh-dependencies.jar) that are created each nightly build? 
>> I tried in the maven central repository, but they are not there.
> 
> There jars aren’t published to maven as they are manifest-only jars meant for 
> cmd line usage.  The build artifacts can be found in jenkins (see 
> https://builds.apache.org/job/Geode-nightly) but those should only be used 
> for development purposes and are not official releases.
> 
>> 
>> Thanks,
>> Gal
>> 
>> 
>> -Original Message-
>> From: Gal Palmery 
>> Sent: Sunday, November 06, 2016 11:43
>> To: dev@geode.incubator.apache.org
>> Subject: classpath in geode release
>> 
>> Hi,
>> 
>> I noticed that there are 2 jackson-annotations jars, and 2 slf4j-api jars 
>> with different versions in the classpath (in the MANIFESTs of 
>> geode-dependencies.jar and in gfsh-dependencies.jar).
>> What is the reason for that? Is this a bug?
>> 
>> Thanks,
>> Gal
>> 
>> This message and the information contained herein is proprietary and 
>> confidential and subject to the Amdocs policy statement, you may review at 
>> http://www.amdocs.com/email_disclaimer.asp
> 



Re: Build failed in Jenkins: Geode-nightly #646

2016-11-07 Thread Jinmei Liao
I will take care of this.

On Mon, Nov 7, 2016 at 7:42 AM, Apache Jenkins Server <
jenk...@builds.apache.org> wrote:

> See 
>
> --
> [...truncated 526 lines...]
> :geode-cq:check
> :geode-cq:build
> :geode-cq:distributedTest
> :geode-cq:flakyTest
> :geode-cq:integrationTest
> :geode-json:assemble
> :geode-json:compileTestJava UP-TO-DATE
> :geode-json:processTestResources UP-TO-DATE
> :geode-json:testClasses UP-TO-DATE
> :geode-json:checkMissedTests UP-TO-DATE
> :geode-json:spotlessJavaCheck
> :geode-json:spotlessCheck
> :geode-json:test UP-TO-DATE
> :geode-json:check
> :geode-json:build
> :geode-json:distributedTest UP-TO-DATE
> :geode-json:flakyTest UP-TO-DATE
> :geode-json:integrationTest UP-TO-DATE
> :geode-junit:javadoc
> :geode-junit:javadocJar
> :geode-junit:sourcesJar
> :geode-junit:signArchives SKIPPED
> :geode-junit:assemble
> :geode-junit:compileTestJava
> :geode-junit:processTestResources UP-TO-DATE
> :geode-junit:testClasses
> :geode-junit:checkMissedTests
> :geode-junit:spotlessJavaCheck
> :geode-junit:spotlessCheck
> :geode-junit:test
> :geode-junit:check
> :geode-junit:build
> :geode-junit:distributedTest
> :geode-junit:flakyTest
> :geode-junit:integrationTest
> :geode-lucene:assemble
> :geode-lucene:compileTestJavaNote: Some input files use or override a
> deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
> Note: Some input files use unchecked or unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
>
> :geode-lucene:processTestResources
> :geode-lucene:testClasses
> :geode-lucene:checkMissedTests
> :geode-lucene:spotlessJavaCheck
> :geode-lucene:spotlessCheck
> :geode-lucene:test
> :geode-lucene:check
> :geode-lucene:build
> :geode-lucene:distributedTest
> :geode-lucene:flakyTest
> :geode-lucene:integrationTest
> :geode-old-client-support:assemble
> :geode-old-client-support:compileTestJava
> :geode-old-client-support:processTestResources UP-TO-DATE
> :geode-old-client-support:testClasses
> :geode-old-client-support:checkMissedTests
> :geode-old-client-support:spotlessJavaCheck
> :geode-old-client-support:spotlessCheck
> :geode-old-client-support:test
> :geode-old-client-support:check
> :geode-old-client-support:build
> :geode-old-client-support:distributedTest
> :geode-old-client-support:flakyTest
> :geode-old-client-support:integrationTest
> :geode-pulse:assemble
> :geode-pulse:compileTestJavaNote:  job/Geode-nightly/ws/geode-pulse/src/test/java/org/
> apache/geode/tools/pulse/tests/ui/PulseAbstractTest.java> uses or
> overrides a deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
> Note: Some input files use unchecked or unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
>
> :geode-pulse:processTestResources
> :geode-pulse:testClasses
> :geode-pulse:checkMissedTests
> :geode-pulse:spotlessJavaCheck
> :geode-pulse:spotlessCheck
> :geode-pulse:test
> :geode-pulse:check
> :geode-pulse:build
> :geode-pulse:distributedTest
> :geode-pulse:flakyTest
> :geode-pulse:integrationTest
> :geode-rebalancer:assemble
> :geode-rebalancer:compileTestJava
> :geode-rebalancer:processTestResources UP-TO-DATE
> :geode-rebalancer:testClasses
> :geode-rebalancer:checkMissedTests
> :geode-rebalancer:spotlessJavaCheck
> :geode-rebalancer:spotlessCheck
> :geode-rebalancer:test
> :geode-rebalancer:check
> :geode-rebalancer:build
> :geode-rebalancer:distributedTest
> :geode-rebalancer:flakyTest
> :geode-rebalancer:integrationTest
> :geode-wan:assemble
> :geode-wan:compileTestJavaNote: Some input files use or override a
> deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
> Note: Some input files use unchecked or unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
>
> :geode-wan:processTestResources
> :geode-wan:testClasses
> :geode-wan:checkMissedTests
> :geode-wan:spotlessJavaCheck
> :geode-wan:spotlessCheck
> :geode-wan:test
> :geode-wan:check
> :geode-wan:build
> :geode-wan:distributedTest
> :geode-wan:flakyTest
> :geode-wan:integrationTest
> :geode-web:assemble
> :geode-web:compileTestJavaNote: Some input files use or override a
> deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
> Note: Some input files use unchecked or unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
>
> :geode-web:processTestResources UP-TO-DATE
> :geode-web:testClasses
> :geode-web:checkMissedTests
> :geode-web:spotlessJavaCheck
> :geode-web:spotlessCheck
> :geode-web:test
> :geode-web:check
> :geode-web:build
> :geode-web:distributedTest
> :geode-web:flakyTest
> :geode-web:integrationTest
> :geode-web-api:assemble
> :geode-web-api:compileTestJava UP-TO-DATE
> :geode-web-api:processTestResources UP-TO-DATE
> :geode-web-api:testClasses UP-TO-DATE
> :geode-web-api:checkMissedTests UP-TO-DATE
> :geode-web-api:spotlessJavaCheck
> :geode-web-api:spotlessCheck
> 

Build failed in Jenkins: Geode-nightly #646

2016-11-07 Thread Apache Jenkins Server
See 

--
[...truncated 526 lines...]
:geode-cq:check
:geode-cq:build
:geode-cq:distributedTest
:geode-cq:flakyTest
:geode-cq:integrationTest
:geode-json:assemble
:geode-json:compileTestJava UP-TO-DATE
:geode-json:processTestResources UP-TO-DATE
:geode-json:testClasses UP-TO-DATE
:geode-json:checkMissedTests UP-TO-DATE
:geode-json:spotlessJavaCheck
:geode-json:spotlessCheck
:geode-json:test UP-TO-DATE
:geode-json:check
:geode-json:build
:geode-json:distributedTest UP-TO-DATE
:geode-json:flakyTest UP-TO-DATE
:geode-json:integrationTest UP-TO-DATE
:geode-junit:javadoc
:geode-junit:javadocJar
:geode-junit:sourcesJar
:geode-junit:signArchives SKIPPED
:geode-junit:assemble
:geode-junit:compileTestJava
:geode-junit:processTestResources UP-TO-DATE
:geode-junit:testClasses
:geode-junit:checkMissedTests
:geode-junit:spotlessJavaCheck
:geode-junit:spotlessCheck
:geode-junit:test
:geode-junit:check
:geode-junit:build
:geode-junit:distributedTest
:geode-junit:flakyTest
:geode-junit:integrationTest
:geode-lucene:assemble
:geode-lucene:compileTestJavaNote: Some input files use or override a 
deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

:geode-lucene:processTestResources
:geode-lucene:testClasses
:geode-lucene:checkMissedTests
:geode-lucene:spotlessJavaCheck
:geode-lucene:spotlessCheck
:geode-lucene:test
:geode-lucene:check
:geode-lucene:build
:geode-lucene:distributedTest
:geode-lucene:flakyTest
:geode-lucene:integrationTest
:geode-old-client-support:assemble
:geode-old-client-support:compileTestJava
:geode-old-client-support:processTestResources UP-TO-DATE
:geode-old-client-support:testClasses
:geode-old-client-support:checkMissedTests
:geode-old-client-support:spotlessJavaCheck
:geode-old-client-support:spotlessCheck
:geode-old-client-support:test
:geode-old-client-support:check
:geode-old-client-support:build
:geode-old-client-support:distributedTest
:geode-old-client-support:flakyTest
:geode-old-client-support:integrationTest
:geode-pulse:assemble
:geode-pulse:compileTestJavaNote: 

 uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

:geode-pulse:processTestResources
:geode-pulse:testClasses
:geode-pulse:checkMissedTests
:geode-pulse:spotlessJavaCheck
:geode-pulse:spotlessCheck
:geode-pulse:test
:geode-pulse:check
:geode-pulse:build
:geode-pulse:distributedTest
:geode-pulse:flakyTest
:geode-pulse:integrationTest
:geode-rebalancer:assemble
:geode-rebalancer:compileTestJava
:geode-rebalancer:processTestResources UP-TO-DATE
:geode-rebalancer:testClasses
:geode-rebalancer:checkMissedTests
:geode-rebalancer:spotlessJavaCheck
:geode-rebalancer:spotlessCheck
:geode-rebalancer:test
:geode-rebalancer:check
:geode-rebalancer:build
:geode-rebalancer:distributedTest
:geode-rebalancer:flakyTest
:geode-rebalancer:integrationTest
:geode-wan:assemble
:geode-wan:compileTestJavaNote: Some input files use or override a deprecated 
API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

:geode-wan:processTestResources
:geode-wan:testClasses
:geode-wan:checkMissedTests
:geode-wan:spotlessJavaCheck
:geode-wan:spotlessCheck
:geode-wan:test
:geode-wan:check
:geode-wan:build
:geode-wan:distributedTest
:geode-wan:flakyTest
:geode-wan:integrationTest
:geode-web:assemble
:geode-web:compileTestJavaNote: Some input files use or override a deprecated 
API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

:geode-web:processTestResources UP-TO-DATE
:geode-web:testClasses
:geode-web:checkMissedTests
:geode-web:spotlessJavaCheck
:geode-web:spotlessCheck
:geode-web:test
:geode-web:check
:geode-web:build
:geode-web:distributedTest
:geode-web:flakyTest
:geode-web:integrationTest
:geode-web-api:assemble
:geode-web-api:compileTestJava UP-TO-DATE
:geode-web-api:processTestResources UP-TO-DATE
:geode-web-api:testClasses UP-TO-DATE
:geode-web-api:checkMissedTests UP-TO-DATE
:geode-web-api:spotlessJavaCheck
:geode-web-api:spotlessCheck
:geode-web-api:test UP-TO-DATE
:geode-web-api:check
:geode-web-api:build
:geode-web-api:distributedTest UP-TO-DATE
:geode-web-api:flakyTest UP-TO-DATE
:geode-web-api:integrationTest UP-TO-DATE
:combineReports
All test reports at 

:extensions/geode-modules:precheckin
:extensions/geode-modules-assembly:precheckin

RE: classpath in geode release

2016-11-07 Thread Gal Palmery
Thanks Anthony.
So, if I were to manually remove them from the manifest, do you expect any 
issues at runtime?

Also, you mentioned that these are only used when using cmd line. How is the 
runtime classpath built when not using cmd ?

Thanks,
Gal


-Original Message-
From: Anthony Baker [mailto:aba...@pivotal.io] 
Sent: Monday, November 07, 2016 01:20
To: geode
Subject: Re: classpath in geode release


> On Nov 6, 2016, at 7:47 AM, Gal Palmery  wrote:
> 
> Clarification - 
> This is in the geode-dependencies.jar and gfsh-dependencies.jar that were 
> created by the local build that I run on my PC. 
> I downloaded the 1.0.0-incubating release and built it using the following 
> command:
>>  gradlew clean build installDist -Dskip.tests=true
> 

Yep, this looks like a bug, though probably harmless.  The geode-core 
dependencies pull in v2.8.0 transitively:

+--- com.fasterxml.jackson.core:jackson-databind:2.8.2
|+--- com.fasterxml.jackson.core:jackson-annotations:2.8.0
|\--- com.fasterxml.jackson.core:jackson-core:2.8.2

while the geode-pulse and geode-web-api modules pull in v2.8.2 with an explicit 
dependency.  These should be filtered when we build the classpath.  See 
GEODE-2078.

> where can I find these jars (geode-dependencies.jar and 
> gfsh-dependencies.jar) that are created each nightly build? 
> I tried in the maven central repository, but they are not there.

There jars aren’t published to maven as they are manifest-only jars meant for 
cmd line usage.  The build artifacts can be found in jenkins (see 
https://builds.apache.org/job/Geode-nightly) but those should only be used for 
development purposes and are not official releases.

> 
> Thanks,
> Gal
> 
> 
> -Original Message-
> From: Gal Palmery 
> Sent: Sunday, November 06, 2016 11:43
> To: dev@geode.incubator.apache.org
> Subject: classpath in geode release
> 
> Hi,
> 
> I noticed that there are 2 jackson-annotations jars, and 2 slf4j-api jars 
> with different versions in the classpath (in the MANIFESTs of 
> geode-dependencies.jar and in gfsh-dependencies.jar).
> What is the reason for that? Is this a bug?
> 
> Thanks,
> Gal
> 
> This message and the information contained herein is proprietary and 
> confidential and subject to the Amdocs policy statement, you may review at 
> http://www.amdocs.com/email_disclaimer.asp



RE: classpath in geode release

2016-11-07 Thread Dor Ben Dov
Good catch Gal.

Regards,
Dor

-Original Message-
From: Anthony Baker [mailto:aba...@pivotal.io] 
Sent: יום ב 07 נובמבר 2016 01:20
To: geode 
Subject: Re: classpath in geode release


> On Nov 6, 2016, at 7:47 AM, Gal Palmery  wrote:
> 
> Clarification - 
> This is in the geode-dependencies.jar and gfsh-dependencies.jar that were 
> created by the local build that I run on my PC. 
> I downloaded the 1.0.0-incubating release and built it using the following 
> command:
>>  gradlew clean build installDist -Dskip.tests=true
> 

Yep, this looks like a bug, though probably harmless.  The geode-core 
dependencies pull in v2.8.0 transitively:

+--- com.fasterxml.jackson.core:jackson-databind:2.8.2
|+--- com.fasterxml.jackson.core:jackson-annotations:2.8.0
|\--- com.fasterxml.jackson.core:jackson-core:2.8.2

while the geode-pulse and geode-web-api modules pull in v2.8.2 with an explicit 
dependency.  These should be filtered when we build the classpath.  See 
GEODE-2078.

> where can I find these jars (geode-dependencies.jar and 
> gfsh-dependencies.jar) that are created each nightly build? 
> I tried in the maven central repository, but they are not there.

There jars aren’t published to maven as they are manifest-only jars meant for 
cmd line usage.  The build artifacts can be found in jenkins (see 
https://builds.apache.org/job/Geode-nightly) but those should only be used for 
development purposes and are not official releases.

> 
> Thanks,
> Gal
> 
> 
> -Original Message-
> From: Gal Palmery 
> Sent: Sunday, November 06, 2016 11:43
> To: dev@geode.incubator.apache.org
> Subject: classpath in geode release
> 
> Hi,
> 
> I noticed that there are 2 jackson-annotations jars, and 2 slf4j-api jars 
> with different versions in the classpath (in the MANIFESTs of 
> geode-dependencies.jar and in gfsh-dependencies.jar).
> What is the reason for that? Is this a bug?
> 
> Thanks,
> Gal
> 
> This message and the information contained herein is proprietary and 
> confidential and subject to the Amdocs policy statement, you may review at 
> http://www.amdocs.com/email_disclaimer.asp