Skip to content

Commit b65ec60

Browse files
committed
fix checkstyle
1 parent 1355dde commit b65ec60

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

amoro-ams/src/main/java/org/apache/amoro/server/optimizing/maintainer/DataExpirationProcessor.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,10 @@ public int compareTo(@NotNull ManifestFileWrapper o) {
537537

538538
@Override
539539
public boolean equals(Object o) {
540-
if (o == null || getClass() != o.getClass()) return false;
540+
if (o == null || getClass() != o.getClass()) {
541+
return false;
542+
}
543+
541544
ManifestFileWrapper wrapper = (ManifestFileWrapper) o;
542545
return com.google.common.base.Objects.equal(manifestFile, wrapper.manifestFile)
543546
&& com.google.common.base.Objects.equal(range, wrapper.range);
@@ -698,9 +701,7 @@ public Long decodeBound(ByteBuffer bound) {
698701
} else if (tsUnit.equals(EXPIRE_TIMESTAMP_S)) {
699702
return (Long) boundValue * 1000;
700703
}
701-
default:
702-
throw new UnsupportedOperationException(
703-
"Cannot extract partition bound from identity transform for type: " + sourceType);
704+
break;
704705
}
705706
} else if (transformName.equalsIgnoreCase("day")) {
706707
Integer days = (Integer) boundValue;
@@ -822,11 +823,13 @@ static Long sanitizeExpireTimestamp(
822823
case TIMESTAMP:
823824
return expireTimestamp * DateTimeUtil.MICROS_PER_MILLIS;
824825
case LONG:
825-
if (config.getNumberDateFormat().equals(EXPIRE_TIMESTAMP_MS)) {
826+
String dateFormat = config.getNumberDateFormat();
827+
if (EXPIRE_TIMESTAMP_MS.equalsIgnoreCase(dateFormat)) {
826828
return expireTimestamp;
827-
} else if (config.getNumberDateFormat().equals(EXPIRE_TIMESTAMP_S)) {
829+
} else if (EXPIRE_TIMESTAMP_S.equalsIgnoreCase(dateFormat)) {
828830
return expireTimestamp / 1000L;
829831
}
832+
break;
830833
case STRING:
831834
return expireTimestamp;
832835
default:
@@ -836,6 +839,8 @@ static Long sanitizeExpireTimestamp(
836839
+ " for type: "
837840
+ expirationType);
838841
}
842+
843+
throw new IllegalStateException("Cannot sanitize expire timestamp: " + expireTimestamp);
839844
}
840845

841846
static class PartitionFieldInfo {

amoro-ams/src/main/java/org/apache/amoro/server/optimizing/maintainer/IcebergExpirationProcessor.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,12 @@
4747
import org.slf4j.LoggerFactory;
4848

4949
import java.io.IOException;
50-
import java.time.*;
51-
import java.util.*;
50+
import java.time.Instant;
51+
import java.util.Collections;
52+
import java.util.List;
53+
import java.util.Map;
54+
import java.util.Optional;
55+
import java.util.Set;
5256

5357
/**
5458
* Data expiration processor for Iceberg tables.

0 commit comments

Comments
 (0)