Reducing list status calls from listing logfile versions, some associated refactoring
This commit is contained in:
committed by
vinoth chandar
parent
937ae322ba
commit
e10100fe32
@@ -36,6 +36,7 @@ import org.apache.hadoop.fs.Path;
|
||||
public class HoodieLogFile implements Serializable {
|
||||
|
||||
public static final String DELTA_EXTENSION = ".log";
|
||||
public static final Integer LOGFILE_BASE_VERSION = 1;
|
||||
|
||||
private final Path path;
|
||||
private Optional<FileStatus> fileStatus;
|
||||
|
||||
@@ -284,7 +284,7 @@ public class FSUtils {
|
||||
Optional<Integer> currentVersion =
|
||||
getLatestLogVersion(fs, partitionPath, fileId, logFileExtension, baseCommitTime);
|
||||
// handle potential overflow
|
||||
return (currentVersion.isPresent()) ? currentVersion.get() : 1;
|
||||
return (currentVersion.isPresent()) ? currentVersion.get() : HoodieLogFile.LOGFILE_BASE_VERSION;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -295,7 +295,7 @@ public class FSUtils {
|
||||
Optional<Integer> currentVersion =
|
||||
getLatestLogVersion(fs, partitionPath, fileId, logFileExtension, baseCommitTime);
|
||||
// handle potential overflow
|
||||
return (currentVersion.isPresent()) ? currentVersion.get() + 1 : 1;
|
||||
return (currentVersion.isPresent()) ? currentVersion.get() + 1 : HoodieLogFile.LOGFILE_BASE_VERSION;
|
||||
}
|
||||
|
||||
public static int getDefaultBufferSize(final FileSystem fs) {
|
||||
|
||||
Reference in New Issue
Block a user