[GitHub] geode pull request #661: GEODE-3319 - refactor to use protobuf encoding for ...
Github user asfgit closed the pull request at: https://github.com/apache/geode/pull/661 --- 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] geode pull request #661: GEODE-3319 - refactor to use protobuf encoding for ...
Github user galen-pivotal commented on a diff in the pull request: https://github.com/apache/geode/pull/661#discussion_r130494367 --- Diff: geode-protobuf/src/main/java/org/apache/geode/protocol/protobuf/utilities/ProtobufPrimitiveTypes.java --- @@ -0,0 +1,47 @@ +/* + * 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.protocol.protobuf.utilities; + +import org.apache.geode.protocol.protobuf.utilities.exception.UnknownProtobufPrimitiveType; + +public enum ProtobufPrimitiveTypes { --- End diff -- I think it's better to use the singular `ProtobufPrimitiveType` here, since each represents a protobuf primitive type. --- 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] geode pull request #661: GEODE-3319 - refactor to use protobuf encoding for ...
Github user galen-pivotal commented on a diff in the pull request: https://github.com/apache/geode/pull/661#discussion_r130495450 --- Diff: geode-protobuf/src/main/java/org/apache/geode/protocol/protobuf/utilities/ProtobufPrimitiveTypes.java --- @@ -0,0 +1,47 @@ +/* + * 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.protocol.protobuf.utilities; + +import org.apache.geode.protocol.protobuf.utilities.exception.UnknownProtobufPrimitiveType; + +public enum ProtobufPrimitiveTypes { + + STRING(String.class), + INT(Integer.class), + LONG(Long.class), + SHORT(Short.class), + BYTE(Byte.class), + BOOLEAN(Boolean.class), + DOUBLE(Double.class), + FLOAT(Float.class), + BINARY(byte[].class); + + private Class clazzType; + + ProtobufPrimitiveTypes(Class clazz) { +this.clazzType = clazz; + } + + public static ProtobufPrimitiveTypes valueOf(Class unencodedValueClass) + throws UnknownProtobufPrimitiveType { +for (ProtobufPrimitiveTypes protobufPrimitiveTypes : values()) { --- End diff -- I think the variable here should be singular as well. --- 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] geode pull request #661: GEODE-3319 - refactor to use protobuf encoding for ...
Github user galen-pivotal commented on a diff in the pull request: https://github.com/apache/geode/pull/661#discussion_r130494791 --- Diff: geode-protobuf/src/main/java/org/apache/geode/protocol/protobuf/utilities/ProtobufPrimitiveTypes.java --- @@ -0,0 +1,47 @@ +/* + * 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.protocol.protobuf.utilities; + +import org.apache.geode.protocol.protobuf.utilities.exception.UnknownProtobufPrimitiveType; + +public enum ProtobufPrimitiveTypes { + + STRING(String.class), + INT(Integer.class), + LONG(Long.class), + SHORT(Short.class), + BYTE(Byte.class), + BOOLEAN(Boolean.class), + DOUBLE(Double.class), + FLOAT(Float.class), + BINARY(byte[].class); + + private Class clazzType; --- End diff -- I think `clazz` would be clearer than `clazzType`. What is a type of class? --- 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] geode pull request #661: GEODE-3319 - refactor to use protobuf encoding for ...
Github user galen-pivotal commented on a diff in the pull request: https://github.com/apache/geode/pull/661#discussion_r130779627 --- Diff: geode-protobuf/src/main/java/org/apache/geode/protocol/protobuf/operations/PutRequestOperationHandler.java --- @@ -50,10 +50,7 @@ return Success.of(RegionAPI.PutResponse.newBuilder().build()); } catch (ClassCastException ex) { return Failure.of(BasicTypes.ErrorResponse.newBuilder() -.setMessage("invalid key or value type for region " + regionName + ",passed key: " --- End diff -- I'm curious why you chose to shrink the message here; what am I missing? --- 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] geode pull request #661: GEODE-3319 - refactor to use protobuf encoding for ...
GitHub user WireBaron opened a pull request: https://github.com/apache/geode/pull/661 GEODE-3319 - refactor to use protobuf encoding for primitive types @pivotal-amurmann @galen-pivotal @hiteshk25 @kohlmu-pivotal @bschuchardt This changes protobuf EncodedValue messages to store data formats that protobuf can natively recognize as those types and only use byte encoding for more complicated object types. Signed-off-by: Brian RoweSigned-off-by: Hitesh Khamesra Signed-off-by: Udo Kohlmeyer 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? - [x] 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 dev@geode.apache.org. You can merge this pull request into a Git repository by running: $ git pull https://github.com/WireBaron/geode feature/GEODE-3319 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/geode/pull/661.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 #661 commit 48aadab39a5f3cf1714a40c743dc9f2f0590bc3a Author: Hitesh Khamesra Date: 2017-07-27T00:49:27Z GEODE-3319 - refactor to use protobuf encoding for primitive types Signed-off-by: Hitesh Khamesra Signed-off-by: Udo Kohlmeyer Signed-off-by: Brian Rowe --- 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. ---