@Override
  protected void periodicExecute(final Env env) {
    if (completed.isEmpty()) {
      if (LOG.isTraceEnabled()) {
        LOG.trace("No completed procedures to cleanup.");
      }
      return;
    }

    final long[] batchIds = new long[DEFAULT_BATCH_SIZE];
    int batchCount = 0;

    final long now = System.currentTimeMillis();
    final Iterator<Map.Entry<Long, CompletedProcedureContainer<Env>>> it =
        completed.entrySet().iterator();
    while (it.hasNext() && store.isRunning()) {
      final Map.Entry<Long, CompletedProcedureContainer<Env>> entry = it.next();
      final CompletedProcedureContainer<Env> retainer = entry.getValue();
      final Procedure<?> proc = retainer.getProcedure();
      if (retainer.isExpired(now, evictTTL)) {
        // Failed procedures aren't persisted in WAL.
        batchIds[batchCount++] = entry.getKey();
        if (batchCount == batchIds.length) {
          store.delete(batchIds, 0, batchCount);
          batchCount = 0;
        }
        it.remove();
        LOG.trace("Evict completed {}", proc);
      }
    }
    if (batchCount > 0) {
      store.delete(batchIds, 0, batchCount);
    }
  }
Internal cleaner that removes the completed procedure results after a TTL.
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/CompletedProcedureRecycler.java