Skip to content

Commit

Permalink
Fix compactor and associated test.
Browse files Browse the repository at this point in the history
  • Loading branch information
kenwenzel committed Sep 6, 2024
1 parent 38e02cb commit bb64f4e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,18 @@ public class Compactor {
final KvinParquet kvinParquet;
final File compactionFolder;
String archiveLocation;
int dataFileCompactionTrigger = 3, mappingFileCompactionTrigger = 3;
int dataFileCompactionTrigger, mappingFileCompactionTrigger;

public Compactor(KvinParquet kvinParquet) {
this(kvinParquet, 3, 3);
}

public Compactor(KvinParquet kvinParquet, int dataFileCompactionTrigger, int mappingFileCompactionTrigger) {
this.archiveLocation = kvinParquet.archiveLocation;
this.compactionFolder = new File(archiveLocation, ".compaction");
this.kvinParquet = kvinParquet;
this.dataFileCompactionTrigger = dataFileCompactionTrigger;
this.mappingFileCompactionTrigger = mappingFileCompactionTrigger;
}

public void execute() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void shouldDoFetchForNonSeqEntry() {

@Test
public void mappingFileCompactionTest() throws IOException, InterruptedException {
new Compactor(kvinParquet).execute();
new Compactor(kvinParquet, 1, 1).execute();

File[] metadataFiles = new File(kvinParquet.archiveLocation, "metadata")
.listFiles((file, s) -> s.endsWith(".parquet"));
Expand Down

0 comments on commit bb64f4e

Please sign in to comment.