Skip to content

Commit 90312f8

Browse files
committed
ads mode support consistent hash
Signed-off-by: 1640528278@qq.com <1640528278@qq.com>
1 parent a0d7213 commit 90312f8

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

pkg/consistenthash/maglev/maglev.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,9 @@ type Backend struct {
5353
}
5454

5555
func InitMaglevMap() error {
56-
5756
maglevTableSize = DefaultTableSize
58-
5957
opt := &ebpf.LoadPinOptions{}
58+
6059
outer_map, err := ebpf.LoadPinnedMap("/sys/fs/bpf"+"/bpf_kmesh/map/"+MaglevOuterMapName, opt)
6160
if err != nil {
6261
return fmt.Errorf("load outer map of maglev failed err: %v", err)
@@ -157,7 +156,6 @@ func getPermutation(b Backend) uint64 {
157156
}
158157

159158
func getLookupTable(cluster *cluster_v2.Cluster, tableSize uint64) ([]int, error) {
160-
161159
loadAssignment := cluster.GetLoadAssignment()
162160
clusterName := cluster.GetName()
163161
localityLbEps := loadAssignment.GetEndpoints()

pkg/consistenthash/maglev/maglev_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ func (suite *MaglevTestSuite) SetupSuite() {
6363
}
6464

6565
func (suite *MaglevTestSuite) TearDownSuite() {
66-
6766
fmt.Println(">>> From TearDownSuite")
6867
}
6968

@@ -107,7 +106,6 @@ func (suite *MaglevTestSuite) TestGetLookupTable() {
107106
for k, v := range backendCount {
108107
fmt.Printf("\n backend_id:%v, count:%v\n", k, v)
109108
}
110-
111109
}
112110

113111
func newCluster() *cluster_v2.Cluster {

0 commit comments

Comments
 (0)