mirror of https://github.com/grpc/grpc-java.git
services: make BinlogHelper compatible with lite runtime
This commit makes a small change to BinlogHelper to make it compatible with the Protobuf Java Lite runtime. In the Lite runtime, the `addXBuilder` for repeated fields is not available. Instead, the `addX` method must be used with a manually-constructed Builder.
This commit is contained in:
parent
55a9c012c3
commit
3e3ba56838
|
|
@ -53,6 +53,7 @@ import io.grpc.binarylog.v1.Address;
|
|||
import io.grpc.binarylog.v1.GrpcLogEntry;
|
||||
import io.grpc.binarylog.v1.GrpcLogEntry.EventType;
|
||||
import io.grpc.binarylog.v1.Message;
|
||||
import io.grpc.binarylog.v1.MetadataEntry;
|
||||
import java.net.Inet4Address;
|
||||
import java.net.Inet6Address;
|
||||
import java.net.InetAddress;
|
||||
|
|
@ -851,9 +852,8 @@ final class BinlogHelper {
|
|||
truncated = true;
|
||||
continue;
|
||||
}
|
||||
metaBuilder.addEntryBuilder()
|
||||
.setKey(key)
|
||||
.setValue(ByteString.copyFrom(value));
|
||||
metaBuilder.addEntry(
|
||||
MetadataEntry.newBuilder().setKey(key).setValue(ByteString.copyFrom(value)));
|
||||
if (!forceInclude) {
|
||||
// force included keys do not count towards the size limit
|
||||
curBytes = bytesAfterAdd;
|
||||
|
|
|
|||
Loading…
Reference in New Issue