alexeykudinkin commented on code in PR #6384:
URL: https://github.com/apache/hudi/pull/6384#discussion_r1081919293
##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieLogFile.java:
##########
@@ -48,59 +52,72 @@ public class HoodieLogFile implements Serializable {
private transient FileStatus fileStatus;
private final String pathStr;
private long fileLen;
+ private transient Path path;
+ private transient String fileId;
+ private transient String baseTime;
+ private transient int logVersion = Integer.MIN_VALUE;
+ private transient String writeToken;
public HoodieLogFile(HoodieLogFile logFile) {
this.fileStatus = logFile.fileStatus;
this.pathStr = logFile.pathStr;
this.fileLen = logFile.fileLen;
+ initLogFileBaseInfo();
}
public HoodieLogFile(FileStatus fileStatus) {
this.fileStatus = fileStatus;
this.pathStr = fileStatus.getPath().toString();
this.fileLen = fileStatus.getLen();
+ initLogFileBaseInfo();
}
public HoodieLogFile(Path logPath) {
this.fileStatus = null;
this.pathStr = logPath.toString();
this.fileLen = -1;
+ initLogFileBaseInfo();
}
public HoodieLogFile(Path logPath, Long fileLen) {
this.fileStatus = null;
this.pathStr = logPath.toString();
this.fileLen = fileLen;
+ initLogFileBaseInfo();
}
public HoodieLogFile(String logPathStr) {
this.fileStatus = null;
this.pathStr = logPathStr;
this.fileLen = -1;
+ initLogFileBaseInfo();
}
public String getFileId() {
- return FSUtils.getFileIdFromLogPath(getPath());
+ return fileId;
Review Comment:
Since this is transient we need to check whether this is null before
returning
##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieLogFile.java:
##########
@@ -98,7 +111,10 @@ public String getFileExtension() {
}
public Path getPath() {
- return new Path(pathStr);
+ if (path == null) {
+ this.path = new Path(pathStr);
Review Comment:
This is still a Path and not a CachingPath
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]