File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed
fluss-common/src/main/java/com/alibaba/fluss/cluster Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -83,22 +83,17 @@ public Cluster(
8383 List <BucketLocation > bucketsForTable = entry .getValue ();
8484 // Optimise for the common case where all buckets are available.
8585 boolean foundUnavailableBucket = false ;
86+ List <BucketLocation > availableBucketsForTable = new ArrayList <>(bucketsForTable .size ());
8687 for (BucketLocation bucketLocation : bucketsForTable ) {
8788 if (bucketLocation .getLeader () != null ) {
8889 tmpAvailableLocationByBucket .put (
8990 bucketLocation .getTableBucket (), bucketLocation );
91+ availableBucketsForTable .add (bucketLocation );
9092 } else {
9193 foundUnavailableBucket = true ;
9294 }
9395 }
9496 if (foundUnavailableBucket ) {
95- List <BucketLocation > availableBucketsForTable =
96- new ArrayList <>(bucketsForTable .size ());
97- for (BucketLocation loc : bucketsForTable ) {
98- if (loc .getLeader () != null ) {
99- availableBucketsForTable .add (loc );
100- }
101- }
10297 tmpAvailableLocationsByPath .put (
10398 physicalTablePath , Collections .unmodifiableList (availableBucketsForTable ));
10499 } else {
You can’t perform that action at this time.
0 commit comments