Skip to content

Commit 30af3b6

Browse files
committed
lint
Change-Id: I2fc110b6f3a05a61e99c28aa83e948e0f23c5e8e
1 parent 94895d5 commit 30af3b6

3 files changed

Lines changed: 10 additions & 11 deletions

File tree

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import java.util.logging.Level;
4343
import java.util.logging.Logger;
4444
import javax.annotation.Nullable;
45-
import org.checkerframework.checker.units.qual.A;
4645

4746
/**
4847
* A {@link ManagedChannel} that will send requests round-robin via a set of channels.
@@ -62,7 +61,8 @@ public class BigtableChannelPool extends ManagedChannel {
6261
private final BigtableChannelPoolSettings settings;
6362
private final ChannelFactory channelFactory;
6463
private final ScheduledExecutorService executor;
65-
private final ScheduledExecutorService channelHealthProbingExecutor = Executors.newSingleThreadScheduledExecutor();
64+
private final ScheduledExecutorService channelHealthProbingExecutor =
65+
Executors.newSingleThreadScheduledExecutor();
6666

6767
private final Object entryWriteLock = new Object();
6868
@VisibleForTesting final AtomicReference<ImmutableList<Entry>> entries = new AtomicReference<>();
@@ -96,7 +96,8 @@ public static BigtableChannelPool create(
9696
ImmutableList.Builder<Entry> initialListBuilder = ImmutableList.builder();
9797

9898
for (int i = 0; i < settings.getInitialChannelCount(); i++) {
99-
initialListBuilder.add(new Entry(channelFactory.createSingleChannel(), channelHealthProbingExecutor));
99+
initialListBuilder.add(
100+
new Entry(channelFactory.createSingleChannel(), channelHealthProbingExecutor));
100101
}
101102

102103
entries.set(initialListBuilder.build());
@@ -154,7 +155,7 @@ public ManagedChannel shutdown() {
154155
// shutdownNow will cancel scheduled tasks
155156
executor.shutdownNow();
156157
}
157-
if (channelHealthProbingExecutor != null){
158+
if (channelHealthProbingExecutor != null) {
158159
channelHealthProbingExecutor.shutdownNow();
159160
}
160161
return this;
@@ -326,7 +327,8 @@ private void expand(int desiredSize) {
326327

327328
for (int i = 0; i < desiredSize - localEntries.size(); i++) {
328329
try {
329-
newEntries.add(new Entry(channelFactory.createSingleChannel(), channelHealthProbingExecutor));
330+
newEntries.add(
331+
new Entry(channelFactory.createSingleChannel(), channelHealthProbingExecutor));
330332
} catch (IOException e) {
331333
LOG.log(Level.WARNING, "Failed to add channel", e);
332334
}
@@ -364,7 +366,8 @@ void refresh() {
364366

365367
for (int i = 0; i < newEntries.size(); i++) {
366368
try {
367-
newEntries.set(i, new Entry(channelFactory.createSingleChannel(), channelHealthProbingExecutor));
369+
newEntries.set(
370+
i, new Entry(channelFactory.createSingleChannel(), channelHealthProbingExecutor));
368371
} catch (IOException e) {
369372
LOG.log(Level.WARNING, "Failed to refresh channel, leaving old channel", e);
370373
}
@@ -442,7 +445,6 @@ static class Entry {
442445
private final AtomicInteger maxOutstanding = new AtomicInteger();
443446
private final AtomicInteger probesInFlight = new AtomicInteger(0);
444447

445-
446448
// Flag that the channel should be closed once all of the outstanding RPC complete.
447449
private final AtomicBoolean shutdownRequested = new AtomicBoolean();
448450
// Flag that the channel has been closed.
@@ -463,7 +465,6 @@ public ChannelHealthChecker getHealthChecker() {
463465
return healthChecker;
464466
}
465467

466-
467468
int getAndResetMaxOutstanding() {
468469
return maxOutstanding.getAndSet(outstandingRpcs.get());
469470
}

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelHealthChecker.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public class ChannelHealthChecker {
4343
private volatile ScheduledFuture<?> scheduledProbeFuture;
4444
private final ReadWriteLock probeResultsLock = new ReentrantReadWriteLock();
4545
private final EvictingQueue<ProbeResult> probeResults;
46+
4647
// private final AtomicInteger probesInFlight = new AtomicInteger(0);
4748

4849
/** Inner class to represent the result of a single probe. */

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
import com.google.cloud.bigtable.gaxx.grpc.BigtableChannelPool.Entry;
1919
import com.google.common.collect.ImmutableList;
2020
import java.time.Instant;
21-
import java.util.Collections;
22-
import java.util.Map;
23-
import java.util.WeakHashMap;
2421
import java.util.concurrent.Executors;
2522
import java.util.concurrent.ScheduledExecutorService;
2623
import java.util.function.Supplier;

0 commit comments

Comments
 (0)