stoty commented on code in PR #202: URL: https://github.com/apache/phoenix-omid/pull/202#discussion_r2358816702
########## common/src/main/proto/TSOProto.proto: ########## @@ -16,51 +16,52 @@ // limitations under the License. // +syntax = "proto3"; option java_package = "org.apache.omid.proto"; option optimize_for = SPEED; message Request { - optional TimestampRequest timestampRequest = 1; - optional CommitRequest commitRequest = 2; - optional HandshakeRequest handshakeRequest = 3; - optional FenceRequest fenceRequest = 4; + TimestampRequest timestampRequest = 1; + CommitRequest commitRequest = 2; + HandshakeRequest handshakeRequest = 3; + FenceRequest fenceRequest = 4; } message TimestampRequest { } message CommitRequest { - optional int64 startTimestamp = 1; - optional bool isRetry = 2 [default = false]; + int64 startTimestamp = 1; + bool isRetry = 2; repeated int64 cellId = 3; repeated int64 TableId = 4; } message FenceRequest { - optional int64 TableId = 1; + int64 TableId = 1; } message Response { - optional TimestampResponse timestampResponse = 1; - optional CommitResponse commitResponse = 2; - optional HandshakeResponse handshakeResponse = 3; - optional FenceResponse fenceResponse = 4; + TimestampResponse timestampResponse = 1; + CommitResponse commitResponse = 2; + HandshakeResponse handshakeResponse = 3; + FenceResponse fenceResponse = 4; } message TimestampResponse { - optional int64 startTimestamp = 1; + int64 startTimestamp = 1; } message FenceResponse { - optional int64 TableId = 1; - optional int64 FenceId = 2; + int64 TableId = 1; + int64 FenceId = 2; } message CommitResponse { - optional bool aborted = 1; - optional int64 startTimestamp = 2; - optional int64 commitTimestamp = 3; + bool aborted = 1; Review Comment: why did you remove the optional keywords ? According to https://protobuf.dev/programming-guides/proto3/ it is still supported. ########## common/src/main/java/org/apache/omid/protobuf/OmidProtobufDecoder.java: ########## @@ -0,0 +1,135 @@ +/* + * 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.omid.protobuf; + +import org.apache.phoenix.thirdparty.com.google.protobuf.ExtensionRegistry; +import org.apache.phoenix.thirdparty.com.google.protobuf.ExtensionRegistryLite; +import org.apache.phoenix.thirdparty.com.google.protobuf.Message; +import org.apache.phoenix.thirdparty.com.google.protobuf.MessageLite; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufUtil; +import io.netty.channel.ChannelHandler.Sharable; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelPipeline; +import io.netty.handler.codec.ByteToMessageDecoder; +import io.netty.handler.codec.LengthFieldBasedFrameDecoder; +import io.netty.handler.codec.LengthFieldPrepender; +import io.netty.handler.codec.MessageToMessageDecoder; +import io.netty.util.internal.ObjectUtil; + +import java.util.List; + +/** Review Comment: Please add a note explaining where this was copied from and why ########## common/src/main/java/org/apache/omid/protobuf/OmidProtobufEncoder.java: ########## @@ -0,0 +1,76 @@ +/* + * 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.omid.protobuf; + +import org.apache.phoenix.thirdparty.com.google.protobuf.Message; +import org.apache.phoenix.thirdparty.com.google.protobuf.MessageLite; +import org.apache.phoenix.thirdparty.com.google.protobuf.MessageLiteOrBuilder; +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandler.Sharable; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelPipeline; +import io.netty.handler.codec.LengthFieldBasedFrameDecoder; +import io.netty.handler.codec.LengthFieldPrepender; +import io.netty.handler.codec.MessageToMessageEncoder; + +import java.util.List; + +import static io.netty.buffer.Unpooled.wrappedBuffer; + +/** Review Comment: Please add a note explaining where this was copied from and why -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@phoenix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org