4242import java .util .logging .Level ;
4343import java .util .logging .Logger ;
4444import 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 }
0 commit comments