@@ -189,7 +189,7 @@ public void shutdown() {
189
189
* This timer will be invoked periodically, according to configuration, and it will look for any
190
190
* outlier subchannels.
191
191
*/
192
- class DetectionTimer implements Runnable {
192
+ final class DetectionTimer implements Runnable {
193
193
194
194
OutlierDetectionLoadBalancerConfig config ;
195
195
ChannelLogger logger ;
@@ -217,7 +217,7 @@ public void run() {
217
217
* This child helper wraps the provided helper so that it can hand out wrapped {@link
218
218
* OutlierDetectionSubchannel}s and manage the address info map.
219
219
*/
220
- class ChildHelper extends ForwardingLoadBalancerHelper {
220
+ final class ChildHelper extends ForwardingLoadBalancerHelper {
221
221
222
222
private Helper delegate ;
223
223
@@ -259,7 +259,7 @@ public void updateBalancingState(ConnectivityState newState, SubchannelPicker ne
259
259
}
260
260
}
261
261
262
- class OutlierDetectionSubchannel extends ForwardingSubchannel {
262
+ final class OutlierDetectionSubchannel extends ForwardingSubchannel {
263
263
264
264
private final Subchannel delegate ;
265
265
private EndpointTracker endpointTracker ;
@@ -398,7 +398,7 @@ protected Subchannel delegate() {
398
398
/**
399
399
* Wraps the actual listener so that state changes from the actual one can be intercepted.
400
400
*/
401
- class OutlierDetectionSubchannelStateListener implements SubchannelStateListener {
401
+ final class OutlierDetectionSubchannelStateListener implements SubchannelStateListener {
402
402
403
403
private final SubchannelStateListener delegate ;
404
404
@@ -428,7 +428,7 @@ public String toString() {
428
428
* This picker delegates the actual picking logic to a wrapped delegate, but associates a {@link
429
429
* ClientStreamTracer} with each pick to track the results of each subchannel stream.
430
430
*/
431
- class OutlierDetectionPicker extends SubchannelPicker {
431
+ final class OutlierDetectionPicker extends SubchannelPicker {
432
432
433
433
private final SubchannelPicker delegate ;
434
434
@@ -454,7 +454,7 @@ public PickResult pickSubchannel(PickSubchannelArgs args) {
454
454
* Builds instances of a {@link ClientStreamTracer} that increments the call count in the
455
455
* tracker for each closed stream.
456
456
*/
457
- class ResultCountingClientStreamTracerFactory extends ClientStreamTracer .Factory {
457
+ final class ResultCountingClientStreamTracerFactory extends ClientStreamTracer .Factory {
458
458
459
459
private final EndpointTracker tracker ;
460
460
@@ -498,7 +498,7 @@ public void streamClosed(Status status) {
498
498
/**
499
499
* Tracks additional information about the endpoint needed for outlier detection.
500
500
*/
501
- static class EndpointTracker {
501
+ static final class EndpointTracker {
502
502
503
503
private OutlierDetectionLoadBalancerConfig config ;
504
504
// Marked as volatile to assure that when the inactive counter is swapped in as the new active
@@ -642,7 +642,7 @@ public boolean maxEjectionTimeElapsed(long currentTimeNanos) {
642
642
}
643
643
644
644
/** Tracks both successful and failed call counts. */
645
- private static class CallCounter {
645
+ private static final class CallCounter {
646
646
AtomicLong successCount = new AtomicLong ();
647
647
AtomicLong failureCount = new AtomicLong ();
648
648
@@ -663,7 +663,7 @@ public String toString() {
663
663
/**
664
664
* Maintains a mapping from endpoint (a set of addresses) to their trackers.
665
665
*/
666
- static class EndpointTrackerMap extends ForwardingMap <Set <SocketAddress >, EndpointTracker > {
666
+ static final class EndpointTrackerMap extends ForwardingMap <Set <SocketAddress >, EndpointTracker > {
667
667
private final Map <Set <SocketAddress >, EndpointTracker > trackerMap ;
668
668
669
669
EndpointTrackerMap () {
@@ -784,7 +784,7 @@ static List<OutlierEjectionAlgorithm> forConfig(OutlierDetectionLoadBalancerConf
784
784
* required rate is not fixed, but is based on the mean and standard deviation of the success
785
785
* rates of all of the addresses.
786
786
*/
787
- static class SuccessRateOutlierEjectionAlgorithm implements OutlierEjectionAlgorithm {
787
+ static final class SuccessRateOutlierEjectionAlgorithm implements OutlierEjectionAlgorithm {
788
788
789
789
private final OutlierDetectionLoadBalancerConfig config ;
790
790
@@ -869,7 +869,7 @@ static double standardDeviation(Collection<Double> values, double mean) {
869
869
}
870
870
}
871
871
872
- static class FailurePercentageOutlierEjectionAlgorithm implements OutlierEjectionAlgorithm {
872
+ static final class FailurePercentageOutlierEjectionAlgorithm implements OutlierEjectionAlgorithm {
873
873
874
874
private final OutlierDetectionLoadBalancerConfig config ;
875
875
@@ -970,7 +970,7 @@ private OutlierDetectionLoadBalancerConfig(Builder builder) {
970
970
}
971
971
972
972
/** Builds a new {@link OutlierDetectionLoadBalancerConfig}. */
973
- public static class Builder {
973
+ public static final class Builder {
974
974
long intervalNanos = 10_000_000_000L ; // 10s
975
975
long baseEjectionTimeNanos = 30_000_000_000L ; // 30s
976
976
long maxEjectionTimeNanos = 300_000_000_000L ; // 300s
@@ -1035,7 +1035,7 @@ public OutlierDetectionLoadBalancerConfig build() {
1035
1035
}
1036
1036
1037
1037
/** The configuration for success rate ejection. */
1038
- public static class SuccessRateEjection {
1038
+ public static final class SuccessRateEjection {
1039
1039
1040
1040
public final int stdevFactor ;
1041
1041
public final int enforcementPercentage ;
@@ -1094,7 +1094,7 @@ public SuccessRateEjection build() {
1094
1094
}
1095
1095
1096
1096
/** The configuration for failure percentage ejection. */
1097
- public static class FailurePercentageEjection {
1097
+ public static final class FailurePercentageEjection {
1098
1098
public final int threshold ;
1099
1099
public final int enforcementPercentage ;
1100
1100
public final int minimumHosts ;
0 commit comments