Skip to content

Commit

Permalink
Remove redundant TransactionLogTail.loadNewTail
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr committed Mar 12, 2024
1 parent 84373d3 commit ef3a573
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static TableSnapshot load(
throws IOException
{
Optional<Long> lastCheckpointVersion = lastCheckpoint.map(LastCheckpoint::getVersion);
TransactionLogTail transactionLogTail = TransactionLogTail.loadNewTail(fileSystem, tableLocation, lastCheckpointVersion);
TransactionLogTail transactionLogTail = TransactionLogTail.loadNewTail(fileSystem, tableLocation, lastCheckpointVersion, Optional.empty());

return new TableSnapshot(
table,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,6 @@ private TransactionLogTail(List<Transaction> entries, long version)
this.version = version;
}

public static TransactionLogTail loadNewTail(
TrinoFileSystem fileSystem,
String tableLocation,
Optional<Long> startVersion)
throws IOException
{
return loadNewTail(fileSystem, tableLocation, startVersion, Optional.empty());
}

// Load a section of the Transaction Log JSON entries. Optionally from a given start version (exclusive) through an end version (inclusive)
public static TransactionLogTail loadNewTail(
TrinoFileSystem fileSystem,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private List<DeltaLakeTransactionLogEntry> readJsonTransactionLogTails(String ta
throws Exception
{
TrinoFileSystem fileSystem = new HdfsFileSystemFactory(HDFS_ENVIRONMENT, HDFS_FILE_SYSTEM_STATS).create(SESSION);
TransactionLogTail transactionLogTail = TransactionLogTail.loadNewTail(fileSystem, tableLocation, Optional.of(10L));
TransactionLogTail transactionLogTail = TransactionLogTail.loadNewTail(fileSystem, tableLocation, Optional.of(10L), Optional.empty());
return transactionLogTail.getFileEntries();
}
}

0 comments on commit ef3a573

Please sign in to comment.