public class NaiveBalancePolicy extends Object implements BalancePolicy
Jan 20, 2021
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
DEF_LEADER_MAX_MOVE |
static String |
PROP_BALANCE_THRESHOLD |
static String |
PROP_FOLLOWER_MAX_MOVE |
static String |
PROP_LEADER_MAX_MOVE |
| 构造器和说明 |
|---|
NaiveBalancePolicy() |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
getHighWaterMarkSlotFollowerNums(int average) |
int |
getHighWaterMarkSlotLeaderNums(int average) |
int |
getLowWaterMarkSlotFollowerNums(int average)
Gets get low water mark of follower slot nums. low watermark means the threshold we could
endure with, that once the follower slot numbers on a data-server is under the low water mark,
we need to rebalance the slot-table
|
int |
getLowWaterMarkSlotLeaderNums(int average)
Gets get low water mark slot leader nums. low watermark means the threshold we could endure
with, that once the slot leader numbers on a data-server is under the low water mark, we need
to rebalance the slot-table
|
int |
getMaxMoveFollowerSlots()
Gets get max move follower slots. max move means the maximum number of slots' followers we are
good to migrate per balance time
|
int |
getMaxMoveLeaderSlots()
Gets get max move leader slots. max move means the maximum number of slots' leader we are good
to migrate per balance time
|
void |
setBalanceThreshold(int balanceThreshold) |
void |
setMaxMoveFollowerSlots(int maxMoveFollowerSlots) |
void |
setMaxMoveLeaderSlots(int maxMoveLeaderSlots) |
public static final int DEF_LEADER_MAX_MOVE
public int getLowWaterMarkSlotLeaderNums(int average)
BalancePolicygetLowWaterMarkSlotLeaderNums 在接口中 BalancePolicyaverage - the averagepublic int getHighWaterMarkSlotLeaderNums(int average)
getHighWaterMarkSlotLeaderNums 在接口中 BalancePolicypublic int getLowWaterMarkSlotFollowerNums(int average)
BalancePolicygetLowWaterMarkSlotFollowerNums 在接口中 BalancePolicyaverage - the averagepublic int getHighWaterMarkSlotFollowerNums(int average)
public int getMaxMoveLeaderSlots()
BalancePolicygetMaxMoveLeaderSlots 在接口中 BalancePolicypublic int getMaxMoveFollowerSlots()
BalancePolicygetMaxMoveFollowerSlots 在接口中 BalancePolicypublic void setBalanceThreshold(int balanceThreshold)
public void setMaxMoveLeaderSlots(int maxMoveLeaderSlots)
public void setMaxMoveFollowerSlots(int maxMoveFollowerSlots)
Copyright © 2023 The Ant Financial. All rights reserved.