Skip to content

Commit

Permalink
Merge branch 'master' into ttl-lru-evict
Browse files Browse the repository at this point in the history
  • Loading branch information
freemandealer authored Jul 10, 2024
2 parents 3e5cd77 + 568fe0f commit 7463b97
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 17 deletions.
1 change: 0 additions & 1 deletion be/cmake/thirdparty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ if (USE_JEMALLOC)
else()
add_thirdparty(tcmalloc WHOLELIBPATH ${GPERFTOOLS_HOME}/lib/libtcmalloc.a NOTADD)
endif()
add_thirdparty(jemalloc_arrow LIBNAME "lib/libjemalloc_arrow.a")

if (WITH_MYSQL)
add_thirdparty(mysql LIBNAME "lib/libmysqlclient.a")
Expand Down
2 changes: 1 addition & 1 deletion be/src/util/disk_info_mac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void DiskInfo::get_device_names() {
std::sort(std::begin(mount_infos), std::end(mount_infos),
[](const auto& info, const auto& other) {
const auto& mount_point = info.second;
const auto& other_mount_point = info.second;
const auto& other_mount_point = other.second;
return mount_point < other_mount_point;
});

Expand Down
7 changes: 5 additions & 2 deletions cloud/cmake/thirdparty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,16 @@ add_thirdparty(glog)
add_thirdparty(gflags)
add_thirdparty(backtrace)
add_thirdparty(pprof WHOLELIBPATH ${GPERFTOOLS_HOME}/lib/libprofiler.a)
add_thirdparty(tcmalloc WHOLELIBPATH ${GPERFTOOLS_HOME}/lib/libtcmalloc.a NOTADD)
add_thirdparty(protobuf)
add_thirdparty(thrift)
add_thirdparty(crypto)
add_thirdparty(openssl LIBNAME "lib/libssl.a")
add_thirdparty(jemalloc LIBNAME "lib/libjemalloc_doris.a")
add_thirdparty(jemalloc_arrow LIBNAME "lib/libjemalloc_arrow.a")
if (USE_JEMALLOC)
add_thirdparty(jemalloc LIBNAME "lib/libjemalloc_doris.a")
else()
add_thirdparty(tcmalloc WHOLELIBPATH ${GPERFTOOLS_HOME}/lib/libtcmalloc.a NOTADD)
endif()
add_thirdparty(leveldb) # Required by brpc
add_thirdparty(brpc LIB64)
add_thirdparty(rocksdb) # For local storage mocking
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public void analyze(Analyzer analyzer) throws UserException {
if (null != onceJobStartTimestamp) {
if (onceJobStartTimestamp.equalsIgnoreCase(CURRENT_TIMESTAMP_STRING)) {
jobExecutionConfiguration.setImmediate(true);
timerDefinition.setStartTimeMs(System.currentTimeMillis());
} else {
timerDefinition.setStartTimeMs(TimeUtils.timeStringToLong(onceJobStartTimestamp));
}
Expand All @@ -149,6 +150,8 @@ public void analyze(Analyzer analyzer) throws UserException {
if (null != startsTimeStamp) {
if (startsTimeStamp.equalsIgnoreCase(CURRENT_TIMESTAMP_STRING)) {
jobExecutionConfiguration.setImmediate(true);
//To avoid immediate re-scheduling, set the start time of the timer 100ms before the current time.
timerDefinition.setStartTimeMs(System.currentTimeMillis());
} else {
timerDefinition.setStartTimeMs(TimeUtils.timeStringToLong(startsTimeStamp));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ public void checkParams() {
if (executeType == JobExecuteType.INSTANT || executeType == JobExecuteType.MANUAL) {
return;
}

checkTimerDefinition(immediate);

checkTimerDefinition();
if (executeType == JobExecuteType.ONE_TIME) {
validateStartTimeMs();
return;
Expand All @@ -80,12 +78,12 @@ public void checkParams() {
}
}

private void checkTimerDefinition(boolean immediate) {
private void checkTimerDefinition() {
if (timerDefinition == null) {
throw new IllegalArgumentException(
"timerDefinition cannot be null when executeType is not instant or manual");
}
timerDefinition.checkParams(immediate);
timerDefinition.checkParams();
}

private void validateStartTimeMs() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,7 @@ public class TimerDefinition {
private Long latestSchedulerTimeMs;


public void checkParams(boolean immediate) {
if (null != startTimeMs && immediate) {
throw new IllegalArgumentException("startTimeMs must be null when immediate is true");
}
if (null == startTimeMs && immediate) {
startTimeMs = System.currentTimeMillis();
}
public void checkParams() {
if (null == startTimeMs) {
startTimeMs = System.currentTimeMillis() + intervalUnit.getIntervalMs(interval);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ public void scheduleOneJob(T job) throws JobException {
schedulerInstantJob(job, TaskType.SCHEDULED, null);
}
}
if (job.getJobConfig().isImmediate() && JobExecuteType.ONE_TIME.equals(job.getJobConfig().getExecuteType())) {
schedulerInstantJob(job, TaskType.SCHEDULED, null);
return;
}
//RECURRING job and immediate is true
if (job.getJobConfig().isImmediate()) {
job.getJobConfig().getTimerDefinition().setLatestSchedulerTimeMs(System.currentTimeMillis());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public void testImmediate() {
JobExecutionConfiguration configuration = new JobExecutionConfiguration();
configuration.setExecuteType(JobExecuteType.ONE_TIME);
configuration.setImmediate(true);
configuration.setImmediate(true);
TimerDefinition timerDefinition = new TimerDefinition();
timerDefinition.setStartTimeMs(0L);
configuration.setTimerDefinition(timerDefinition);
configuration.checkParams();
}
Expand Down

0 comments on commit 7463b97

Please sign in to comment.