Azkaban的线程系列 36:AzkabanWebServer-Cleaner-Thread

此线程 azkaban.executor.ExecutorManager$CleanerThread.run

-------------------------------------------------------------------------------------------------------------------------------------------------

// check every day

private static final long CLEANER_THREAD_WAIT_INTERVAL_MS = 24 * 60 * 60 * 1000;

根据上面的设置,每隔1天检查1次。

然后往下执行

private void cleanOldExecutionLogs(long millis) {

try {

int count = executorLoader.removeExecutionLogsByTime(millis);

logger.info("Cleaned up " + count + " log entries.");

} catch (ExecutorManagerException e) {

e.printStackTrace();

}

}

那么,int count = executorLoader.removeExecutionLogsByTime(millis);做了什么事情呢?

@Override

public int removeExecutionLogsByTime(long millis) throws ExecutorManagerException {

final String DELETE_BY_TIME = "DELETE FROM execution_logs WHERE upload_time < ?";

 

QueryRunner runner = createQueryRunner();

int updateNum = 0;

try {

updateNum = runner.update(DELETE_BY_TIME, millis);

} catch (SQLException e) {

e.printStackTrace();

throw new ExecutorManagerException("Error deleting old execution_logs before " + millis, e);

}

 

return updateNum;

}

其实就是删除执行的日志,从DB中删除,看来就是删除过期数据,

那么到底保留多少天的数据呢?


long executionLogsRetentionMs = azkProps.getLong("execution.logs.retention.ms",

DEFAULT_EXECUTION_LOGS_RETENTION_MS);

 

cleanerThread = new CleanerThread(executionLogsRetentionMs);

cleanerThread.start();

// 12 weeks

private static final long DEFAULT_EXECUTION_LOGS_RETENTION_MS = 3 * 4 * 7 * 24 * 60 * 60 * 1000L;

也就是说,默认保留3个礼拜的执行日志!


日志其实是executor server上传的!

转载于:https://my.oschina.net/qiangzigege/blog/657925

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值