long periodMsec = retentionConfig.getPeriodMsec(); getExecutor().scheduleAtFixedRate( () -> applyTimeBasedRetention(),
private static <T> void checkFileWriterConfig(FileWriterRetentionConfig cfg, int fileCnt, long aggSize, long ageSec, long periodMsec) { assertEquals(fileCnt, cfg.getFileCount()); assertEquals(aggSize, cfg.getAggregateFileSize()); assertEquals(ageSec, cfg.getAgeSec()); assertEquals(periodMsec, cfg.getPeriodMsec()); cfg.toString(); int falseFileCnt = fileCnt-1; int trueFileCnt = fileCnt+1; long falseAggSize = aggSize-1; long trueAggSize = aggSize+1; assertFalse("fileCnt:"+fileCnt+" aggSize:"+aggSize, cfg.evaluate(falseFileCnt, falseAggSize)); if (fileCnt!=0) assertTrue("fileCnt:"+fileCnt+" aggSize:"+aggSize, cfg.evaluate(trueFileCnt, falseAggSize)); if (aggSize!=0) assertTrue("fileCnt:"+fileCnt+" aggSize:"+aggSize, cfg.evaluate(falseFileCnt, trueAggSize)); }