diff --git a/internal/venice-common/src/main/java/com/linkedin/venice/grpc/GrpcUtils.java b/internal/venice-common/src/main/java/com/linkedin/venice/grpc/GrpcUtils.java index 04da3f684b1..a13a01c683a 100644 --- a/internal/venice-common/src/main/java/com/linkedin/venice/grpc/GrpcUtils.java +++ b/internal/venice-common/src/main/java/com/linkedin/venice/grpc/GrpcUtils.java @@ -109,4 +109,8 @@ public static ByteString toByteString(ByteBuf body) { // Fallback to nioBuffer() to handle the conversion efficiently return ByteString.copyFrom(body.nioBuffer()); } + + public static ByteString toByteString(byte[] bytes) { + return ByteString.copyFrom(bytes); + } } diff --git a/services/venice-server/src/main/java/com/linkedin/venice/grpc/VeniceGrpcReadServiceImpl.java b/services/venice-server/src/main/java/com/linkedin/venice/grpc/VeniceGrpcReadServiceImpl.java index fa4019e8ff6..4e74f24e4eb 100644 --- a/services/venice-server/src/main/java/com/linkedin/venice/grpc/VeniceGrpcReadServiceImpl.java +++ b/services/venice-server/src/main/java/com/linkedin/venice/grpc/VeniceGrpcReadServiceImpl.java @@ -7,6 +7,7 @@ import static com.linkedin.venice.listener.StorageReadRequestHandler.VENICE_STORAGE_NODE_HARDWARE_IS_NOT_HEALTHY_MSG; import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.protobuf.ByteString; import com.linkedin.davinci.listener.response.ServerCurrentVersionResponse; import com.linkedin.davinci.listener.response.TopicPartitionIngestionContextResponse; import com.linkedin.davinci.storage.DiskHealthCheckService; @@ -45,8 +46,6 @@ import com.linkedin.venice.response.VeniceReadResponseStatus; import com.linkedin.venice.utils.ObjectMapperFactory; import io.grpc.stub.StreamObserver; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -293,16 +292,16 @@ public void handleAdminRequest(AdminRequest request, StreamObserver