Skip to content

Commit 943a726

Browse files
authored
Support JDK-25 (#649)
1 parent 5211bd4 commit 943a726

10 files changed

Lines changed: 54 additions & 54 deletions

File tree

.github/workflows/unit-test-java.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
fail-fast: false
4545
max-parallel: 15
4646
matrix:
47-
java: [ 8, 17, 21 ]
47+
java: [ 8, 17, 25 ]
4848
os: [ ubuntu-latest, macos-latest, windows-latest ]
4949
runs-on: ${{ matrix.os }}
5050

cpp/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@
233233
<plugin>
234234
<groupId>com.diffplug.spotless</groupId>
235235
<artifactId>spotless-maven-plugin</artifactId>
236-
<version>${spotless.version}</version>
236+
<version>2.44.3</version>
237237
<configuration>
238238
<cpp>
239239
<includes>

java/common/src/main/java/org/apache/tsfile/enums/TSDataType.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ public int getDataTypeSize() {
507507
case FLOAT:
508508
case DATE:
509509
return 4;
510-
// For text: return the size of reference here
510+
// For text: return the size of reference here
511511
case TEXT:
512512
case INT64:
513513
case DOUBLE:
@@ -544,7 +544,7 @@ public boolean isNumeric() {
544544
case FLOAT:
545545
case DOUBLE:
546546
return true;
547-
// For text: return the size of reference here
547+
// For text: return the size of reference here
548548
case BLOB:
549549
case TIMESTAMP:
550550
case DATE:

java/tsfile/src/main/java/org/apache/tsfile/encoding/decoder/IntChimpDecoder.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,18 +102,18 @@ protected int readNext(ByteBuffer in) {
102102
current = (current + 1) % PREVIOUS_VALUES;
103103
storedValues[current] = storedValue;
104104
return storedValue;
105-
// case 10: use the previous leading zeros and
106-
// and just read the meaningful XORed value.
105+
// case 10: use the previous leading zeros and
106+
// and just read the meaningful XORed value.
107107
case 2:
108108
value = (int) readLong(VALUE_BITS_LENGTH_32BIT - storedLeadingZeros, in);
109109
storedValue = storedValue ^ value;
110110
current = (current + 1) % PREVIOUS_VALUES;
111111
storedValues[current] = storedValue;
112112
return storedValue;
113-
// case 01: read the index of the previous value, the length of
114-
// the number of leading zeros in the next 3 bits, then read
115-
// the length of the meaningful XORed value in the next 5
116-
// bits. Finally read the meaningful bits of the XORed value.
113+
// case 01: read the index of the previous value, the length of
114+
// the number of leading zeros in the next 3 bits, then read
115+
// the length of the meaningful XORed value in the next 5
116+
// bits. Finally read the meaningful bits of the XORed value.
117117
case 1:
118118
int fill = CASE_ONE_METADATA_LENGTH;
119119
int temp = (int) readLong(fill, in);
@@ -132,8 +132,8 @@ protected int readNext(ByteBuffer in) {
132132
current = (current + 1) % PREVIOUS_VALUES;
133133
storedValues[current] = storedValue;
134134
return storedValue;
135-
// case 00: the values are identical, just read
136-
// the index of the previous value
135+
// case 00: the values are identical, just read
136+
// the index of the previous value
137137
default:
138138
int previousIndex = (int) readLong(PREVIOUS_VALUES_LOG2, in);
139139
storedValue = storedValues[previousIndex];

java/tsfile/src/main/java/org/apache/tsfile/encoding/decoder/IntGorillaDecoder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ protected int readNext(ByteBuffer in) {
7676
byte significantBits = (byte) readLong(MEANINGFUL_XOR_BITS_LENGTH_32BIT, in);
7777
significantBits++;
7878
storedTrailingZeros = VALUE_BITS_LENGTH_32BIT - significantBits - storedLeadingZeros;
79-
// missing break is intentional, we want to overflow to next one
79+
// missing break is intentional, we want to overflow to next one
8080
case 2: // case '10': use stored leading and trailing zeros
8181
int xor =
8282
(int) readLong(VALUE_BITS_LENGTH_32BIT - storedLeadingZeros - storedTrailingZeros, in);
8383
xor <<= storedTrailingZeros;
8484
storedValue ^= xor;
85-
// missing break is intentional, we want to overflow to next one
85+
// missing break is intentional, we want to overflow to next one
8686
default: // case '0': use stored value
8787
return storedValue;
8888
}

java/tsfile/src/main/java/org/apache/tsfile/encoding/decoder/LongChimpDecoder.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,28 +92,28 @@ protected long readNext(ByteBuffer in) {
9292
byte controlBits = readNextNBits(2, in);
9393
long value;
9494
switch (controlBits) {
95-
// case 11: read the length of the number of leading
96-
// zeros in the next 3 bits, then read the
97-
// meaningful bits of the XORed value.
95+
// case 11: read the length of the number of leading
96+
// zeros in the next 3 bits, then read the
97+
// meaningful bits of the XORed value.
9898
case 3:
9999
storedLeadingZeros = LEADING_REPRESENTATION[(int) readLong(3, in)];
100100
value = readLong(VALUE_BITS_LENGTH_64BIT - storedLeadingZeros, in);
101101
storedValue = storedValue ^ value;
102102
current = (current + 1) % PREVIOUS_VALUES;
103103
storedValues[current] = storedValue;
104104
return storedValue;
105-
// case 10: use the previous leading zeros and
106-
// and just read the meaningful XORed value.
105+
// case 10: use the previous leading zeros and
106+
// and just read the meaningful XORed value.
107107
case 2:
108108
value = readLong(VALUE_BITS_LENGTH_64BIT - storedLeadingZeros, in);
109109
storedValue = storedValue ^ value;
110110
current = (current + 1) % PREVIOUS_VALUES;
111111
storedValues[current] = storedValue;
112112
return storedValue;
113-
// case 01: read the index of the previous value, the length of
114-
// the number of leading zeros in the next 3 bits, then read
115-
// the length of the meaningful XORed value in the next 6
116-
// bits. Finally read the meaningful bits of the XORed value.
113+
// case 01: read the index of the previous value, the length of
114+
// the number of leading zeros in the next 3 bits, then read
115+
// the length of the meaningful XORed value in the next 6
116+
// bits. Finally read the meaningful bits of the XORed value.
117117
case 1:
118118
int fill = CASE_ONE_METADATA_LENGTH;
119119
int temp = (int) readLong(fill, in);
@@ -131,8 +131,8 @@ protected long readNext(ByteBuffer in) {
131131
current = (current + 1) % PREVIOUS_VALUES;
132132
storedValues[current] = storedValue;
133133
return storedValue;
134-
// case 00: the values are identical, just read
135-
// the index of the previous value
134+
// case 00: the values are identical, just read
135+
// the index of the previous value
136136
default:
137137
int previousIndex = (int) readLong(PREVIOUS_VALUES_LOG2, in);
138138
storedValue = storedValues[previousIndex];

java/tsfile/src/main/java/org/apache/tsfile/encoding/decoder/LongGorillaDecoder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ protected long readNext(ByteBuffer in) {
7676
byte significantBits = (byte) readLong(MEANINGFUL_XOR_BITS_LENGTH_64BIT, in);
7777
significantBits++;
7878
storedTrailingZeros = VALUE_BITS_LENGTH_64BIT - significantBits - storedLeadingZeros;
79-
// missing break is intentional, we want to overflow to next one
79+
// missing break is intentional, we want to overflow to next one
8080
case 2: // case '10': use stored leading and trailing zeros
8181
long xor = readLong(VALUE_BITS_LENGTH_64BIT - storedLeadingZeros - storedTrailingZeros, in);
8282
xor <<= storedTrailingZeros;
8383
storedValue ^= xor;
84-
// missing break is intentional, we want to overflow to next one
84+
// missing break is intentional, we want to overflow to next one
8585
default: // case '0': use stored value
8686
return storedValue;
8787
}

java/tsfile/src/main/java/org/apache/tsfile/read/filter/operator/ExtractTimeFilterOperators.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ protected BiFunction<Long, Long, Boolean> constructTruncatedEqualsFunction(
184184
switch (field) {
185185
case YEAR:
186186
return (timestamp1, timestamp2) -> true;
187-
// base YEAR
187+
// base YEAR
188188
case QUARTER:
189189
case MONTH:
190190
case WEEK:
@@ -200,7 +200,7 @@ protected BiFunction<Long, Long, Boolean> constructTruncatedEqualsFunction(
200200
.withMonth(1)
201201
.withDayOfMonth(1)
202202
.truncatedTo(ChronoUnit.DAYS));
203-
// base MONTH
203+
// base MONTH
204204
case DAY:
205205
case DAY_OF_MONTH:
206206
return (timestamp1, timestamp2) ->
@@ -211,7 +211,7 @@ protected BiFunction<Long, Long, Boolean> constructTruncatedEqualsFunction(
211211
convertToZonedDateTime(timestamp2, zoneId)
212212
.withDayOfMonth(1)
213213
.truncatedTo(ChronoUnit.DAYS));
214-
// base WEEK
214+
// base WEEK
215215
case DAY_OF_WEEK:
216216
case DOW:
217217
return (timestamp1, timestamp2) ->
@@ -222,40 +222,40 @@ protected BiFunction<Long, Long, Boolean> constructTruncatedEqualsFunction(
222222
convertToZonedDateTime(timestamp2, zoneId)
223223
.with(DayOfWeek.MONDAY)
224224
.truncatedTo(ChronoUnit.DAYS));
225-
// base DAY
225+
// base DAY
226226
case HOUR:
227227
return (timestamp1, timestamp2) ->
228228
convertToZonedDateTime(timestamp1, zoneId)
229229
.truncatedTo(ChronoUnit.DAYS)
230230
.equals(convertToZonedDateTime(timestamp2, zoneId).truncatedTo(ChronoUnit.DAYS));
231-
// base HOUR
231+
// base HOUR
232232
case MINUTE:
233233
return (timestamp1, timestamp2) ->
234234
convertToZonedDateTime(timestamp1, zoneId)
235235
.truncatedTo(ChronoUnit.HOURS)
236236
.equals(convertToZonedDateTime(timestamp2, zoneId).truncatedTo(ChronoUnit.HOURS));
237-
// base MINUTE
237+
// base MINUTE
238238
case SECOND:
239239
return (timestamp1, timestamp2) ->
240240
convertToZonedDateTime(timestamp1, zoneId)
241241
.truncatedTo(ChronoUnit.MINUTES)
242242
.equals(
243243
convertToZonedDateTime(timestamp2, zoneId).truncatedTo(ChronoUnit.MINUTES));
244-
// base SECOND
244+
// base SECOND
245245
case MS:
246246
return (timestamp1, timestamp2) ->
247247
convertToZonedDateTime(timestamp1, zoneId)
248248
.truncatedTo(ChronoUnit.SECONDS)
249249
.equals(
250250
convertToZonedDateTime(timestamp2, zoneId).truncatedTo(ChronoUnit.SECONDS));
251-
// base MS
251+
// base MS
252252
case US:
253253
return (timestamp1, timestamp2) ->
254254
convertToZonedDateTime(timestamp1, zoneId)
255255
.truncatedTo(ChronoUnit.MILLIS)
256256
.equals(
257257
convertToZonedDateTime(timestamp2, zoneId).truncatedTo(ChronoUnit.MILLIS));
258-
// base US
258+
// base US
259259
case NS:
260260
return (timestamp1, timestamp2) ->
261261
convertToZonedDateTime(timestamp1, zoneId)

java/tsfile/src/main/java/org/apache/tsfile/utils/Murmur128Hash.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -114,50 +114,50 @@ private static long innerHash(byte[] key, int offset, int length, long seed) {
114114
switch (length & 15) {
115115
case 15:
116116
k2 ^= ((long) key[offset + 14]) << 48;
117-
// fallthrough
117+
// fallthrough
118118
case 14:
119119
k2 ^= ((long) key[offset + 13]) << 40;
120-
// fallthrough
120+
// fallthrough
121121
case 13:
122122
k2 ^= ((long) key[offset + 12]) << 32;
123-
// fallthrough
123+
// fallthrough
124124
case 12:
125125
k2 ^= ((long) key[offset + 11]) << 24;
126-
// fallthrough
126+
// fallthrough
127127
case 11:
128128
k2 ^= ((long) key[offset + 10]) << 16;
129-
// fallthrough
129+
// fallthrough
130130
case 10:
131131
k2 ^= ((long) key[offset + 9]) << 8;
132-
// fallthrough
132+
// fallthrough
133133
case 9:
134134
k2 ^= key[offset + 8];
135135
k2 *= c2;
136136
k2 = rotl64(k2, 33);
137137
k2 *= c1;
138138
h2 ^= k2;
139-
// fallthrough
139+
// fallthrough
140140
case 8:
141141
k1 ^= ((long) key[offset + 7]) << 56;
142-
// fallthrough
142+
// fallthrough
143143
case 7:
144144
k1 ^= ((long) key[offset + 6]) << 48;
145-
// fallthrough
145+
// fallthrough
146146
case 6:
147147
k1 ^= ((long) key[offset + 5]) << 40;
148-
// fallthrough
148+
// fallthrough
149149
case 5:
150150
k1 ^= ((long) key[offset + 4]) << 32;
151-
// fallthrough
151+
// fallthrough
152152
case 4:
153153
k1 ^= ((long) key[offset + 3]) << 24;
154-
// fallthrough
154+
// fallthrough
155155
case 3:
156156
k1 ^= ((long) key[offset + 2]) << 16;
157-
// fallthrough
157+
// fallthrough
158158
case 2:
159159
k1 ^= ((long) key[offset + 1]) << 8;
160-
// fallthrough
160+
// fallthrough
161161
case 1:
162162
k1 ^= (key[offset]);
163163
k1 *= c1;

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<spotless.skip>false</spotless.skip>
3939
<cmake.version>3.30.2-b1</cmake.version>
4040
<spotless.version>2.44.3</spotless.version>
41-
<google.java.format.version>1.22.0</google.java.format.version>
41+
<google.java.format.version>1.28.0</google.java.format.version>
4242
<clang.format.version>17.0.6</clang.format.version>
4343
<drill.freemarker.maven.plugin.version>1.21.1</drill.freemarker.maven.plugin.version>
4444
<groovy.version>4.0.22</groovy.version>
@@ -620,11 +620,11 @@
620620
]]></argLine>
621621
</properties>
622622
</profile>
623-
<!-- Current version of spotless cannot support JDK11 below -->
623+
<!-- Current version of spotless cannot support JDK17 below -->
624624
<profile>
625-
<id>.java-11-below</id>
625+
<id>.java-17-below</id>
626626
<activation>
627-
<jdk>(,11]</jdk>
627+
<jdk>(,17)</jdk>
628628
</activation>
629629
<properties>
630630
<!-- This was the last version to support Java 8, Just for run -->

0 commit comments

Comments
 (0)