SteNicholas commented on code in PR #123:
URL:
https://github.com/apache/incubator-paimon-webui/pull/123#discussion_r1426557362
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/data/vo/SnapshotVO.java:
##########
@@ -18,72 +18,47 @@
package org.apache.paimon.web.server.data.vo;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
import java.time.LocalDateTime;
/** VO of metadata snapshot. */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
public class SnapshotVO {
- private final Long snapshotId;
- private final Long schemaId;
- private final Long commitIdentifier;
- private final LocalDateTime commitTime;
-
- public SnapshotVO(
- Long snapshotId, Long schemaId, Long commitIdentifier,
LocalDateTime commitTime) {
- this.snapshotId = snapshotId;
- this.schemaId = schemaId;
- this.commitIdentifier = commitIdentifier;
- this.commitTime = commitTime;
- }
-
- public Long getSnapshotId() {
- return snapshotId;
- }
-
- public Long getSchemaId() {
- return schemaId;
- }
-
- public Long getCommitIdentifier() {
- return commitIdentifier;
- }
-
- public LocalDateTime getCommitTime() {
- return commitTime;
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- /** Builder for SnapshotInfoVo. */
- public static class Builder {
- private Long snapshotId;
- private Long schemaId;
- private Long commitIdentifier;
- private LocalDateTime commitTime;
-
- public Builder setSnapshotId(Long snapshotId) {
- this.snapshotId = snapshotId;
- return this;
- }
-
- public Builder setSchemaId(Long schemaId) {
- this.schemaId = schemaId;
- return this;
- }
-
- public Builder setCommitIdentifier(Long commitIdentifier) {
- this.commitIdentifier = commitIdentifier;
- return this;
- }
-
- public Builder setCommitTime(LocalDateTime commitTime) {
- this.commitTime = commitTime;
- return this;
- }
-
- public SnapshotVO build() {
- return new SnapshotVO(snapshotId, schemaId, commitIdentifier,
commitTime);
- }
- }
+
+ private Long snapshotId;
+
+ private Long schemaId;
+
+ private String commitUser;
+
+ private Long commitIdentifier;
+
+ private String commitKind;
+
+ private LocalDateTime commitTime;
+
+ private String baseManifestList;
+
+ private String deltaManifestList;
+
+ private String changelogManifestList;
+
+ private Long totalRecordCount;
+
+ private Long deltaRecordCount;
+
+ private Long changelogRecordCount;
+
+ private Integer addedFileCount;
+
+ private Integer deletedFileCount;
Review Comment:
```suggestion
private Long deletedFileCount;
```
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/data/vo/SnapshotVO.java:
##########
@@ -18,72 +18,47 @@
package org.apache.paimon.web.server.data.vo;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
import java.time.LocalDateTime;
/** VO of metadata snapshot. */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
public class SnapshotVO {
- private final Long snapshotId;
- private final Long schemaId;
- private final Long commitIdentifier;
- private final LocalDateTime commitTime;
-
- public SnapshotVO(
- Long snapshotId, Long schemaId, Long commitIdentifier,
LocalDateTime commitTime) {
- this.snapshotId = snapshotId;
- this.schemaId = schemaId;
- this.commitIdentifier = commitIdentifier;
- this.commitTime = commitTime;
- }
-
- public Long getSnapshotId() {
- return snapshotId;
- }
-
- public Long getSchemaId() {
- return schemaId;
- }
-
- public Long getCommitIdentifier() {
- return commitIdentifier;
- }
-
- public LocalDateTime getCommitTime() {
- return commitTime;
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- /** Builder for SnapshotInfoVo. */
- public static class Builder {
- private Long snapshotId;
- private Long schemaId;
- private Long commitIdentifier;
- private LocalDateTime commitTime;
-
- public Builder setSnapshotId(Long snapshotId) {
- this.snapshotId = snapshotId;
- return this;
- }
-
- public Builder setSchemaId(Long schemaId) {
- this.schemaId = schemaId;
- return this;
- }
-
- public Builder setCommitIdentifier(Long commitIdentifier) {
- this.commitIdentifier = commitIdentifier;
- return this;
- }
-
- public Builder setCommitTime(LocalDateTime commitTime) {
- this.commitTime = commitTime;
- return this;
- }
-
- public SnapshotVO build() {
- return new SnapshotVO(snapshotId, schemaId, commitIdentifier,
commitTime);
- }
- }
+
+ private Long snapshotId;
+
+ private Long schemaId;
+
+ private String commitUser;
+
+ private Long commitIdentifier;
+
+ private String commitKind;
+
+ private LocalDateTime commitTime;
+
+ private String baseManifestList;
+
+ private String deltaManifestList;
+
+ private String changelogManifestList;
+
+ private Long totalRecordCount;
+
+ private Long deltaRecordCount;
+
+ private Long changelogRecordCount;
+
+ private Integer addedFileCount;
Review Comment:
```suggestion
private Long addedFileCount;
```
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/service/impl/MetadataServiceImpl.java:
##########
@@ -157,11 +173,32 @@ public List<DataFileVO> getDataFile(MetadataDTO dto) {
try {
reader.forEachRemaining(
internalRow -> {
- DataFileVO dataFileVo = new DataFileVO();
-
dataFileVo.setPartition(internalRow.getString(0).toString());
- dataFileVo.setBucket(internalRow.getInt(1));
-
dataFileVo.setFilePath(internalRow.getString(2).toString());
-
dataFileVo.setFileFormat(internalRow.getString(3).toString());
+ DataFileVO dataFileVo =
+ DataFileVO.builder()
+
.partition(internalRow.getString(0).toString())
+ .bucket(internalRow.getInt(1))
+
.filePath(internalRow.getString(2).toString())
+
.fileFormat(internalRow.getString(3).toString())
+ .schemaId(internalRow.getLong(4))
+ .level(internalRow.getInt(5))
+ .recordCount(internalRow.getLong(6))
+
.fileSizeInBytes(internalRow.getLong(7))
+ .minKey(
+ internalRow.getString(8) !=
null
+ ?
internalRow.getString(8).toString()
+ : "")
Review Comment:
Ditto.
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/service/impl/MetadataServiceImpl.java:
##########
@@ -108,11 +108,25 @@ public List<SnapshotVO> getSnapshot(MetadataDTO dto) {
internalRow -> {
SnapshotVO build =
SnapshotVO.builder()
- .setSnapshotId(internalRow.getLong(0))
- .setSnapshotId(internalRow.getLong(1))
-
.setCommitIdentifier(internalRow.getLong(3))
- .setCommitTime(
+ .snapshotId(internalRow.getLong(0))
+ .schemaId(internalRow.getLong(1))
+
.commitUser(internalRow.getString(2).toString())
+
.commitIdentifier(internalRow.getLong(3))
+
.commitKind(internalRow.getString(4).toString())
+ .commitTime(
internalRow.getTimestamp(5,
3).toLocalDateTime())
+
.baseManifestList(internalRow.getString(6).toString())
+
.deltaManifestList(internalRow.getString(7).toString())
+ .changelogManifestList(
+ internalRow.getString(8) !=
null
+ ?
internalRow.getString(8).toString()
+ : "")
Review Comment:
Why not null?
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/service/impl/MetadataServiceImpl.java:
##########
@@ -157,11 +173,32 @@ public List<DataFileVO> getDataFile(MetadataDTO dto) {
try {
reader.forEachRemaining(
internalRow -> {
- DataFileVO dataFileVo = new DataFileVO();
-
dataFileVo.setPartition(internalRow.getString(0).toString());
- dataFileVo.setBucket(internalRow.getInt(1));
-
dataFileVo.setFilePath(internalRow.getString(2).toString());
-
dataFileVo.setFileFormat(internalRow.getString(3).toString());
+ DataFileVO dataFileVo =
+ DataFileVO.builder()
+
.partition(internalRow.getString(0).toString())
+ .bucket(internalRow.getInt(1))
+
.filePath(internalRow.getString(2).toString())
+
.fileFormat(internalRow.getString(3).toString())
+ .schemaId(internalRow.getLong(4))
+ .level(internalRow.getInt(5))
+ .recordCount(internalRow.getLong(6))
+
.fileSizeInBytes(internalRow.getLong(7))
+ .minKey(
+ internalRow.getString(8) !=
null
+ ?
internalRow.getString(8).toString()
+ : "")
+ .maxKey(
+ internalRow.getString(9) !=
null
+ ?
internalRow.getString(9).toString()
+ : "")
Review Comment:
Ditto.
--
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]