[ 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)