// TODO: Replace with table metadata expiration through Iceberg API
//       when https://github.com/apache/incubator-iceberg/issues/181 is resolved
//       table.expireTableMetadata().expireOlderThan(current).commit();
public boolean expire(Table table) {
    if (expirationPeriod <= 0) {
      return false;
    }
    long current = System.currentTimeMillis();
    Long last = expirationStatus.putIfAbsent(table.location(), current);
    if (last != null && current - last >= expirationPeriod) {
      expirationStatus.put(table.location(), current);
      ExecutorService executorService = executorService();
      executorService.submit(() -> {
        logger.debug("Expiring Iceberg table [{}] metadata", table.location());
        table.expireSnapshots()
          .expireOlderThan(current)
          .commit();
        // TODO: Replace with table metadata expiration through Iceberg API
        //       when https://github.com/apache/incubator-iceberg/issues/181 is resolved
        //       table.expireTableMetadata().expireOlderThan(current).commit();
        expireTableMetadata(table);
      });
      return true;
    }
    return false;
  }
.expireOlderThan(current)
.commit();
// TODO: Replace with table metadata expiration through Iceberg API
// when https://github.com/apache/incubator-iceberg/issues/181 is resolved
// table.expireTableMetadata().expireOlderThan(current).commit();
expireTableMetadata(table);
});
long current = System.currentTimeMillis();
Long last = expirationStatus.putIfAbsent(table.location(), current);
if (last != null && current - last >= expirationPeriod) {
expirationStatus.put(table.location(), current);
ExecutorService executorService = executorService();
executorService.submit(() -> {
logger.debug("Expiring Iceberg table [{}] metadata", table.location());
table.expireSnapshots()
.expireOlderThan(current)
.commit();
// TODO: Replace with table metadata expiration through Iceberg API
// when https://github.com/apache/incubator-iceberg/issues/181 is resolved
// table.expireTableMetadata().expireOlderThan(current).commit();
expireTableMetadata(table);
});
return true;
}
return false;
}
public boolean expire(Table table) {
if (expirationPeriod <= 0) {
return false;
}
long current = System.currentTimeMillis();
Long last = expirationStatus.putIfAbsent(table.location(), current);
if (last != null && current - last >= expirationPeriod) {
expirationStatus.put(table.location(), current);
ExecutorService executorService = executorService();
executorService.submit(() -> {
logger.debug("Expiring Iceberg table [{}] metadata", table.location());
table.expireSnapshots()
.expireOlderThan(current)
.commit();
// TODO: Replace with table metadata expiration through Iceberg API
// when https://github.com/apache/incubator-iceberg/issues/181 is resolved
// table.expireTableMetadata().expireOlderThan(current).commit();
expireTableMetadata(table);
});
return true;
}
return false;
}