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;
|
||||||
import io.grpc.binarylog.v1.GrpcLogEntry.EventType;
|
import io.grpc.binarylog.v1.GrpcLogEntry.EventType;
|
||||||
import io.grpc.binarylog.v1.Message;
|
import io.grpc.binarylog.v1.Message;
|
||||||
|
import io.grpc.binarylog.v1.MetadataEntry;
|
||||||
import java.net.Inet4Address;
|
import java.net.Inet4Address;
|
||||||
import java.net.Inet6Address;
|
import java.net.Inet6Address;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
|
|
@ -851,9 +852,8 @@ final class BinlogHelper {
|
||||||
truncated = true;
|
truncated = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
metaBuilder.addEntryBuilder()
|
metaBuilder.addEntry(
|
||||||
.setKey(key)
|
MetadataEntry.newBuilder().setKey(key).setValue(ByteString.copyFrom(value)));
|
||||||
.setValue(ByteString.copyFrom(value));
|
|
||||||
if (!forceInclude) {
|
if (!forceInclude) {
|
||||||
// force included keys do not count towards the size limit
|
// force included keys do not count towards the size limit
|
||||||
curBytes = bytesAfterAdd;
|
curBytes = bytesAfterAdd;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue