From cf9f85d52127b2c4754bf1b4caf29a59699a7f0e Mon Sep 17 00:00:00 2001 From: David Noble Date: Sun, 19 May 2019 19:20:10 -0700 Subject: [PATCH] Minor cleanup (e.g., removed unused imports and unnecessary uses of 'throws' signatures) --- .../directconnectivity/RntbdTransportClient.java | 1 - .../rntbd/RntbdClientChannelHandler.java | 10 +++------- .../directconnectivity/rntbd/RntbdRequestManager.java | 2 -- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/direct-impl/src/main/java/com/microsoft/azure/cosmosdb/internal/directconnectivity/RntbdTransportClient.java b/direct-impl/src/main/java/com/microsoft/azure/cosmosdb/internal/directconnectivity/RntbdTransportClient.java index adec62b5..8f169b43 100644 --- a/direct-impl/src/main/java/com/microsoft/azure/cosmosdb/internal/directconnectivity/RntbdTransportClient.java +++ b/direct-impl/src/main/java/com/microsoft/azure/cosmosdb/internal/directconnectivity/RntbdTransportClient.java @@ -54,7 +54,6 @@ import java.util.concurrent.atomic.AtomicLong; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; -import static com.microsoft.azure.cosmosdb.internal.directconnectivity.rntbd.RntbdReporter.reportIssueUnless; @JsonSerialize(using = RntbdTransportClient.JsonSerializer.class) public final class RntbdTransportClient extends TransportClient implements AutoCloseable { diff --git a/direct-impl/src/main/java/com/microsoft/azure/cosmosdb/internal/directconnectivity/rntbd/RntbdClientChannelHandler.java b/direct-impl/src/main/java/com/microsoft/azure/cosmosdb/internal/directconnectivity/rntbd/RntbdClientChannelHandler.java index 7e402998..7759cdfb 100644 --- a/direct-impl/src/main/java/com/microsoft/azure/cosmosdb/internal/directconnectivity/rntbd/RntbdClientChannelHandler.java +++ b/direct-impl/src/main/java/com/microsoft/azure/cosmosdb/internal/directconnectivity/rntbd/RntbdClientChannelHandler.java @@ -60,7 +60,7 @@ public class RntbdClientChannelHandler extends ChannelInitializer imple * @param channel a channel that was just acquired */ @Override - public void channelAcquired(final Channel channel) throws Exception { + public void channelAcquired(final Channel channel) { logger.trace("{} CHANNEL ACQUIRED", channel); } @@ -72,7 +72,7 @@ public class RntbdClientChannelHandler extends ChannelInitializer imple * @param channel a channel that was just created */ @Override - public void channelCreated(final Channel channel) throws Exception { + public void channelCreated(final Channel channel) { logger.trace("{} CHANNEL CREATED", channel); this.initChannel(channel); } @@ -85,7 +85,7 @@ public class RntbdClientChannelHandler extends ChannelInitializer imple * @param channel a channel that was just released */ @Override - public void channelReleased(final Channel channel) throws Exception { + public void channelReleased(final Channel channel) { logger.trace("{} CHANNEL RELEASED", channel); } @@ -112,10 +112,6 @@ public class RntbdClientChannelHandler extends ChannelInitializer imple checkNotNull(channel); - assert channel.isRegistered(); - assert channel.isOpen(); - assert !channel.isActive(); - final RntbdRequestManager requestManager = new RntbdRequestManager(); final long readerIdleTime = this.config.getReceiveHangDetectionTime(); final long writerIdleTime = this.config.getSendHangDetectionTime(); diff --git a/direct-impl/src/main/java/com/microsoft/azure/cosmosdb/internal/directconnectivity/rntbd/RntbdRequestManager.java b/direct-impl/src/main/java/com/microsoft/azure/cosmosdb/internal/directconnectivity/rntbd/RntbdRequestManager.java index 10c81f85..618da14c 100644 --- a/direct-impl/src/main/java/com/microsoft/azure/cosmosdb/internal/directconnectivity/rntbd/RntbdRequestManager.java +++ b/direct-impl/src/main/java/com/microsoft/azure/cosmosdb/internal/directconnectivity/rntbd/RntbdRequestManager.java @@ -73,7 +73,6 @@ import java.util.Optional; import java.util.UUID; import java.util.concurrent.CancellationException; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CompletionException; import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -83,7 +82,6 @@ import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; import static com.microsoft.azure.cosmosdb.internal.HttpConstants.StatusCodes; import static com.microsoft.azure.cosmosdb.internal.HttpConstants.SubStatusCodes; -import static com.microsoft.azure.cosmosdb.internal.directconnectivity.rntbd.RntbdReporter.reportIssue; import static com.microsoft.azure.cosmosdb.internal.directconnectivity.rntbd.RntbdReporter.reportIssueUnless; public final class RntbdRequestManager implements ChannelHandler, ChannelInboundHandler, ChannelOutboundHandler {