Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
advancedxy committed Jan 16, 2024
1 parent d2e6e98 commit 67eb872
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class RewriteDataFilesCommitManager {
private final Table table;
private final long startingSnapshotId;
private final boolean useStartingSequenceNumber;
private final Map<String, String> extraCommitSummary;
private final Map<String, String> snapshotProperties;

// constructor used for testing
public RewriteDataFilesCommitManager(Table table) {
Expand All @@ -58,11 +58,11 @@ public RewriteDataFilesCommitManager(
Table table,
long startingSnapshotId,
boolean useStartingSequenceNumber,
Map<String, String> extraCommitSummary) {
Map<String, String> snapshotProperties) {
this.table = table;
this.startingSnapshotId = startingSnapshotId;
this.useStartingSequenceNumber = useStartingSequenceNumber;
this.extraCommitSummary = extraCommitSummary;
this.snapshotProperties = snapshotProperties;
}

/**
Expand All @@ -87,7 +87,7 @@ public void commitFileGroups(Set<RewriteFileGroup> fileGroups) {
rewrite.rewriteFiles(rewrittenDataFiles, addedDataFiles);
}

extraCommitSummary.forEach(rewrite::set);
snapshotProperties.forEach(rewrite::set);

rewrite.commit();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ public class RewritePositionDeletesCommitManager {

private final Table table;
private final long startingSnapshotId;
private final Map<String, String> extraCommitSummary;
private final Map<String, String> snapshotProperties;

public RewritePositionDeletesCommitManager(Table table) {
this(table, ImmutableMap.of());
}

public RewritePositionDeletesCommitManager(Table table, Map<String, String> extraCommitSummary) {
public RewritePositionDeletesCommitManager(Table table, Map<String, String> snapshotProperties) {
this.table = table;
this.startingSnapshotId = table.currentSnapshot().snapshotId();
this.extraCommitSummary = extraCommitSummary;
this.snapshotProperties = snapshotProperties;
}

/**
Expand All @@ -72,7 +72,7 @@ public void commit(Set<RewritePositionDeletesGroup> fileGroups) {
}
}

extraCommitSummary.forEach(rewriteFiles::set);
snapshotProperties.forEach(rewriteFiles::set);

rewriteFiles.commit();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1452,7 +1452,7 @@ public void testSnapshotProperty() {
Result ignored = basicRewrite(table).snapshotProperty("key", "value").execute();
assertThat(table.currentSnapshot().summary())
.containsAllEntriesOf(ImmutableMap.of("key", "value"));
// make sure internal produced properties is not lost
// make sure internal produced properties are not lost
String[] commitMetricsKeys =
new String[] {
SnapshotSummary.ADDED_FILES_PROP,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ public void testSnapshotProperty() throws Exception {
assertThat(table.currentSnapshot().summary())
.containsAllEntriesOf(ImmutableMap.of("key", "value"));

// make sure internal produced properties is not lost
// make sure internal produced properties are not lost
String[] commitMetricsKeys =
new String[] {
SnapshotSummary.ADDED_DELETE_FILES_PROP,
Expand Down

0 comments on commit 67eb872

Please sign in to comment.