[enhancement](load) make default load mem limit configurable (#12348)
* make LoadMemLimit valid for broker load, stream load and routine load Co-authored-by: wuhangze <wuhangze@jd.com>
This commit is contained in:
@ -296,7 +296,7 @@ public class Load {
|
||||
// resource info
|
||||
if (ConnectContext.get() != null) {
|
||||
job.setResourceInfo(ConnectContext.get().toResourceCtx());
|
||||
job.setExecMemLimit(ConnectContext.get().getSessionVariable().getMaxExecMemByte());
|
||||
job.setExecMemLimit(ConnectContext.get().getSessionVariable().getLoadMemLimit());
|
||||
}
|
||||
|
||||
// job properties
|
||||
|
||||
@ -289,6 +289,8 @@ public abstract class RoutineLoadJob extends AbstractTxnStateChangeCallback impl
|
||||
}
|
||||
if (stmt.getExecMemLimit() != -1) {
|
||||
this.execMemLimit = stmt.getExecMemLimit();
|
||||
} else if (ConnectContext.get() != null) {
|
||||
this.execMemLimit = ConnectContext.get().getSessionVariable().getLoadMemLimit();
|
||||
}
|
||||
if (stmt.getSendBatchParallelism() > 0) {
|
||||
this.sendBatchParallelism = stmt.getSendBatchParallelism();
|
||||
|
||||
@ -382,7 +382,7 @@ public class SessionVariable implements Serializable, Writable {
|
||||
public boolean forwardToMaster = true;
|
||||
|
||||
@VariableMgr.VarAttr(name = LOAD_MEM_LIMIT)
|
||||
public long loadMemLimit = 0L;
|
||||
public long loadMemLimit = 2 * 1024 * 1024 * 1024L; // 2GB as default
|
||||
|
||||
@VariableMgr.VarAttr(name = USE_V2_ROLLUP)
|
||||
public boolean useV2Rollup = false;
|
||||
|
||||
@ -30,6 +30,7 @@ import org.apache.doris.common.UserException;
|
||||
import org.apache.doris.common.util.SqlParserUtils;
|
||||
import org.apache.doris.common.util.TimeUtils;
|
||||
import org.apache.doris.load.loadv2.LoadTask;
|
||||
import org.apache.doris.qe.VariableMgr;
|
||||
import org.apache.doris.thrift.TFileFormatType;
|
||||
import org.apache.doris.thrift.TFileType;
|
||||
import org.apache.doris.thrift.TStreamLoadPutRequest;
|
||||
@ -290,6 +291,8 @@ public class StreamLoadTask implements LoadTaskInfo {
|
||||
}
|
||||
if (request.isSetExecMemLimit()) {
|
||||
execMemLimit = request.getExecMemLimit();
|
||||
} else {
|
||||
execMemLimit = VariableMgr.getDefaultSessionVariable().getLoadMemLimit();
|
||||
}
|
||||
if (request.getFormatType() == TFileFormatType.FORMAT_JSON) {
|
||||
if (request.getJsonpaths() != null) {
|
||||
|
||||
Reference in New Issue
Block a user