mirror of https://github.com/grpc/grpc-java.git
Upgrade to Checkstyle 8.28
Trying to upgrade Gradle to 7.6 improved the checkstyle plugin such that it appears to have been running in new occasions. That in turn exposed us to https://github.com/checkstyle/checkstyle/issues/5088. That bug was fixed in 8.28, which also fixed lots of other bugs. So now we have better checking and some existing volations needed fixing. Since the code style fixes generated a lot of noise, this is a pre-fix to reduce the size of a Gradle upgrade. I did not upgrade past 8.28 because at some point some other bugs were introduced, in particular with the Indentation module. I chose the oldest version that had the particular bug impacting me fixed. Upgrading to this old-but-newer version still makes it easier to upgrade to a newer version in the future.
This commit is contained in:
parent
d07ecbe037
commit
d17a2db4bd
|
|
@ -26,7 +26,7 @@ import io.grpc.alts.internal.AltsProtocolNegotiator;
|
|||
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/7864")
|
||||
public final class AltsContextUtil {
|
||||
|
||||
private AltsContextUtil(){}
|
||||
private AltsContextUtil() {}
|
||||
|
||||
/**
|
||||
* Creates a {@link AltsContext} from ALTS context information in the {@link ServerCall}.
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ public final class AltsTsiHandshaker implements TsiHandshaker {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns true if and only if the handshake is still in progress
|
||||
* Returns true if and only if the handshake is still in progress.
|
||||
*
|
||||
* @return true, if the handshake is still in progress, false otherwise.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ public final class NettyTsiHandshaker {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns true if and only if the handshake is still in progress
|
||||
* Returns true if and only if the handshake is still in progress.
|
||||
*
|
||||
* @return true, if the handshake is still in progress, false otherwise.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public interface TsiHandshaker {
|
|||
boolean processBytesFromPeer(ByteBuffer bytes) throws GeneralSecurityException;
|
||||
|
||||
/**
|
||||
* Returns true if and only if the handshake is still in progress
|
||||
* Returns true if and only if the handshake is still in progress.
|
||||
*
|
||||
* @return true, if the handshake is still in progress, false otherwise.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -834,7 +834,7 @@ public final class Metadata {
|
|||
abstract T parseBytes(byte[] serialized);
|
||||
|
||||
/**
|
||||
* @return whether this key will be serialized to bytes lazily.
|
||||
* Returns whether this key will be serialized to bytes lazily.
|
||||
*/
|
||||
boolean serializesToStreams() {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -205,6 +205,8 @@ public abstract class NameResolver {
|
|||
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1770")
|
||||
public abstract static class Listener2 implements Listener {
|
||||
/**
|
||||
* Handles updates on resolved addresses and attributes.
|
||||
*
|
||||
* @deprecated This will be removed in 1.22.0
|
||||
*/
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -599,6 +599,8 @@ public final class Status {
|
|||
}
|
||||
|
||||
/**
|
||||
* Percent encode bytes to make them ASCII.
|
||||
*
|
||||
* @param valueBytes the UTF-8 bytes
|
||||
* @param ri The reader index, pointed at the first byte that needs escaping.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ import io.grpc.stub.StreamObserver;
|
|||
import io.grpc.testing.protobuf.SimpleRequest;
|
||||
import io.grpc.testing.protobuf.SimpleResponse;
|
||||
import io.grpc.testing.protobuf.SimpleServiceGrpc;
|
||||
|
||||
import java.io.File;
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
|
|
|
|||
|
|
@ -87,23 +87,20 @@ public class TransportBenchmark {
|
|||
ServerBuilder<?> serverBuilder;
|
||||
ManagedChannelBuilder<?> channelBuilder;
|
||||
switch (transport) {
|
||||
case INPROCESS:
|
||||
{
|
||||
case INPROCESS: {
|
||||
String name = "bench" + Math.random();
|
||||
serverBuilder = InProcessServerBuilder.forName(name);
|
||||
channelBuilder = InProcessChannelBuilder.forName(name);
|
||||
break;
|
||||
}
|
||||
case NETTY:
|
||||
{
|
||||
case NETTY: {
|
||||
InetSocketAddress address = new InetSocketAddress("localhost", pickUnusedPort());
|
||||
serverBuilder = NettyServerBuilder.forAddress(address, serverCreds);
|
||||
channelBuilder = NettyChannelBuilder.forAddress(address)
|
||||
.negotiationType(NegotiationType.PLAINTEXT);
|
||||
break;
|
||||
}
|
||||
case NETTY_LOCAL:
|
||||
{
|
||||
case NETTY_LOCAL: {
|
||||
String name = "bench" + Math.random();
|
||||
LocalAddress address = new LocalAddress(name);
|
||||
EventLoopGroup group = new DefaultEventLoopGroup();
|
||||
|
|
@ -118,8 +115,7 @@ public class TransportBenchmark {
|
|||
groupToShutdown = group;
|
||||
break;
|
||||
}
|
||||
case NETTY_EPOLL:
|
||||
{
|
||||
case NETTY_EPOLL: {
|
||||
InetSocketAddress address = new InetSocketAddress("localhost", pickUnusedPort());
|
||||
|
||||
// Reflection used since they are only available on linux.
|
||||
|
|
@ -143,8 +139,7 @@ public class TransportBenchmark {
|
|||
groupToShutdown = group;
|
||||
break;
|
||||
}
|
||||
case OKHTTP:
|
||||
{
|
||||
case OKHTTP: {
|
||||
int port = pickUnusedPort();
|
||||
InetSocketAddress address = new InetSocketAddress("localhost", port);
|
||||
serverBuilder = NettyServerBuilder.forAddress(address, serverCreds);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import org.junit.runner.RunWith;
|
|||
import org.junit.runners.JUnit4;
|
||||
|
||||
/**
|
||||
* Basic tests for {@link io.grpc.benchmarks.driver.LoadWorker}
|
||||
* Basic tests for {@link io.grpc.benchmarks.driver.LoadWorker}.
|
||||
*/
|
||||
@RunWith(JUnit4.class)
|
||||
public class LoadWorkerTest {
|
||||
|
|
|
|||
|
|
@ -33,6 +33,11 @@
|
|||
<property name="eachLine" value="true"/>
|
||||
</module>
|
||||
|
||||
<module name="LineLength">
|
||||
<property name="max" value="100"/>
|
||||
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
|
||||
</module>
|
||||
|
||||
<module name="TreeWalker">
|
||||
<module name="OuterTypeFilename"/>
|
||||
<module name="IllegalTokenText">
|
||||
|
|
@ -45,10 +50,6 @@
|
|||
<property name="allowByTailComment" value="true"/>
|
||||
<property name="allowNonPrintableEscapes" value="true"/>
|
||||
</module>
|
||||
<module name="LineLength">
|
||||
<property name="max" value="100"/>
|
||||
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
|
||||
</module>
|
||||
<module name="AvoidStarImport"/>
|
||||
<!-- TODO(ejona): Upstream? -->
|
||||
<module name="UnusedImports"/>
|
||||
|
|
@ -59,12 +60,8 @@
|
|||
<property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
|
||||
</module>
|
||||
<module name="NeedBraces"/>
|
||||
<module name="LeftCurly">
|
||||
<property name="maxLineLength" value="100"/>
|
||||
</module>
|
||||
<module name="RightCurly"/>
|
||||
<module name="LeftCurly"/>
|
||||
<module name="RightCurly">
|
||||
<property name="option" value="alone"/>
|
||||
<property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/>
|
||||
</module>
|
||||
<module name="WhitespaceAround">
|
||||
|
|
@ -204,13 +201,10 @@
|
|||
<module name="JavadocMethod">
|
||||
<property name="scope" value="public"/>
|
||||
<property name="allowMissingParamTags" value="true"/>
|
||||
<property name="allowMissingThrowsTags" value="true"/>
|
||||
<property name="allowMissingReturnTag" value="true"/>
|
||||
<property name="minLineCount" value="2"/>
|
||||
<!-- TOOD(ejona): Too restrictive for tests
|
||||
<property name="allowedAnnotations" value="Override, Test"/-->
|
||||
<property name="allowedAnnotations" value="Override, Test, Before, After, BeforeClass, AfterClass, Setup, TearDown"/>
|
||||
<property name="allowThrowsTagsForSubclasses" value="true"/>
|
||||
</module>
|
||||
<module name="MethodName">
|
||||
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
|
||||
|
|
|
|||
|
|
@ -40,8 +40,9 @@ public final class InternalCensusTracingAccessor {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param addMessageEvents add message events to Spans
|
||||
* Returns the client interceptor that facilitates Census-based stats reporting.
|
||||
*
|
||||
* @param addMessageEvents add message events to Spans
|
||||
* @return a {@link ClientInterceptor} with default tracing implementation.
|
||||
*/
|
||||
public static ClientInterceptor getClientInterceptor(
|
||||
|
|
|
|||
|
|
@ -1000,6 +1000,8 @@ public class Context {
|
|||
*/
|
||||
public abstract static class Storage {
|
||||
/**
|
||||
* Unused.
|
||||
*
|
||||
* @deprecated This is an old API that is no longer used.
|
||||
*/
|
||||
@Deprecated
|
||||
|
|
@ -1029,7 +1031,7 @@ public class Context {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements {@link io.grpc.Context#detach}
|
||||
* Implements {@link io.grpc.Context#detach}.
|
||||
*
|
||||
* @param toDetach the context to be detached. Should be, or be equivalent to, the current
|
||||
* context of the current scope
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public final class Deadline implements Comparable<Deadline> {
|
|||
*
|
||||
* <p>This is <strong>EXPERIMENTAL</strong> API and may subject to change. If you'd like it to be
|
||||
* stabilized or have any feedback, please
|
||||
* <href a="https://github.com/grpc/grpc-java/issues/6030">let us know</a>.
|
||||
* <a href="https://github.com/grpc/grpc-java/issues/6030">let us know</a>.
|
||||
*
|
||||
* @since 1.24.0
|
||||
*/
|
||||
|
|
@ -81,7 +81,7 @@ public final class Deadline implements Comparable<Deadline> {
|
|||
*
|
||||
* <p>This is <strong>EXPERIMENTAL</strong> API and may subject to change. If you'd like it to be
|
||||
* stabilized or have any feedback, please
|
||||
* <href a="https://github.com/grpc/grpc-java/issues/6030">let us know</a>.
|
||||
* <a href="https://github.com/grpc/grpc-java/issues/6030">let us know</a>.
|
||||
*
|
||||
* @param duration A non-negative duration.
|
||||
* @param units The time unit for the duration.
|
||||
|
|
@ -113,7 +113,8 @@ public final class Deadline implements Comparable<Deadline> {
|
|||
}
|
||||
|
||||
/**
|
||||
* Has this deadline expired
|
||||
* Returns whether this has deadline expired.
|
||||
*
|
||||
* @return {@code true} if it has, otherwise {@code false}.
|
||||
*/
|
||||
public boolean isExpired() {
|
||||
|
|
@ -266,7 +267,7 @@ public final class Deadline implements Comparable<Deadline> {
|
|||
*
|
||||
* <p>This is <strong>EXPERIMENTAL</strong> API and may subject to change. If you'd like it to be
|
||||
* stabilized or have any feedback, please
|
||||
* <href a="https://github.com/grpc/grpc-java/issues/6030">let us know</a>.
|
||||
* <a href="https://github.com/grpc/grpc-java/issues/6030">let us know</a>.
|
||||
*
|
||||
* <p>In general implementations should be thread-safe, unless it's implemented and used in a
|
||||
* localized environment (like unit tests) where you are sure the usages are synchronized.
|
||||
|
|
|
|||
|
|
@ -29,7 +29,9 @@ public final class InProcessSocketAddress extends SocketAddress {
|
|||
private final String name;
|
||||
|
||||
/**
|
||||
* @param name - The name of the inprocess channel or server.
|
||||
* Construct an address for a server identified by name.
|
||||
*
|
||||
* @param name The name of the inprocess server.
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public InProcessSocketAddress(String name) {
|
||||
|
|
@ -37,7 +39,7 @@ public final class InProcessSocketAddress extends SocketAddress {
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the name of the inprocess channel or server.
|
||||
* Gets the name of the inprocess server.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -46,6 +48,8 @@ public final class InProcessSocketAddress extends SocketAddress {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns {@link #getName}.
|
||||
*
|
||||
* @since 1.14.0
|
||||
*/
|
||||
@Override
|
||||
|
|
@ -53,15 +57,14 @@ public final class InProcessSocketAddress extends SocketAddress {
|
|||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.15.0
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return name.hashCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@code true} if the object is of the same type and server names match.
|
||||
*
|
||||
* @since 1.15.0
|
||||
*/
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -411,6 +411,7 @@ public class DnsNameResolver extends NameResolver {
|
|||
}
|
||||
|
||||
/**
|
||||
* Parse TXT service config records as JSON.
|
||||
*
|
||||
* @throws IOException if one of the txt records contains improperly formatted JSON.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -650,7 +650,7 @@ public final class GrpcUtil {
|
|||
/**
|
||||
* Marshals a nanoseconds representation of the timeout to and from a string representation,
|
||||
* consisting of an ASCII decimal representation of a number with at most 8 digits, followed by a
|
||||
* unit:
|
||||
* unit. Available units:
|
||||
* n = nanoseconds
|
||||
* u = microseconds
|
||||
* m = milliseconds
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ package io.grpc.internal;
|
|||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.google.common.base.Throwables;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
|
|
|
|||
|
|
@ -150,6 +150,8 @@ class ProxyDetectorImpl implements ProxyDetector {
|
|||
};
|
||||
|
||||
/**
|
||||
* Experimental environment variable name for enabling proxy support.
|
||||
*
|
||||
* @deprecated Use the standard Java proxy configuration instead with flags such as:
|
||||
* -Dhttps.proxyHost=HOST -Dhttps.proxyPort=PORT
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ final class ServiceConfigState {
|
|||
private boolean updated;
|
||||
|
||||
/**
|
||||
* Construct new instance.
|
||||
*
|
||||
* @param defaultServiceConfig The initial service config, or {@code null} if absent.
|
||||
* @param lookUpServiceConfig {@code true} if service config updates might occur.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -22,10 +22,10 @@ import io.grpc.ChannelLogger;
|
|||
import io.grpc.ConnectivityState;
|
||||
import io.grpc.EquivalentAddressGroup;
|
||||
import io.grpc.ExperimentalApi;
|
||||
import io.grpc.LoadBalancer;
|
||||
import io.grpc.LoadBalancer.CreateSubchannelArgs;
|
||||
import io.grpc.LoadBalancer.Subchannel;
|
||||
import io.grpc.LoadBalancer.SubchannelPicker;
|
||||
import io.grpc.LoadBalancer;
|
||||
import io.grpc.ManagedChannel;
|
||||
import io.grpc.ManagedChannelBuilder;
|
||||
import io.grpc.NameResolver;
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public final class MutableHandlerRegistry extends HandlerRegistry {
|
|||
}
|
||||
|
||||
/**
|
||||
* Removes a registered service
|
||||
* Removes a registered service.
|
||||
*
|
||||
* @return true if the service was found to be removed.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -495,6 +495,8 @@ public class MessageDeframerTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* Verify stats were published through the tracer.
|
||||
*
|
||||
* @param transportStats the transport level stats counters
|
||||
* @param clock the fakeClock to verify timestamp
|
||||
* @param sizes in the format {wire0, uncompressed0, wire1, uncompressed1, ...}
|
||||
|
|
|
|||
|
|
@ -373,6 +373,8 @@ public class MessageFramerTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* Verify stats were published through the tracer.
|
||||
*
|
||||
* @param sizes in the format {wire0, uncompressed0, wire1, uncompressed1, ...}
|
||||
*/
|
||||
private void checkStats(long... sizes) {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ import io.grpc.ServerCall;
|
|||
import io.grpc.ServerCallHandler;
|
||||
import io.grpc.ServerInterceptor;
|
||||
import io.grpc.Status;
|
||||
|
||||
import io.grpc.gcp.observability.interceptors.ConfigFilterHelper.FilterParams;
|
||||
import io.grpc.observabilitylog.v1.GrpcLogRecord.EventLogger;
|
||||
import io.grpc.observabilitylog.v1.GrpcLogRecord.EventType;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ import java.util.Collections;
|
|||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
# Breaks on upgrade: https://github.com/mojohaus/animal-sniffer/issues/131
|
||||
animalsniffer = "1.18"
|
||||
autovalue = "1.9"
|
||||
checkstyle = "6.17"
|
||||
checkstyle = "8.28"
|
||||
googleauth = "1.4.0"
|
||||
guava = "31.1-android"
|
||||
netty = '4.1.79.Final'
|
||||
|
|
|
|||
|
|
@ -2126,7 +2126,7 @@ public abstract class AbstractInteropTest {
|
|||
}
|
||||
}
|
||||
|
||||
/** Helper for getting remote address from {@link io.grpc.ServerCall#getAttributes()} */
|
||||
/** Helper for getting remote address from {@link io.grpc.ServerCall#getAttributes()}. */
|
||||
protected SocketAddress obtainRemoteClientAddr() {
|
||||
TestServiceGrpc.TestServiceBlockingStub stub =
|
||||
blockingStub.withDeadlineAfter(5, TimeUnit.SECONDS);
|
||||
|
|
@ -2136,7 +2136,7 @@ public abstract class AbstractInteropTest {
|
|||
return serverCallCapture.get().getAttributes().get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR);
|
||||
}
|
||||
|
||||
/** Helper for getting remote address from {@link io.grpc.ClientCall#getAttributes()} */
|
||||
/** Helper for getting remote address from {@link io.grpc.ClientCall#getAttributes()}. */
|
||||
protected SocketAddress obtainRemoteServerAddr() {
|
||||
TestServiceGrpc.TestServiceBlockingStub stub = blockingStub
|
||||
.withInterceptors(recordClientCallInterceptor(clientCallCapture))
|
||||
|
|
@ -2147,7 +2147,7 @@ public abstract class AbstractInteropTest {
|
|||
return clientCallCapture.get().getAttributes().get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR);
|
||||
}
|
||||
|
||||
/** Helper for getting local address from {@link io.grpc.ServerCall#getAttributes()} */
|
||||
/** Helper for getting local address from {@link io.grpc.ServerCall#getAttributes()}. */
|
||||
protected SocketAddress obtainLocalServerAddr() {
|
||||
TestServiceGrpc.TestServiceBlockingStub stub =
|
||||
blockingStub.withDeadlineAfter(5, TimeUnit.SECONDS);
|
||||
|
|
@ -2157,7 +2157,7 @@ public abstract class AbstractInteropTest {
|
|||
return serverCallCapture.get().getAttributes().get(Grpc.TRANSPORT_ATTR_LOCAL_ADDR);
|
||||
}
|
||||
|
||||
/** Helper for getting local address from {@link io.grpc.ClientCall#getAttributes()} */
|
||||
/** Helper for getting local address from {@link io.grpc.ClientCall#getAttributes()}. */
|
||||
protected SocketAddress obtainLocalClientAddr() {
|
||||
TestServiceGrpc.TestServiceBlockingStub stub = blockingStub
|
||||
.withInterceptors(recordClientCallInterceptor(clientCallCapture))
|
||||
|
|
@ -2168,7 +2168,7 @@ public abstract class AbstractInteropTest {
|
|||
return clientCallCapture.get().getAttributes().get(Grpc.TRANSPORT_ATTR_LOCAL_ADDR);
|
||||
}
|
||||
|
||||
/** Helper for asserting TLS info in SSLSession {@link io.grpc.ServerCall#getAttributes()} */
|
||||
/** Helper for asserting TLS info in SSLSession {@link io.grpc.ServerCall#getAttributes()}. */
|
||||
protected void assertX500SubjectDn(String tlsInfo) {
|
||||
TestServiceGrpc.TestServiceBlockingStub stub =
|
||||
blockingStub.withDeadlineAfter(5, TimeUnit.SECONDS);
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ import io.grpc.testing.protobuf.SimpleResponse;
|
|||
import io.grpc.testing.protobuf.SimpleServiceGrpc;
|
||||
import io.grpc.testing.protobuf.SimpleServiceGrpc.SimpleServiceBlockingStub;
|
||||
import io.grpc.testing.protobuf.SimpleServiceGrpc.SimpleServiceImplBase;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
|
|
|||
|
|
@ -147,39 +147,39 @@ public class InboundHeadersBenchmark {
|
|||
bh.consume(Utils.convertHeaders(headers));
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Prints the size of the header objects in bytes. Needs JOL (Java Object Layout) as a
|
||||
// * dependency.
|
||||
// */
|
||||
// public static void main(String... args) {
|
||||
// Http2Headers grpcRequestHeaders = new GrpcHttp2RequestHeaders(4);
|
||||
// Http2Headers defaultRequestHeaders = new DefaultHttp2Headers(true, 9);
|
||||
// for (int i = 0; i < requestHeaders.length; i += 2) {
|
||||
// grpcRequestHeaders.add(requestHeaders[i], requestHeaders[i + 1]);
|
||||
// defaultRequestHeaders.add(requestHeaders[i], requestHeaders[i + 1]);
|
||||
// }
|
||||
// long c = 10L;
|
||||
// int m = ((int) c) / 20;
|
||||
//
|
||||
// long grpcRequestHeadersBytes = GraphLayout.parseInstance(grpcRequestHeaders).totalSize();
|
||||
// long defaultRequestHeadersBytes =
|
||||
// GraphLayout.parseInstance(defaultRequestHeaders).totalSize();
|
||||
//
|
||||
// System.out.printf("gRPC Request Headers: %d bytes%nNetty Request Headers: %d bytes%n",
|
||||
// grpcRequestHeadersBytes, defaultRequestHeadersBytes);
|
||||
//
|
||||
// Http2Headers grpcResponseHeaders = new GrpcHttp2RequestHeaders(4);
|
||||
// Http2Headers defaultResponseHeaders = new DefaultHttp2Headers(true, 9);
|
||||
// for (int i = 0; i < responseHeaders.length; i += 2) {
|
||||
// grpcResponseHeaders.add(responseHeaders[i], responseHeaders[i + 1]);
|
||||
// defaultResponseHeaders.add(responseHeaders[i], responseHeaders[i + 1]);
|
||||
// }
|
||||
//
|
||||
// long grpcResponseHeadersBytes = GraphLayout.parseInstance(grpcResponseHeaders).totalSize();
|
||||
// long defaultResponseHeadersBytes =
|
||||
// GraphLayout.parseInstance(defaultResponseHeaders).totalSize();
|
||||
//
|
||||
// System.out.printf("gRPC Response Headers: %d bytes%nNetty Response Headers: %d bytes%n",
|
||||
// grpcResponseHeadersBytes, defaultResponseHeadersBytes);
|
||||
// }
|
||||
///**
|
||||
// * Prints the size of the header objects in bytes. Needs JOL (Java Object Layout) as a
|
||||
// * dependency.
|
||||
// */
|
||||
//public static void main(String... args) {
|
||||
// Http2Headers grpcRequestHeaders = new GrpcHttp2RequestHeaders(4);
|
||||
// Http2Headers defaultRequestHeaders = new DefaultHttp2Headers(true, 9);
|
||||
// for (int i = 0; i < requestHeaders.length; i += 2) {
|
||||
// grpcRequestHeaders.add(requestHeaders[i], requestHeaders[i + 1]);
|
||||
// defaultRequestHeaders.add(requestHeaders[i], requestHeaders[i + 1]);
|
||||
// }
|
||||
// long c = 10L;
|
||||
// int m = ((int) c) / 20;
|
||||
|
||||
// long grpcRequestHeadersBytes = GraphLayout.parseInstance(grpcRequestHeaders).totalSize();
|
||||
// long defaultRequestHeadersBytes =
|
||||
// GraphLayout.parseInstance(defaultRequestHeaders).totalSize();
|
||||
|
||||
// System.out.printf("gRPC Request Headers: %d bytes%nNetty Request Headers: %d bytes%n",
|
||||
// grpcRequestHeadersBytes, defaultRequestHeadersBytes);
|
||||
|
||||
// Http2Headers grpcResponseHeaders = new GrpcHttp2RequestHeaders(4);
|
||||
// Http2Headers defaultResponseHeaders = new DefaultHttp2Headers(true, 9);
|
||||
// for (int i = 0; i < responseHeaders.length; i += 2) {
|
||||
// grpcResponseHeaders.add(responseHeaders[i], responseHeaders[i + 1]);
|
||||
// defaultResponseHeaders.add(responseHeaders[i], responseHeaders[i + 1]);
|
||||
// }
|
||||
|
||||
// long grpcResponseHeadersBytes = GraphLayout.parseInstance(grpcResponseHeaders).totalSize();
|
||||
// long defaultResponseHeadersBytes =
|
||||
// GraphLayout.parseInstance(defaultResponseHeaders).totalSize();
|
||||
|
||||
// System.out.printf("gRPC Response Headers: %d bytes%nNetty Response Headers: %d bytes%n",
|
||||
// grpcResponseHeadersBytes, defaultResponseHeadersBytes);
|
||||
//}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,8 +154,7 @@ public class GrpcSslContexts {
|
|||
@CanIgnoreReturnValue
|
||||
public static SslContextBuilder configure(SslContextBuilder builder, SslProvider provider) {
|
||||
switch (provider) {
|
||||
case JDK:
|
||||
{
|
||||
case JDK: {
|
||||
Provider jdkProvider = findJdkProvider();
|
||||
if (jdkProvider == null) {
|
||||
throw new IllegalArgumentException(
|
||||
|
|
@ -163,8 +162,7 @@ public class GrpcSslContexts {
|
|||
}
|
||||
return configure(builder, jdkProvider);
|
||||
}
|
||||
case OPENSSL:
|
||||
{
|
||||
case OPENSSL: {
|
||||
ApplicationProtocolConfig apc;
|
||||
if (OpenSsl.isAlpnSupported()) {
|
||||
apc = NPN_AND_ALPN;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@ import io.grpc.util.AdvancedTlsX509TrustManager;
|
|||
import io.grpc.util.AdvancedTlsX509TrustManager.SslSocketAndEnginePeerVerifier;
|
||||
import io.grpc.util.AdvancedTlsX509TrustManager.Verification;
|
||||
import io.grpc.util.CertificateUtils;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
|
|
|||
|
|
@ -914,7 +914,7 @@ class OkHttpClientTransport implements ConnectionClientTransport, TransportExcep
|
|||
}
|
||||
|
||||
/**
|
||||
* Called when a stream is closed, we do things like:
|
||||
* Called when a stream is closed. We do things like:
|
||||
* <ul>
|
||||
* <li>Removing the stream from the map.
|
||||
* <li>Optionally reporting the status.
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ package io.grpc.protobuf.services;
|
|||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.util.concurrent.MoreExecutors;
|
||||
import io.grpc.Context.CancellationListener;
|
||||
import io.grpc.Context;
|
||||
import io.grpc.Context.CancellationListener;
|
||||
import io.grpc.Status;
|
||||
import io.grpc.StatusException;
|
||||
import io.grpc.health.v1.HealthCheckRequest;
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ import io.grpc.protobuf.services.BinaryLogSink;
|
|||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Utility class to create BinaryLog instances.
|
||||
*
|
||||
* @deprecated Use {@link io.grpc.protobuf.services.BinaryLogs} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ import static com.google.common.truth.Truth.assertThat;
|
|||
import static org.junit.Assert.fail;
|
||||
|
||||
import io.grpc.BindableService;
|
||||
import io.grpc.Context.CancellableContext;
|
||||
import io.grpc.Context;
|
||||
import io.grpc.Context.CancellableContext;
|
||||
import io.grpc.Status;
|
||||
import io.grpc.StatusRuntimeException;
|
||||
import io.grpc.health.v1.HealthCheckRequest;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import java.lang.annotation.Target;
|
|||
/**
|
||||
* {@link RpcMethod} contains a limited subset of information about the RPC to assist
|
||||
* <a href="https://docs.oracle.com/javase/6/docs/api/javax/annotation/processing/Processor.html">
|
||||
* Java Annotation Processors.</a>
|
||||
* Java Annotation Processors</a>.
|
||||
*
|
||||
* <p>
|
||||
* This annotation is used by the gRPC stub compiler to annotate {@link MethodDescriptor}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ import com.google.common.annotations.VisibleForTesting;
|
|||
import io.grpc.Status;
|
||||
import io.grpc.internal.TimeProvider;
|
||||
import io.grpc.xds.internal.security.trust.CertificateUtils;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
|
|
|||
|
|
@ -64,7 +64,6 @@ import java.util.Collections;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
|
|
|||
|
|
@ -693,7 +693,7 @@ public abstract class XdsClientImplTestBase {
|
|||
* Tests a subscribed LDS resource transitioned to and from the invalid state.
|
||||
*
|
||||
* @see <a href="https://github.com/grpc/proposal/blob/master/A40-csds-support.md#ads-parsing-logic-update-continue-after-first-error">
|
||||
* A40-csds-support.md</a>.
|
||||
* A40-csds-support.md</a>
|
||||
*/
|
||||
@Test
|
||||
public void ldsResponseErrorHandling_subscribedResourceInvalid() {
|
||||
|
|
@ -1430,7 +1430,7 @@ public abstract class XdsClientImplTestBase {
|
|||
* Tests a subscribed RDS resource transitioned to and from the invalid state.
|
||||
*
|
||||
* @see <a href="https://github.com/grpc/proposal/blob/master/A40-csds-support.md#ads-parsing-logic-update-continue-after-first-error">
|
||||
* A40-csds-support.md</a>.
|
||||
* A40-csds-support.md</a>
|
||||
*/
|
||||
@Test
|
||||
public void rdsResponseErrorHandling_subscribedResourceInvalid() {
|
||||
|
|
@ -1803,7 +1803,7 @@ public abstract class XdsClientImplTestBase {
|
|||
* Tests a subscribed CDS resource transitioned to and from the invalid state.
|
||||
*
|
||||
* @see <a href="https://github.com/grpc/proposal/blob/master/A40-csds-support.md#ads-parsing-logic-update-continue-after-first-error">
|
||||
* A40-csds-support.md</a>.
|
||||
* A40-csds-support.md</a>
|
||||
*/
|
||||
@Test
|
||||
public void cdsResponseErrorHandling_subscribedResourceInvalid() {
|
||||
|
|
@ -2813,7 +2813,7 @@ public abstract class XdsClientImplTestBase {
|
|||
* Tests a subscribed EDS resource transitioned to and from the invalid state.
|
||||
*
|
||||
* @see <a href="https://github.com/grpc/proposal/blob/master/A40-csds-support.md#ads-parsing-logic-update-continue-after-first-error">
|
||||
* A40-csds-support.md</a>.
|
||||
* A40-csds-support.md</a>
|
||||
*/
|
||||
@Test
|
||||
public void edsResponseErrorHandling_subscribedResourceInvalid() {
|
||||
|
|
|
|||
|
|
@ -71,7 +71,6 @@ import java.net.SocketAddress;
|
|||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ import io.grpc.xds.internal.rbac.engine.GrpcAuthorizationEngine.OrMatcher;
|
|||
import io.grpc.xds.internal.rbac.engine.GrpcAuthorizationEngine.PathMatcher;
|
||||
import io.grpc.xds.internal.rbac.engine.GrpcAuthorizationEngine.PolicyMatcher;
|
||||
import io.grpc.xds.internal.rbac.engine.GrpcAuthorizationEngine.SourceIpMatcher;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.security.Principal;
|
||||
|
|
|
|||
Loading…
Reference in New Issue