Skip to content

Commit

Permalink
change disabled to none
Browse files Browse the repository at this point in the history
  • Loading branch information
yiguolei authored and mrhhsg committed Dec 5, 2024
1 parent 8c9a7c9 commit 0d273b7
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion be/src/runtime/workload_group/workload_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ WorkloadGroupInfo WorkloadGroupInfo::parse_topic_info(
}

// 18 slot memory policy
TWgSlotMemoryPolicy::type slot_mem_policy = TWgSlotMemoryPolicy::DISABLED;
TWgSlotMemoryPolicy::type slot_mem_policy = TWgSlotMemoryPolicy::NONE;
if (tworkload_group_info.__isset.slot_memory_policy) {
slot_mem_policy = tworkload_group_info.slot_memory_policy;
}
Expand Down
4 changes: 2 additions & 2 deletions be/src/runtime/workload_group/workload_group.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ class WorkloadGroup : public std::enable_shared_from_this<WorkloadGroup> {
std::atomic<int64_t> _scan_bytes_per_second {-1};
std::atomic<int64_t> _remote_scan_bytes_per_second {-1};
std::atomic<int> _total_query_slot_count = 0;
std::atomic<TWgSlotMemoryPolicy::type> _slot_mem_policy {TWgSlotMemoryPolicy::DISABLED};
std::atomic<TWgSlotMemoryPolicy::type> _slot_mem_policy {TWgSlotMemoryPolicy::NONE};

// means workload group is mark dropped
// new query can not submit
Expand Down Expand Up @@ -306,7 +306,7 @@ struct WorkloadGroupInfo {
const int read_bytes_per_second = -1;
const int remote_read_bytes_per_second = -1;
const int total_query_slot_count = 0;
const TWgSlotMemoryPolicy::type slot_mem_policy = TWgSlotMemoryPolicy::DISABLED;
const TWgSlotMemoryPolicy::type slot_mem_policy = TWgSlotMemoryPolicy::NONE;
const int write_buffer_ratio = 0;
// log cgroup cpu info
uint64_t cgroup_cpu_shares = 0;
Expand Down
4 changes: 2 additions & 2 deletions be/src/runtime/workload_group/workload_group_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ void WorkloadGroupMgr::handle_paused_queries() {
"so that other query will reduce their memory. wg: "
<< wg->debug_string();
}
if (wg->slot_memory_policy() == TWgSlotMemoryPolicy::DISABLED) {
if (wg->slot_memory_policy() == TWgSlotMemoryPolicy::NONE) {
// If not enable slot memory policy, then should spill directly
// Maybe there are another query that use too much memory, but we
// not encourage not enable slot memory.
Expand Down Expand Up @@ -790,7 +790,7 @@ void WorkloadGroupMgr::update_queries_limit_(WorkloadGroupPtr wg, bool enable_ha
}
// Both enable overcommit and not enable overcommit, if user set slot memory policy
// then we will replace the memtracker's memlimit with
if (wg->slot_memory_policy() == TWgSlotMemoryPolicy::DISABLED) {
if (wg->slot_memory_policy() == TWgSlotMemoryPolicy::NONE) {
return;
}
int32_t total_used_slot_count = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ public class WorkloadGroup implements Writable, GsonPostProcessable {
}

public static final int WRITE_BUFFER_RATIO_DEFAULT_VALUE = 20;
public static final String SLOT_MEMORY_POLICY_DEFAULT_VALUE = "disabled";
public static final String SLOT_MEMORY_POLICY_DEFAULT_VALUE = "none";
public static final HashSet<String> AVAILABLE_SLOT_MEMORY_POLICY_VALUES = new HashSet<String>() {{
add("disabled");
add("none");
add("fixed");
add("dynamic");
}};
Expand Down Expand Up @@ -372,7 +372,7 @@ private static void checkProperties(Map<String, String> properties) throws DdlEx
String value = properties.get(SLOT_MEMORY_POLICY).toLowerCase();
if (!AVAILABLE_SLOT_MEMORY_POLICY_VALUES.contains(value)) {
throw new DdlException("The value of '" + SLOT_MEMORY_POLICY
+ "' must be one of disabled, fixed, dynamic.");
+ "' must be one of none, fixed, dynamic.");
}
}

Expand Down Expand Up @@ -667,8 +667,8 @@ public TPipelineWorkloadGroup toThrift() {
}

public static TWgSlotMemoryPolicy findSlotPolicyValueByString(String slotPolicy) {
if (slotPolicy.equalsIgnoreCase("disabled")) {
return TWgSlotMemoryPolicy.DISABLED;
if (slotPolicy.equalsIgnoreCase("none")) {
return TWgSlotMemoryPolicy.NONE;
} else if (slotPolicy.equalsIgnoreCase("fixed")) {
return TWgSlotMemoryPolicy.FIXED;
} else if (slotPolicy.equalsIgnoreCase("dynamic")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ public void testPolicyToString() {
Assert.assertEquals(p1, TWgSlotMemoryPolicy.FIXED);
TWgSlotMemoryPolicy p2 = WorkloadGroup.findSlotPolicyValueByString("dynamic");
Assert.assertEquals(p2, TWgSlotMemoryPolicy.DYNAMIC);
TWgSlotMemoryPolicy p3 = WorkloadGroup.findSlotPolicyValueByString("disabled");
Assert.assertEquals(p3, TWgSlotMemoryPolicy.DISABLED);
TWgSlotMemoryPolicy p4 = WorkloadGroup.findSlotPolicyValueByString("disableD");
Assert.assertEquals(p4, TWgSlotMemoryPolicy.DISABLED);
TWgSlotMemoryPolicy p3 = WorkloadGroup.findSlotPolicyValueByString("none");
Assert.assertEquals(p3, TWgSlotMemoryPolicy.NONE);
TWgSlotMemoryPolicy p4 = WorkloadGroup.findSlotPolicyValueByString("none");
Assert.assertEquals(p4, TWgSlotMemoryPolicy.NONE);
boolean hasException = false;
try {
WorkloadGroup.findSlotPolicyValueByString("disableDa");
Expand Down
2 changes: 1 addition & 1 deletion gensrc/thrift/BackendService.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ enum TTopicInfoType {
}

enum TWgSlotMemoryPolicy {
DISABLED = 0,
NONE = 0,
FIXED = 1,
DYNAMIC = 2
}
Expand Down

0 comments on commit 0d273b7

Please sign in to comment.