[refactor](nereids) convert session var name "beNumForTest" #23255
this var is used for test only. So keep "for_test" as suffix.
This commit is contained in:
@ -73,8 +73,8 @@ class CostModelV1 extends PlanVisitor<Cost, PlanContext> {
|
||||
if (ConnectContext.get().getSessionVariable().isPlayNereidsDump()) {
|
||||
// TODO: @bingfeng refine minidump setting, and pass testMinidumpUt
|
||||
beNumber = 1;
|
||||
} else if (ConnectContext.get().getSessionVariable().getBeNumber() != -1) {
|
||||
beNumber = ConnectContext.get().getSessionVariable().getBeNumber();
|
||||
} else if (ConnectContext.get().getSessionVariable().getBeNumberForTest() != -1) {
|
||||
beNumber = ConnectContext.get().getSessionVariable().getBeNumberForTest();
|
||||
} else {
|
||||
beNumber = Math.max(1, ConnectContext.get().getEnv().getClusterInfo().getBackendsNumber(true));
|
||||
}
|
||||
|
||||
@ -436,7 +436,7 @@ public class MinidumpUtils {
|
||||
jsonObj.put("Sql", ConnectContext.get().getStatementContext().getOriginStatement().originStmt);
|
||||
// add session variable
|
||||
int beNumber = ConnectContext.get().getEnv().getClusterInfo().getBackendsNumber(true);
|
||||
ConnectContext.get().getSessionVariable().setBeNumber(beNumber);
|
||||
ConnectContext.get().getSessionVariable().setBeNumberForTest(beNumber);
|
||||
jsonObj.put("SessionVariable", serializeChangedSessionVariable(ConnectContext.get().getSessionVariable()));
|
||||
// add tables
|
||||
jsonObj.put("DbName", ConnectContext.get().getDatabase());
|
||||
|
||||
@ -161,7 +161,7 @@ public class SessionVariable implements Serializable, Writable {
|
||||
// if the right table is greater than this value in the hash join, we will ignore IN filter
|
||||
public static final String RUNTIME_FILTER_MAX_IN_NUM = "runtime_filter_max_in_num";
|
||||
|
||||
public static final String BE_NUMBER = "be_number_for_test";
|
||||
public static final String BE_NUMBER_FOR_TEST = "be_number_for_test";
|
||||
|
||||
// max ms to wait transaction publish finish when exec insert stmt.
|
||||
public static final String INSERT_VISIBLE_TIMEOUT_MS = "insert_visible_timeout_ms";
|
||||
@ -712,16 +712,16 @@ public class SessionVariable implements Serializable, Writable {
|
||||
@VariableMgr.VarAttr(name = USE_RF_DEFAULT)
|
||||
public boolean useRuntimeFilterDefaultSize = false;
|
||||
|
||||
public int getBeNumber() {
|
||||
return beNumber;
|
||||
public int getBeNumberForTest() {
|
||||
return beNumberForTest;
|
||||
}
|
||||
|
||||
public void setBeNumber(int beNumber) {
|
||||
this.beNumber = beNumber;
|
||||
public void setBeNumberForTest(int beNumberForTest) {
|
||||
this.beNumberForTest = beNumberForTest;
|
||||
}
|
||||
|
||||
@VariableMgr.VarAttr(name = BE_NUMBER)
|
||||
private int beNumber = -1;
|
||||
@VariableMgr.VarAttr(name = BE_NUMBER_FOR_TEST)
|
||||
private int beNumberForTest = -1;
|
||||
|
||||
public double getCboCpuWeight() {
|
||||
return cboCpuWeight;
|
||||
|
||||
@ -355,7 +355,7 @@ public class SystemInfoService {
|
||||
}
|
||||
|
||||
public int getBackendsNumber(boolean needAlive) {
|
||||
int beNumber = ConnectContext.get().getSessionVariable().getBeNumber();
|
||||
int beNumber = ConnectContext.get().getSessionVariable().getBeNumberForTest();
|
||||
if (beNumber < 0) {
|
||||
beNumber = getAllBackendIds(needAlive).size();
|
||||
}
|
||||
|
||||
@ -242,7 +242,7 @@ public class PartitionCacheTest {
|
||||
channel.reset();
|
||||
|
||||
SessionVariable sessionVariable = new SessionVariable();
|
||||
Deencapsulation.setField(sessionVariable, "beNumber", 1);
|
||||
Deencapsulation.setField(sessionVariable, "beNumberForTest", 1);
|
||||
|
||||
new Expectations(channel) {
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user