Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
huangqixiang committed Nov 24, 2024
1 parent 83edc8b commit 3633967
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,7 @@
import java.util.Objects;
import java.util.Set;

/**
* The motivation of this patch is to improvement community strategy which is not balance.
* It is not the best but should be better, especially in our business case.
* The new strategy is as follow
* 1. stat unselect and select bucket on each be
* 2. find the be having highest select priority, which means having least selected or least left buckets
* 3. select one bucket of it's unselected bucket to server query, with min select priority
* 4. remove from unselected bucket of other be for selected bucket of step 3
* 5. loop until unselected bucket on all be is empty, which means all bucket has found proper be.
*/

public abstract class ScanRangeAssignmentColocate {

public static class Location implements Comparable<Location> {
Expand Down Expand Up @@ -78,49 +69,6 @@ public String toString() {
}
}

public static class BucketScore implements Comparable<BucketScore> {
private final int bucketSeq;
private final LocationAssignment location;
private final int num;

public BucketScore(int bucketSeq, LocationAssignment location, int num) {
this.bucketSeq = bucketSeq;
this.num = num;
this.location = location;
}

public int getBucketSeq() {
return bucketSeq;
}

public int getNum() {
return num;
}

public LocationAssignment getLocation() {
return location;
}

@Override
public int compareTo(BucketScore other) {
int res = this.location.compareRemovePriority(other.location);
if (res != 0) {
return res;
}
return Integer.compare(this.num, other.num);
}

@Override
public String toString() {
return "BucketScore{"
+ "bucketSeq=" + bucketSeq
+ ", select=" + location.getSelectedBuckets()
+ ", unselect=" + location.getUnselectBuckets()
+ ", num=" + num
+ '}';
}
}

public static class LocationAssignment implements Comparable<LocationAssignment> {
// means be
private final Location location;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,16 @@

package org.apache.doris.qe;

import org.apache.doris.thrift.TNetworkAddress;
import org.apache.doris.thrift.TScanRangeLocation;

import com.google.common.annotations.VisibleForTesting;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

/**
* The motivation of this patch is to improvement community strategy which is not balance.
* It is not the best but should be better, especially in our business case.
* The new strategy is as follow
* 1. stat unselect and select bucket on each be
* 2. find the be having highest select priority, which means having least selected or least left buckets
Expand Down

0 comments on commit 3633967

Please sign in to comment.