diff --git a/.github/workflows/unit-test-java.yml b/.github/workflows/unit-test-java.yml index bacbbd46e..ca900b746 100644 --- a/.github/workflows/unit-test-java.yml +++ b/.github/workflows/unit-test-java.yml @@ -44,7 +44,7 @@ jobs: fail-fast: false max-parallel: 15 matrix: - java: [ 8, 17, 21 ] + java: [ 8, 17, 25 ] os: [ ubuntu-latest, macos-latest, windows-latest ] runs-on: ${{ matrix.os }} diff --git a/cpp/pom.xml b/cpp/pom.xml index fa6b00708..ddc3e5e56 100644 --- a/cpp/pom.xml +++ b/cpp/pom.xml @@ -233,7 +233,7 @@ com.diffplug.spotless spotless-maven-plugin - ${spotless.version} + 2.44.3 diff --git a/java/common/src/main/java/org/apache/tsfile/enums/TSDataType.java b/java/common/src/main/java/org/apache/tsfile/enums/TSDataType.java index 4fb01f868..2a670379e 100644 --- a/java/common/src/main/java/org/apache/tsfile/enums/TSDataType.java +++ b/java/common/src/main/java/org/apache/tsfile/enums/TSDataType.java @@ -507,7 +507,7 @@ public int getDataTypeSize() { case FLOAT: case DATE: return 4; - // For text: return the size of reference here + // For text: return the size of reference here case TEXT: case INT64: case DOUBLE: @@ -544,7 +544,7 @@ public boolean isNumeric() { case FLOAT: case DOUBLE: return true; - // For text: return the size of reference here + // For text: return the size of reference here case BLOB: case TIMESTAMP: case DATE: diff --git a/java/tsfile/src/main/java/org/apache/tsfile/encoding/decoder/IntChimpDecoder.java b/java/tsfile/src/main/java/org/apache/tsfile/encoding/decoder/IntChimpDecoder.java index 1b1947cd6..9be522634 100644 --- a/java/tsfile/src/main/java/org/apache/tsfile/encoding/decoder/IntChimpDecoder.java +++ b/java/tsfile/src/main/java/org/apache/tsfile/encoding/decoder/IntChimpDecoder.java @@ -102,18 +102,18 @@ protected int readNext(ByteBuffer in) { current = (current + 1) % PREVIOUS_VALUES; storedValues[current] = storedValue; return storedValue; - // case 10: use the previous leading zeros and - // and just read the meaningful XORed value. + // case 10: use the previous leading zeros and + // and just read the meaningful XORed value. case 2: value = (int) readLong(VALUE_BITS_LENGTH_32BIT - storedLeadingZeros, in); storedValue = storedValue ^ value; current = (current + 1) % PREVIOUS_VALUES; storedValues[current] = storedValue; return storedValue; - // case 01: read the index of the previous value, the length of - // the number of leading zeros in the next 3 bits, then read - // the length of the meaningful XORed value in the next 5 - // bits. Finally read the meaningful bits of the XORed value. + // case 01: read the index of the previous value, the length of + // the number of leading zeros in the next 3 bits, then read + // the length of the meaningful XORed value in the next 5 + // bits. Finally read the meaningful bits of the XORed value. case 1: int fill = CASE_ONE_METADATA_LENGTH; int temp = (int) readLong(fill, in); @@ -132,8 +132,8 @@ protected int readNext(ByteBuffer in) { current = (current + 1) % PREVIOUS_VALUES; storedValues[current] = storedValue; return storedValue; - // case 00: the values are identical, just read - // the index of the previous value + // case 00: the values are identical, just read + // the index of the previous value default: int previousIndex = (int) readLong(PREVIOUS_VALUES_LOG2, in); storedValue = storedValues[previousIndex]; diff --git a/java/tsfile/src/main/java/org/apache/tsfile/encoding/decoder/IntGorillaDecoder.java b/java/tsfile/src/main/java/org/apache/tsfile/encoding/decoder/IntGorillaDecoder.java index fd3aede6e..a3366bed1 100644 --- a/java/tsfile/src/main/java/org/apache/tsfile/encoding/decoder/IntGorillaDecoder.java +++ b/java/tsfile/src/main/java/org/apache/tsfile/encoding/decoder/IntGorillaDecoder.java @@ -76,13 +76,13 @@ protected int readNext(ByteBuffer in) { byte significantBits = (byte) readLong(MEANINGFUL_XOR_BITS_LENGTH_32BIT, in); significantBits++; storedTrailingZeros = VALUE_BITS_LENGTH_32BIT - significantBits - storedLeadingZeros; - // missing break is intentional, we want to overflow to next one + // missing break is intentional, we want to overflow to next one case 2: // case '10': use stored leading and trailing zeros int xor = (int) readLong(VALUE_BITS_LENGTH_32BIT - storedLeadingZeros - storedTrailingZeros, in); xor <<= storedTrailingZeros; storedValue ^= xor; - // missing break is intentional, we want to overflow to next one + // missing break is intentional, we want to overflow to next one default: // case '0': use stored value return storedValue; } diff --git a/java/tsfile/src/main/java/org/apache/tsfile/encoding/decoder/LongChimpDecoder.java b/java/tsfile/src/main/java/org/apache/tsfile/encoding/decoder/LongChimpDecoder.java index 23712bae8..df11b40bc 100644 --- a/java/tsfile/src/main/java/org/apache/tsfile/encoding/decoder/LongChimpDecoder.java +++ b/java/tsfile/src/main/java/org/apache/tsfile/encoding/decoder/LongChimpDecoder.java @@ -92,9 +92,9 @@ protected long readNext(ByteBuffer in) { byte controlBits = readNextNBits(2, in); long value; switch (controlBits) { - // case 11: read the length of the number of leading - // zeros in the next 3 bits, then read the - // meaningful bits of the XORed value. + // case 11: read the length of the number of leading + // zeros in the next 3 bits, then read the + // meaningful bits of the XORed value. case 3: storedLeadingZeros = LEADING_REPRESENTATION[(int) readLong(3, in)]; value = readLong(VALUE_BITS_LENGTH_64BIT - storedLeadingZeros, in); @@ -102,18 +102,18 @@ protected long readNext(ByteBuffer in) { current = (current + 1) % PREVIOUS_VALUES; storedValues[current] = storedValue; return storedValue; - // case 10: use the previous leading zeros and - // and just read the meaningful XORed value. + // case 10: use the previous leading zeros and + // and just read the meaningful XORed value. case 2: value = readLong(VALUE_BITS_LENGTH_64BIT - storedLeadingZeros, in); storedValue = storedValue ^ value; current = (current + 1) % PREVIOUS_VALUES; storedValues[current] = storedValue; return storedValue; - // case 01: read the index of the previous value, the length of - // the number of leading zeros in the next 3 bits, then read - // the length of the meaningful XORed value in the next 6 - // bits. Finally read the meaningful bits of the XORed value. + // case 01: read the index of the previous value, the length of + // the number of leading zeros in the next 3 bits, then read + // the length of the meaningful XORed value in the next 6 + // bits. Finally read the meaningful bits of the XORed value. case 1: int fill = CASE_ONE_METADATA_LENGTH; int temp = (int) readLong(fill, in); @@ -131,8 +131,8 @@ protected long readNext(ByteBuffer in) { current = (current + 1) % PREVIOUS_VALUES; storedValues[current] = storedValue; return storedValue; - // case 00: the values are identical, just read - // the index of the previous value + // case 00: the values are identical, just read + // the index of the previous value default: int previousIndex = (int) readLong(PREVIOUS_VALUES_LOG2, in); storedValue = storedValues[previousIndex]; diff --git a/java/tsfile/src/main/java/org/apache/tsfile/encoding/decoder/LongGorillaDecoder.java b/java/tsfile/src/main/java/org/apache/tsfile/encoding/decoder/LongGorillaDecoder.java index 3610dd11f..24b81bcac 100644 --- a/java/tsfile/src/main/java/org/apache/tsfile/encoding/decoder/LongGorillaDecoder.java +++ b/java/tsfile/src/main/java/org/apache/tsfile/encoding/decoder/LongGorillaDecoder.java @@ -76,12 +76,12 @@ protected long readNext(ByteBuffer in) { byte significantBits = (byte) readLong(MEANINGFUL_XOR_BITS_LENGTH_64BIT, in); significantBits++; storedTrailingZeros = VALUE_BITS_LENGTH_64BIT - significantBits - storedLeadingZeros; - // missing break is intentional, we want to overflow to next one + // missing break is intentional, we want to overflow to next one case 2: // case '10': use stored leading and trailing zeros long xor = readLong(VALUE_BITS_LENGTH_64BIT - storedLeadingZeros - storedTrailingZeros, in); xor <<= storedTrailingZeros; storedValue ^= xor; - // missing break is intentional, we want to overflow to next one + // missing break is intentional, we want to overflow to next one default: // case '0': use stored value return storedValue; } diff --git a/java/tsfile/src/main/java/org/apache/tsfile/read/filter/operator/ExtractTimeFilterOperators.java b/java/tsfile/src/main/java/org/apache/tsfile/read/filter/operator/ExtractTimeFilterOperators.java index 3c93af5a3..087da75ef 100644 --- a/java/tsfile/src/main/java/org/apache/tsfile/read/filter/operator/ExtractTimeFilterOperators.java +++ b/java/tsfile/src/main/java/org/apache/tsfile/read/filter/operator/ExtractTimeFilterOperators.java @@ -184,7 +184,7 @@ protected BiFunction constructTruncatedEqualsFunction( switch (field) { case YEAR: return (timestamp1, timestamp2) -> true; - // base YEAR + // base YEAR case QUARTER: case MONTH: case WEEK: @@ -200,7 +200,7 @@ protected BiFunction constructTruncatedEqualsFunction( .withMonth(1) .withDayOfMonth(1) .truncatedTo(ChronoUnit.DAYS)); - // base MONTH + // base MONTH case DAY: case DAY_OF_MONTH: return (timestamp1, timestamp2) -> @@ -211,7 +211,7 @@ protected BiFunction constructTruncatedEqualsFunction( convertToZonedDateTime(timestamp2, zoneId) .withDayOfMonth(1) .truncatedTo(ChronoUnit.DAYS)); - // base WEEK + // base WEEK case DAY_OF_WEEK: case DOW: return (timestamp1, timestamp2) -> @@ -222,40 +222,40 @@ protected BiFunction constructTruncatedEqualsFunction( convertToZonedDateTime(timestamp2, zoneId) .with(DayOfWeek.MONDAY) .truncatedTo(ChronoUnit.DAYS)); - // base DAY + // base DAY case HOUR: return (timestamp1, timestamp2) -> convertToZonedDateTime(timestamp1, zoneId) .truncatedTo(ChronoUnit.DAYS) .equals(convertToZonedDateTime(timestamp2, zoneId).truncatedTo(ChronoUnit.DAYS)); - // base HOUR + // base HOUR case MINUTE: return (timestamp1, timestamp2) -> convertToZonedDateTime(timestamp1, zoneId) .truncatedTo(ChronoUnit.HOURS) .equals(convertToZonedDateTime(timestamp2, zoneId).truncatedTo(ChronoUnit.HOURS)); - // base MINUTE + // base MINUTE case SECOND: return (timestamp1, timestamp2) -> convertToZonedDateTime(timestamp1, zoneId) .truncatedTo(ChronoUnit.MINUTES) .equals( convertToZonedDateTime(timestamp2, zoneId).truncatedTo(ChronoUnit.MINUTES)); - // base SECOND + // base SECOND case MS: return (timestamp1, timestamp2) -> convertToZonedDateTime(timestamp1, zoneId) .truncatedTo(ChronoUnit.SECONDS) .equals( convertToZonedDateTime(timestamp2, zoneId).truncatedTo(ChronoUnit.SECONDS)); - // base MS + // base MS case US: return (timestamp1, timestamp2) -> convertToZonedDateTime(timestamp1, zoneId) .truncatedTo(ChronoUnit.MILLIS) .equals( convertToZonedDateTime(timestamp2, zoneId).truncatedTo(ChronoUnit.MILLIS)); - // base US + // base US case NS: return (timestamp1, timestamp2) -> convertToZonedDateTime(timestamp1, zoneId) diff --git a/java/tsfile/src/main/java/org/apache/tsfile/utils/Murmur128Hash.java b/java/tsfile/src/main/java/org/apache/tsfile/utils/Murmur128Hash.java index dfb4b4305..284d5e8be 100644 --- a/java/tsfile/src/main/java/org/apache/tsfile/utils/Murmur128Hash.java +++ b/java/tsfile/src/main/java/org/apache/tsfile/utils/Murmur128Hash.java @@ -114,50 +114,50 @@ private static long innerHash(byte[] key, int offset, int length, long seed) { switch (length & 15) { case 15: k2 ^= ((long) key[offset + 14]) << 48; - // fallthrough + // fallthrough case 14: k2 ^= ((long) key[offset + 13]) << 40; - // fallthrough + // fallthrough case 13: k2 ^= ((long) key[offset + 12]) << 32; - // fallthrough + // fallthrough case 12: k2 ^= ((long) key[offset + 11]) << 24; - // fallthrough + // fallthrough case 11: k2 ^= ((long) key[offset + 10]) << 16; - // fallthrough + // fallthrough case 10: k2 ^= ((long) key[offset + 9]) << 8; - // fallthrough + // fallthrough case 9: k2 ^= key[offset + 8]; k2 *= c2; k2 = rotl64(k2, 33); k2 *= c1; h2 ^= k2; - // fallthrough + // fallthrough case 8: k1 ^= ((long) key[offset + 7]) << 56; - // fallthrough + // fallthrough case 7: k1 ^= ((long) key[offset + 6]) << 48; - // fallthrough + // fallthrough case 6: k1 ^= ((long) key[offset + 5]) << 40; - // fallthrough + // fallthrough case 5: k1 ^= ((long) key[offset + 4]) << 32; - // fallthrough + // fallthrough case 4: k1 ^= ((long) key[offset + 3]) << 24; - // fallthrough + // fallthrough case 3: k1 ^= ((long) key[offset + 2]) << 16; - // fallthrough + // fallthrough case 2: k1 ^= ((long) key[offset + 1]) << 8; - // fallthrough + // fallthrough case 1: k1 ^= (key[offset]); k1 *= c1; diff --git a/pom.xml b/pom.xml index 51fbe3145..0111cea02 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,7 @@ false 3.30.2-b1 2.44.3 - 1.22.0 + 1.28.0 17.0.6 1.21.1 4.0.22 @@ -620,11 +620,11 @@ ]]> - + - .java-11-below + .java-17-below - (,11] + (,17)