aboutsummaryrefslogtreecommitdiff
path: root/netty
diff options
context:
space:
mode:
authorEric Anderson <ejona@google.com>2017-09-25 11:38:49 -0700
committerEric Anderson <ejona@google.com>2017-09-27 11:59:04 -0700
commite92b72588dad02bd9c15fe9f3d661f95a8a81011 (patch)
treee484c27790193444eea734fe3ad98c053f0d80d8 /netty
parenta62108a2f780104459a4109eabad840b7158fc23 (diff)
downloadgrpc-grpc-java-e92b72588dad02bd9c15fe9f3d661f95a8a81011.tar.gz
Promote keepalive to ManagedChannelBuilder; stabilize
Fixes #3493
Diffstat (limited to 'netty')
-rw-r--r--netty/src/main/java/io/grpc/netty/NettyChannelBuilder.java26
1 files changed, 6 insertions, 20 deletions
diff --git a/netty/src/main/java/io/grpc/netty/NettyChannelBuilder.java b/netty/src/main/java/io/grpc/netty/NettyChannelBuilder.java
index 4563d5a1d..9a023ba11 100644
--- a/netty/src/main/java/io/grpc/netty/NettyChannelBuilder.java
+++ b/netty/src/main/java/io/grpc/netty/NettyChannelBuilder.java
@@ -264,17 +264,11 @@ public final class NettyChannelBuilder
}
/**
- * Sets the time without read activity before sending a keepalive ping. An unreasonably small
- * value might be increased, and {@code Long.MAX_VALUE} nano seconds or an unreasonably large
- * value will disable keepalive. Defaults to infinite.
- *
- * <p>Clients must receive permission from the service owner before enabling this option.
- * Keepalives can increase the load on services and are commonly "invisible" making it hard to
- * notice when they are causing excessive load. Clients are strongly encouraged to use only as
- * small of a value as necessary.
+ * {@inheritDoc}
*
* @since 1.3.0
*/
+ @Override
public NettyChannelBuilder keepAliveTime(long keepAliveTime, TimeUnit timeUnit) {
checkArgument(keepAliveTime > 0L, "keepalive time must be positive");
keepAliveTimeNanos = timeUnit.toNanos(keepAliveTime);
@@ -287,14 +281,11 @@ public final class NettyChannelBuilder
}
/**
- * Sets the time waiting for read activity after sending a keepalive ping. If the time expires
- * without any read activity on the connection, the connection is considered dead. An unreasonably
- * small value might be increased. Defaults to 20 seconds.
- *
- * <p>This value should be at least multiple times the RTT to allow for lost packets.
+ * {@inheritDoc}
*
* @since 1.3.0
*/
+ @Override
public NettyChannelBuilder keepAliveTimeout(long keepAliveTimeout, TimeUnit timeUnit) {
checkArgument(keepAliveTimeout > 0L, "keepalive timeout must be positive");
keepAliveTimeoutNanos = timeUnit.toNanos(keepAliveTimeout);
@@ -303,16 +294,11 @@ public final class NettyChannelBuilder
}
/**
- * Sets whether keepalive will be performed when there are no outstanding RPC on a connection.
- * Defaults to {@code false}.
- *
- * <p>Clients must receive permission from the service owner before enabling this option.
- * Keepalives on unused connections can easilly accidentally consume a considerable amount of
- * bandwidth and CPU.
+ * {@inheritDoc}
*
* @since 1.3.0
- * @see #keepAliveTime(long, TimeUnit)
*/
+ @Override
public NettyChannelBuilder keepAliveWithoutCalls(boolean enable) {
keepAliveWithoutCalls = enable;
return this;