Skip to content

Commit

Permalink
Improve comments/javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Will-Lo committed Dec 24, 2024
1 parent 7da279d commit 5da42cc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ public void expireSnapshots(String fqtn, int maxAge, String granularity, int ver

/**
* Expire snapshots on a given {@link Table}. If maxAge is provided, it will expire snapshots
* older than maxAge milliseconds. If versions is provided, it will retain the last versions
* snapshots. If both are provided, it will prioritize maxAge - only retain up to versions number
* of snapshots younger than the maxAge
* older than maxAge in granularity timeunit. If versions is provided, it will retain the last
* versions snapshots. If both are provided, it will prioritize maxAge; only retain up to versions
* number of snapshots younger than the maxAge
*/
public void expireSnapshots(Table table, int maxAge, String granularity, int versions) {
ExpireSnapshots expireSnapshotsCommand = table.expireSnapshots().cleanExpiredFiles(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import lombok.Getter;
import lombok.ToString;

/** Table retention config class. This is app side representation of /tables policies->retention */
/** History Policy config class. This is app side representation of /tables policies->history */
@Builder
@Getter
@EqualsAndHashCode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public void testSnapshotsExpirationMaxAge() throws Exception {
final int numInserts = 3;
final int maxAge = 0;
// Not a realistic time setting that is accepted by the SQL, but tests that other snapshots are
// deleted
// deleted by the time history policy
final String timeGranularity = "DAYS";

List<Long> snapshotIds;
Expand All @@ -293,7 +293,7 @@ public void testSnapshotsExpirationMaxAge() throws Exception {
log.info("Loaded table {}, location {}", table.name(), table.location());

ops.expireSnapshots(table, maxAge, timeGranularity, 0);
// No snapshots should be cleaned up as they are all within the max age
// Only retain the last snapshot
checkSnapshots(table, snapshotIds.subList(snapshotIds.size() - 1, snapshotIds.size()));
}
// restart the app to reload catalog cache
Expand Down

0 comments on commit 5da42cc

Please sign in to comment.