[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16093534#comment-16093534 ] ASF subversion and git services commented on GEODE-3141: Commit 66468b1296e1bca64b88a7286d6fef225de24c74 in geode's branch refs/heads/feature/GEODE-3113 from [~ukohlmeyer] [ https://git-wip-us.apache.org/repos/asf?p=geode.git;h=66468b1 ] GEODE-3141: Amended due to review feedback. BasicTypes.Region.type renamed to dataPolicy Ran spotless Added assertions to RoundTripCacheConnectionJUnitTest.java Amended ProtobufUtilities.java to not populate key/value constraint fields if not set on Geode Region > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > Fix For: 1.3.0 > > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16093536#comment-16093536 ] ASF subversion and git services commented on GEODE-3141: Commit 78900ebb210762b4285afbd98a0ebddd571ecde7 in geode's branch refs/heads/feature/GEODE-3113 from [~ukohlmeyer] [ https://git-wip-us.apache.org/repos/asf?p=geode.git;h=78900eb ] GEODE-3141: Remove misleading comment. This now closes #630 > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > Fix For: 1.3.0 > > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16093533#comment-16093533 ] ASF subversion and git services commented on GEODE-3141: Commit 527fc76b99d7b576838ba435a470805b11043155 in geode's branch refs/heads/feature/GEODE-3113 from [~ukohlmeyer] [ https://git-wip-us.apache.org/repos/asf?p=geode.git;h=527fc76 ] GEODE-3141: GetRegion Operation implemented Added OperationHandlerJUnitTest.java as parents class of all OperationHandler tests. General clean up of all `public static final` fields > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > Fix For: 1.3.0 > > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16093535#comment-16093535 ] ASF subversion and git services commented on GEODE-3141: Commit 40e70f18d3f7233cb7475edc2cc08f423dd9d422 in geode's branch refs/heads/feature/GEODE-3113 from [~ukohlmeyer] [ https://git-wip-us.apache.org/repos/asf?p=geode.git;h=40e70f1 ] GEODE-3141: spotless reformatting > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > Fix For: 1.3.0 > > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16091836#comment-16091836 ] ASF subversion and git services commented on GEODE-3141: Commit 66468b1296e1bca64b88a7286d6fef225de24c74 in geode's branch refs/heads/develop from [~ukohlmeyer] [ https://git-wip-us.apache.org/repos/asf?p=geode.git;h=66468b1 ] GEODE-3141: Amended due to review feedback. BasicTypes.Region.type renamed to dataPolicy Ran spotless Added assertions to RoundTripCacheConnectionJUnitTest.java Amended ProtobufUtilities.java to not populate key/value constraint fields if not set on Geode Region > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16091838#comment-16091838 ] ASF subversion and git services commented on GEODE-3141: Commit 78900ebb210762b4285afbd98a0ebddd571ecde7 in geode's branch refs/heads/develop from [~ukohlmeyer] [ https://git-wip-us.apache.org/repos/asf?p=geode.git;h=78900eb ] GEODE-3141: Remove misleading comment. This now closes #630 > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16091835#comment-16091835 ] ASF subversion and git services commented on GEODE-3141: Commit 527fc76b99d7b576838ba435a470805b11043155 in geode's branch refs/heads/develop from [~ukohlmeyer] [ https://git-wip-us.apache.org/repos/asf?p=geode.git;h=527fc76 ] GEODE-3141: GetRegion Operation implemented Added OperationHandlerJUnitTest.java as parents class of all OperationHandler tests. General clean up of all `public static final` fields > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16091837#comment-16091837 ] ASF subversion and git services commented on GEODE-3141: Commit 40e70f18d3f7233cb7475edc2cc08f423dd9d422 in geode's branch refs/heads/develop from [~ukohlmeyer] [ https://git-wip-us.apache.org/repos/asf?p=geode.git;h=40e70f1 ] GEODE-3141: spotless reformatting > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16091839#comment-16091839 ] ASF GitHub Bot commented on GEODE-3141: --- Github user asfgit closed the pull request at: https://github.com/apache/geode/pull/630 > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16091829#comment-16091829 ] ASF GitHub Bot commented on GEODE-3141: --- Github user kohlmu-pivotal commented on a diff in the pull request: https://github.com/apache/geode/pull/630#discussion_r128038401 --- Diff: geode-protobuf/src/main/proto/basicTypes.proto --- @@ -52,7 +52,12 @@ message CallbackArguments { message Region { --- End diff -- One would want to avoid just dumping fields into the response object without context. Given all fields are related to the Region, it is better suited to use a Region message. > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16090529#comment-16090529 ] ASF GitHub Bot commented on GEODE-3141: --- Github user galen-pivotal commented on a diff in the pull request: https://github.com/apache/geode/pull/630#discussion_r127820947 --- Diff: geode-protobuf/src/main/proto/basicTypes.proto --- @@ -52,7 +52,12 @@ message CallbackArguments { message Region { --- End diff -- Why not inline the contents of this in `GetRegionResponse`? > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16090371#comment-16090371 ] ASF subversion and git services commented on GEODE-3141: Commit 9e9950f37363e13971372b70d46ae7f5ccbcc9ce in geode's branch refs/heads/feature/GEODE-3141 from [~ukohlmeyer] [ https://git-wip-us.apache.org/repos/asf?p=geode.git;h=9e9950f ] GEODE-3141: Remove misleading comment > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16090079#comment-16090079 ] ASF GitHub Bot commented on GEODE-3141: --- Github user kohlmu-pivotal commented on a diff in the pull request: https://github.com/apache/geode/pull/630#discussion_r127761196 --- Diff: geode-protobuf/src/main/proto/region_API.proto --- @@ -102,4 +102,14 @@ message GetRegionNamesRequest { message GetRegionNamesResponse { repeated string regions = 1; -} \ No newline at end of file +} + +/* does a region exist? */ +message GetRegionRequest { +string regionName = 1; +} + +/* success will be true if the region exists */ --- End diff -- Updating the documentation of this > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16090036#comment-16090036 ] ASF GitHub Bot commented on GEODE-3141: --- Github user galen-pivotal commented on a diff in the pull request: https://github.com/apache/geode/pull/630#discussion_r127756778 --- Diff: geode-protobuf/src/main/proto/region_API.proto --- @@ -102,4 +102,14 @@ message GetRegionNamesRequest { message GetRegionNamesResponse { repeated string regions = 1; -} \ No newline at end of file +} + +/* does a region exist? */ +message GetRegionRequest { +string regionName = 1; +} + +/* success will be true if the region exists */ --- End diff -- Did there used to be a success variable here? > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16087950#comment-16087950 ] ASF subversion and git services commented on GEODE-3141: Commit a202e84fc0b33022dacc0df7fdbb4d51b83163b2 in geode's branch refs/heads/feature/GEODE-3141 from [~ukohlmeyer] [ https://git-wip-us.apache.org/repos/asf?p=geode.git;h=a202e84 ] GEODE-3141: spotless reformatting > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16087570#comment-16087570 ] ASF GitHub Bot commented on GEODE-3141: --- Github user galen-pivotal commented on the issue: https://github.com/apache/geode/pull/630 Looks like Spotless is failing in CI. > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16086200#comment-16086200 ] ASF GitHub Bot commented on GEODE-3141: --- Github user WireBaron commented on a diff in the pull request: https://github.com/apache/geode/pull/630#discussion_r127299289 --- Diff: geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/PutAllRequestOperationHandlerJUnitTest.java --- @@ -14,6 +14,14 @@ */ package org.apache.geode.protocol.protobuf.operations; +import static org.mockito.Mockito.any; --- End diff -- spotlessApply doesn't seem to care about the import order, however IntelliJ will reorder according the style guide every time you run "optimize imports". Patrick was flagging every pull request with the outdated order for a while. > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16086167#comment-16086167 ] ASF subversion and git services commented on GEODE-3141: Commit f2a30d2b46398be92f7eb7a7b0f9ca21f996e6e9 in geode's branch refs/heads/feature/GEODE-3141 from [~ukohlmeyer] [ https://git-wip-us.apache.org/repos/asf?p=geode.git;h=f2a30d2 ] GEODE-3141: Amended due to review feedback. BasicTypes.Region.type renamed to dataPolicy Ran spotless Added assertions to RoundTripCacheConnectionJUnitTest.java Amended ProtobufUtilities.java to not populate key/value constraint fields if not set on Geode Region > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16086157#comment-16086157 ] ASF GitHub Bot commented on GEODE-3141: --- Github user kohlmu-pivotal commented on a diff in the pull request: https://github.com/apache/geode/pull/630#discussion_r127294276 --- Diff: geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/PutAllRequestOperationHandlerJUnitTest.java --- @@ -14,6 +14,14 @@ */ package org.apache.geode.protocol.protobuf.operations; +import static org.mockito.Mockito.any; --- End diff -- I run the spotlessApply... I don't rely on Intellij formatting. > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16086155#comment-16086155 ] ASF GitHub Bot commented on GEODE-3141: --- Github user kohlmu-pivotal commented on a diff in the pull request: https://github.com/apache/geode/pull/630#discussion_r127294096 --- Diff: geode-protobuf/src/main/java/org/apache/geode/protocol/protobuf/utilities/ProtobufUtilities.java --- @@ -133,21 +134,38 @@ /** * This will return the object encoded in a protobuf EncodedValue - * * @param serializationService - object which knows how to encode objects for the protobuf - *protocol {@link ProtobufSerializationService} + * protocol {@link ProtobufSerializationService} * @param encodedValue - The value to be decoded * @return the object encoded in the passed encodedValue * @throws UnsupportedEncodingTypeException - There isn't a SerializationType matching the - * encodedValues type + * encodedValues type * @throws CodecNotRegisteredForTypeException - There isn't a protobuf codec for the - * SerializationType matching the encodedValues type + * SerializationType matching the encodedValues type */ public static Object decodeValue(SerializationService serializationService, - BasicTypes.EncodedValue encodedValue) + BasicTypes.EncodedValue encodedValue) throws UnsupportedEncodingTypeException, CodecNotRegisteredForTypeException { BasicTypes.EncodingType encoding = encodedValue.getEncodingType(); byte[] bytes = encodedValue.getValue().toByteArray(); return serializationService.decode(encoding, bytes); } + + public static BasicTypes.Region createRegionMessageFromRegion(Region region) { +RegionAttributes regionAttributes = region.getAttributes(); +BasicTypes.Region.Builder protoRegionBuilder = BasicTypes.Region.newBuilder(); + +protoRegionBuilder.setName(region.getName()); +protoRegionBuilder.setSize(region.size()); + + protoRegionBuilder.setPersisted(regionAttributes.getDataPolicy().withPersistence()); + protoRegionBuilder.setKeyConstraint(regionAttributes.getKeyConstraint() == null ? "" --- End diff -- Correct. Amended according for both Key and Value constraint > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16086156#comment-16086156 ] ASF GitHub Bot commented on GEODE-3141: --- Github user kohlmu-pivotal commented on a diff in the pull request: https://github.com/apache/geode/pull/630#discussion_r127294137 --- Diff: geode-protobuf/src/test/java/org/apache/geode/protocol/RoundTripCacheConnectionJUnitTest.java --- @@ -278,6 +278,31 @@ public void useSSL_testNewProtocolHeaderLeadsToNewProtocolServerConnection() thr testNewProtocolHeaderLeadsToNewProtocolServerConnection(); } + @Test + public void testNewProtocolGetRegionCallSucceeds() throws Exception { +System.setProperty("geode.feature-protobuf-protocol", "true"); + +Socket socket = new Socket("localhost", cacheServerPort); +Awaitility.await().atMost(5, TimeUnit.SECONDS).until(socket::isConnected); +OutputStream outputStream = socket.getOutputStream(); +outputStream.write(110); + + +ProtobufProtocolSerializer protobufProtocolSerializer = new ProtobufProtocolSerializer(); +ClientProtocol.Message getRegionMessage = +MessageUtil.makeGetRegionRequestMessage(TEST_REGION, ClientProtocol.MessageHeader.newBuilder().build()); +protobufProtocolSerializer.serialize(getRegionMessage, outputStream); + +ClientProtocol.Message message = +protobufProtocolSerializer.deserialize(socket.getInputStream()); +assertEquals(ClientProtocol.Message.MessageTypeCase.RESPONSE, message.getMessageTypeCase()); +ClientProtocol.Response response = message.getResponse(); +assertEquals(ClientProtocol.Response.ResponseAPICase.GETREGIONRESPONSE, +response.getResponseAPICase()); +response.getGetRegionResponse(); +//TODO add some assertions for Region data --- End diff -- Resolved > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16086147#comment-16086147 ] ASF GitHub Bot commented on GEODE-3141: --- Github user WireBaron commented on a diff in the pull request: https://github.com/apache/geode/pull/630#discussion_r127292855 --- Diff: geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/PutAllRequestOperationHandlerJUnitTest.java --- @@ -14,6 +14,14 @@ */ package org.apache.geode.protocol.protobuf.operations; +import static org.mockito.Mockito.any; --- End diff -- Have you updated your IntelliJ style guide file with the June 13 version? They've modified the order of imports somewhat. > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16086137#comment-16086137 ] ASF GitHub Bot commented on GEODE-3141: --- Github user WireBaron commented on a diff in the pull request: https://github.com/apache/geode/pull/630#discussion_r127290974 --- Diff: geode-protobuf/src/test/java/org/apache/geode/protocol/RoundTripCacheConnectionJUnitTest.java --- @@ -278,6 +278,31 @@ public void useSSL_testNewProtocolHeaderLeadsToNewProtocolServerConnection() thr testNewProtocolHeaderLeadsToNewProtocolServerConnection(); } + @Test + public void testNewProtocolGetRegionCallSucceeds() throws Exception { +System.setProperty("geode.feature-protobuf-protocol", "true"); + +Socket socket = new Socket("localhost", cacheServerPort); +Awaitility.await().atMost(5, TimeUnit.SECONDS).until(socket::isConnected); +OutputStream outputStream = socket.getOutputStream(); +outputStream.write(110); + + +ProtobufProtocolSerializer protobufProtocolSerializer = new ProtobufProtocolSerializer(); +ClientProtocol.Message getRegionMessage = +MessageUtil.makeGetRegionRequestMessage(TEST_REGION, ClientProtocol.MessageHeader.newBuilder().build()); +protobufProtocolSerializer.serialize(getRegionMessage, outputStream); + +ClientProtocol.Message message = +protobufProtocolSerializer.deserialize(socket.getInputStream()); +assertEquals(ClientProtocol.Message.MessageTypeCase.RESPONSE, message.getMessageTypeCase()); +ClientProtocol.Response response = message.getResponse(); +assertEquals(ClientProtocol.Response.ResponseAPICase.GETREGIONRESPONSE, +response.getResponseAPICase()); +response.getGetRegionResponse(); +//TODO add some assertions for Region data --- End diff -- Can we resolve this TODO before pushing this? > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16086129#comment-16086129 ] ASF GitHub Bot commented on GEODE-3141: --- Github user WireBaron commented on a diff in the pull request: https://github.com/apache/geode/pull/630#discussion_r127289766 --- Diff: geode-protobuf/src/main/java/org/apache/geode/protocol/protobuf/utilities/ProtobufUtilities.java --- @@ -133,21 +134,38 @@ /** * This will return the object encoded in a protobuf EncodedValue - * * @param serializationService - object which knows how to encode objects for the protobuf - *protocol {@link ProtobufSerializationService} + * protocol {@link ProtobufSerializationService} * @param encodedValue - The value to be decoded * @return the object encoded in the passed encodedValue * @throws UnsupportedEncodingTypeException - There isn't a SerializationType matching the - * encodedValues type + * encodedValues type * @throws CodecNotRegisteredForTypeException - There isn't a protobuf codec for the - * SerializationType matching the encodedValues type + * SerializationType matching the encodedValues type */ public static Object decodeValue(SerializationService serializationService, - BasicTypes.EncodedValue encodedValue) + BasicTypes.EncodedValue encodedValue) throws UnsupportedEncodingTypeException, CodecNotRegisteredForTypeException { BasicTypes.EncodingType encoding = encodedValue.getEncodingType(); byte[] bytes = encodedValue.getValue().toByteArray(); return serializationService.decode(encoding, bytes); } + + public static BasicTypes.Region createRegionMessageFromRegion(Region region) { +RegionAttributes regionAttributes = region.getAttributes(); +BasicTypes.Region.Builder protoRegionBuilder = BasicTypes.Region.newBuilder(); + +protoRegionBuilder.setName(region.getName()); +protoRegionBuilder.setSize(region.size()); + + protoRegionBuilder.setPersisted(regionAttributes.getDataPolicy().withPersistence()); + protoRegionBuilder.setKeyConstraint(regionAttributes.getKeyConstraint() == null ? "" --- End diff -- For when we don't have a key constaint, will protoRegionBuilder.setKeyConstraint("") do the same thing as simply not setting this field? > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16086124#comment-16086124 ] ASF GitHub Bot commented on GEODE-3141: --- Github user kohlmu-pivotal commented on a diff in the pull request: https://github.com/apache/geode/pull/630#discussion_r127289396 --- Diff: geode-protobuf/src/main/java/org/apache/geode/protocol/protobuf/operations/RemoveRequestOperationHandler.java --- @@ -33,7 +33,7 @@ @Override public ClientProtocol.Response process(SerializationService serializationService, - ClientProtocol.Request request, Cache cache) { + ClientProtocol.Request request, Cache cache) { --- End diff -- I forgot to run spotlessApply. Travis confirms the the failure. > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16086126#comment-16086126 ] ASF GitHub Bot commented on GEODE-3141: --- Github user kohlmu-pivotal commented on a diff in the pull request: https://github.com/apache/geode/pull/630#discussion_r127289486 --- Diff: geode-protobuf/src/test/java/org/apache/geode/protocol/RoundTripCacheConnectionJUnitTest.java --- @@ -278,6 +278,31 @@ public void useSSL_testNewProtocolHeaderLeadsToNewProtocolServerConnection() thr testNewProtocolHeaderLeadsToNewProtocolServerConnection(); } + @Test + public void testNewProtocolGetRegionCallSucceeds() throws Exception { +System.setProperty("geode.feature-protobuf-protocol", "true"); + +Socket socket = new Socket("localhost", cacheServerPort); +Awaitility.await().atMost(5, TimeUnit.SECONDS).until(socket::isConnected); +OutputStream outputStream = socket.getOutputStream(); +outputStream.write(110); + + +ProtobufProtocolSerializer protobufProtocolSerializer = new ProtobufProtocolSerializer(); +ClientProtocol.Message getRegionMessage = +MessageUtil.makeGetRegionRequestMessage(TEST_REGION, ClientProtocol.MessageHeader.newBuilder().build()); +protobufProtocolSerializer.serialize(getRegionMessage, outputStream); + +ClientProtocol.Message message = +protobufProtocolSerializer.deserialize(socket.getInputStream()); +assertEquals(ClientProtocol.Message.MessageTypeCase.RESPONSE, message.getMessageTypeCase()); +ClientProtocol.Response response = message.getResponse(); +assertEquals(ClientProtocol.Response.ResponseAPICase.GETREGIONRESPONSE, +response.getResponseAPICase()); +response.getGetRegionResponse(); +//TODO add some assertions for Region data --- End diff -- I'll amend and add the checks now, rather than later > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16086127#comment-16086127 ] ASF GitHub Bot commented on GEODE-3141: --- Github user kohlmu-pivotal commented on a diff in the pull request: https://github.com/apache/geode/pull/630#discussion_r127289532 --- Diff: geode-protobuf/src/main/proto/basicTypes.proto --- @@ -52,7 +52,12 @@ message CallbackArguments { message Region { string name = 1; -// TODO: key, value types? +string type = 2; --- End diff -- I like that idea. Will amend > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16086094#comment-16086094 ] ASF GitHub Bot commented on GEODE-3141: --- Github user WireBaron commented on a diff in the pull request: https://github.com/apache/geode/pull/630#discussion_r127285451 --- Diff: geode-protobuf/src/main/java/org/apache/geode/protocol/protobuf/operations/RemoveRequestOperationHandler.java --- @@ -33,7 +33,7 @@ @Override public ClientProtocol.Response process(SerializationService serializationService, - ClientProtocol.Request request, Cache cache) { + ClientProtocol.Request request, Cache cache) { --- End diff -- Does this pass spotless? I thought all of these wonky indentations were actually introduced by spotlessApply? > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16086089#comment-16086089 ] ASF GitHub Bot commented on GEODE-3141: --- Github user pivotal-amurmann commented on a diff in the pull request: https://github.com/apache/geode/pull/630#discussion_r127285154 --- Diff: geode-protobuf/src/test/java/org/apache/geode/protocol/RoundTripCacheConnectionJUnitTest.java --- @@ -278,6 +278,31 @@ public void useSSL_testNewProtocolHeaderLeadsToNewProtocolServerConnection() thr testNewProtocolHeaderLeadsToNewProtocolServerConnection(); } + @Test + public void testNewProtocolGetRegionCallSucceeds() throws Exception { +System.setProperty("geode.feature-protobuf-protocol", "true"); + +Socket socket = new Socket("localhost", cacheServerPort); +Awaitility.await().atMost(5, TimeUnit.SECONDS).until(socket::isConnected); +OutputStream outputStream = socket.getOutputStream(); +outputStream.write(110); + + +ProtobufProtocolSerializer protobufProtocolSerializer = new ProtobufProtocolSerializer(); +ClientProtocol.Message getRegionMessage = +MessageUtil.makeGetRegionRequestMessage(TEST_REGION, ClientProtocol.MessageHeader.newBuilder().build()); +protobufProtocolSerializer.serialize(getRegionMessage, outputStream); + +ClientProtocol.Message message = +protobufProtocolSerializer.deserialize(socket.getInputStream()); +assertEquals(ClientProtocol.Message.MessageTypeCase.RESPONSE, message.getMessageTypeCase()); +ClientProtocol.Response response = message.getResponse(); +assertEquals(ClientProtocol.Response.ResponseAPICase.GETREGIONRESPONSE, +response.getResponseAPICase()); +response.getGetRegionResponse(); +//TODO add some assertions for Region data --- End diff -- Can we either add the assertions or put a chore in the backlog to backfill this? > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16086073#comment-16086073 ] ASF GitHub Bot commented on GEODE-3141: --- Github user bschuchardt commented on a diff in the pull request: https://github.com/apache/geode/pull/630#discussion_r127276853 --- Diff: geode-protobuf/src/main/proto/basicTypes.proto --- @@ -52,7 +52,12 @@ message CallbackArguments { message Region { string name = 1; -// TODO: key, value types? +string type = 2; --- End diff -- While I don't really like the name "dataPolicy" it seems like renaming it could cause confusion. Geode docs don't mention a Region "type". > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes >Assignee: Udo Kohlmeyer > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16084966#comment-16084966 ] ASF GitHub Bot commented on GEODE-3141: --- GitHub user kohlmu-pivotal opened a pull request: https://github.com/apache/geode/pull/630 GEODE-3141: GetRegion Operation implemented Added OperationHandlerJUnitTest.java as parents class of all OperationHandler tests. General clean up of all `public static final` fields Thank you for submitting a contribution to Apache Geode. In order to streamline the review of the contribution we ask you to ensure the following steps have been taken: ### For all changes: - [x ] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message? - [ x] Has your PR been rebased against the latest commit within the target branch (typically `develop`)? - [x ] Is your initial contribution a single, squashed commit? - [ ] Does `gradlew build` run cleanly? - [x ] Have you written or updated unit tests to verify your changes? - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? ### Note: Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible. If you need help, please send an email to d...@geode.apache.org. @galen-pivotal @hiteshk25 @bschuchardt @WireBaron @pivotal-amurmann You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/geode feature/GEODE-3141 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/geode/pull/630.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 #630 commit 0f0fa0c08b5a66200055a5fc1a008881f5be95ab Author: Udo Kohlmeyer Date: 2017-07-13T00:22:55Z GEODE-3141: GetRegion Operation implemented Added OperationHandlerJUnitTest.java as parents class of all OperationHandler tests. General clean up of all `public static final` fields > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3141) New flow: GetRegion
[ https://issues.apache.org/jira/browse/GEODE-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16084962#comment-16084962 ] ASF subversion and git services commented on GEODE-3141: Commit 0f0fa0c08b5a66200055a5fc1a008881f5be95ab in geode's branch refs/heads/feature/GEODE-3141 from [~ukohlmeyer] [ https://git-wip-us.apache.org/repos/asf?p=geode.git;h=0f0fa0c ] GEODE-3141: GetRegion Operation implemented Added OperationHandlerJUnitTest.java as parents class of all OperationHandler tests. General clean up of all `public static final` fields > New flow: GetRegion > --- > > Key: GEODE-3141 > URL: https://issues.apache.org/jira/browse/GEODE-3141 > Project: Geode > Issue Type: Sub-task > Components: client/server >Reporter: Brian Baynes > > Users of the new client/server protocol need to be able to verify a region > exists in the cache. Implement GetRegion message/handler, returning boolean > success(/failure) based on the existence of a Region when passed a Region > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)