diff --git a/ingester-common/src/main/java/com/google/protobuf/ByteStringHelper.java b/ingester-common/src/main/java/com/google/protobuf/ByteStringHelper.java deleted file mode 100644 index 6a7c92a..0000000 --- a/ingester-common/src/main/java/com/google/protobuf/ByteStringHelper.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2023 Greptime Team - * - * Licensed 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 com.google.protobuf; - -/** - * A {@code ByteString} helper, avoid some memory copying to improve performance. - */ -public class ByteStringHelper { - - /** - * Wrap a byte array into a ByteString. - */ - public static ByteString wrap(byte[] bs) { - return ByteString.wrap(bs); - } -} diff --git a/ingester-protocol/src/main/java/io/greptime/models/RowHelper.java b/ingester-protocol/src/main/java/io/greptime/models/RowHelper.java index 15b1f3f..e00bb6e 100644 --- a/ingester-protocol/src/main/java/io/greptime/models/RowHelper.java +++ b/ingester-protocol/src/main/java/io/greptime/models/RowHelper.java @@ -16,7 +16,7 @@ package io.greptime.models; -import com.google.protobuf.ByteStringHelper; +import com.google.protobuf.UnsafeByteOperations; import io.greptime.v1.Common; import io.greptime.v1.RowData; @@ -71,7 +71,7 @@ public static void addValue( valueBuilder.setBoolValue((boolean) value); break; case BINARY: - valueBuilder.setBinaryValue(ByteStringHelper.wrap((byte[]) value)); + valueBuilder.setBinaryValue(UnsafeByteOperations.unsafeWrap((byte[]) value)); break; case STRING: valueBuilder.setStringValue((String) value);