-
Notifications
You must be signed in to change notification settings - Fork 534
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1777 from ClickHouse/fix_turn_off_java9
Remove Java9 Targets
- Loading branch information
Showing
6 changed files
with
150 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* Declares com.clickhouse.client module. | ||
*/ | ||
module com.clickhouse.client { | ||
exports com.clickhouse.client; | ||
exports com.clickhouse.client.config; | ||
|
||
requires static org.dnsjava; | ||
|
||
requires transitive com.clickhouse.data; | ||
|
||
uses com.clickhouse.client.ClickHouseClient; | ||
uses com.clickhouse.client.ClickHouseDnsResolver; | ||
uses com.clickhouse.client.ClickHouseSslContextProvider; | ||
} |
76 changes: 76 additions & 0 deletions
76
clickhouse-data/src/main/java11/com/clickhouse/data/ByteUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
package com.clickhouse.data; | ||
|
||
import java.lang.invoke.MethodHandles; | ||
import java.lang.invoke.VarHandle; | ||
import java.nio.ByteOrder; | ||
import java.util.Arrays; | ||
|
||
public final class ByteUtils { | ||
public boolean equals(byte[] a, int aFromIndex, int aToIndex, byte[] b, int bFromIndex, int bToIndex) { | ||
return Arrays.equals(a, aFromIndex, aToIndex, b, bFromIndex, bToIndex); | ||
} | ||
|
||
public byte getInt8(byte[] bytes, int offset) { | ||
return (byte) byteHandle.get(bytes, offset); | ||
} | ||
|
||
public void setInt8(byte[] bytes, int offset, byte value) { | ||
byteHandle.set(bytes, offset, value); | ||
} | ||
|
||
public short getInt16(byte[] bytes, int offset) { | ||
return (short) shortHandle.get(bytes, offset); | ||
} | ||
|
||
public void setInt16(byte[] bytes, int offset, short value) { | ||
shortHandle.set(bytes, offset, value); | ||
} | ||
|
||
public int getInt32(byte[] bytes, int offset) { | ||
return (int) intHandle.get(bytes, offset); | ||
} | ||
|
||
public void setInt32(byte[] bytes, int offset, int value) { | ||
intHandle.set(bytes, offset, value); | ||
} | ||
|
||
public long getInt64(byte[] bytes, int offset) { | ||
return (long) longHandle.get(bytes, offset); | ||
} | ||
|
||
public void setInt64(byte[] bytes, int offset, long value) { | ||
longHandle.set(bytes, offset, value); | ||
} | ||
|
||
public float getFloat32(byte[] bytes, int offset) { | ||
return (float) floatHandle.get(bytes, offset); | ||
} | ||
|
||
public void setFloat32(byte[] bytes, int offset, float value) { | ||
floatHandle.set(bytes, offset, value); | ||
} | ||
|
||
public double getFloat64(byte[] bytes, int offset) { | ||
return (double) doubleHandle.get(bytes, offset); | ||
} | ||
|
||
public void setFloat64(byte[] bytes, int offset, double value) { | ||
doubleHandle.set(bytes, offset, value); | ||
} | ||
|
||
private final VarHandle byteHandle; | ||
private final VarHandle shortHandle; | ||
private final VarHandle intHandle; | ||
private final VarHandle longHandle; | ||
private final VarHandle floatHandle; | ||
private final VarHandle doubleHandle; | ||
|
||
ByteUtils(ByteOrder byteOrder) { | ||
byteHandle = MethodHandles.arrayElementVarHandle(byte[].class); | ||
shortHandle = MethodHandles.byteArrayViewVarHandle(short[].class, byteOrder); | ||
intHandle = MethodHandles.byteArrayViewVarHandle(int[].class, byteOrder); | ||
longHandle = MethodHandles.byteArrayViewVarHandle(long[].class, byteOrder); | ||
floatHandle = MethodHandles.byteArrayViewVarHandle(float[].class, byteOrder); | ||
doubleHandle = MethodHandles.byteArrayViewVarHandle(double[].class, byteOrder); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* Declares com.clickhouse.data module. | ||
*/ | ||
module com.clickhouse.data { | ||
exports com.clickhouse.config; | ||
exports com.clickhouse.data; | ||
// exports com.clickhouse.data.cache; | ||
// exports com.clickhouse.data.format; | ||
// exports com.clickhouse.data.mapper; | ||
// exports com.clickhouse.data.stream; | ||
exports com.clickhouse.data.value; | ||
exports com.clickhouse.logging; | ||
|
||
requires static java.logging; | ||
requires static com.google.gson; | ||
requires static com.github.benmanes.caffeine; | ||
requires static org.lz4.java; | ||
requires static org.slf4j; | ||
requires static org.roaringbitmap; | ||
|
||
uses com.clickhouse.data.ClickHouseDataStreamFactory; | ||
uses com.clickhouse.logging.LoggerFactory; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* Declares com.clickhouse module. | ||
*/ | ||
module com.clickhouse.jdbc { | ||
exports com.clickhouse.jdbc; | ||
|
||
requires java.sql; | ||
|
||
requires transitive com.clickhouse.client; | ||
// requires transitive com.google.gson; | ||
// requires transitive org.lz4.java; | ||
|
||
uses com.clickhouse.client.ClickHouseClient; | ||
uses com.clickhouse.client.ClickHouseDnsResolver; | ||
uses com.clickhouse.client.ClickHouseSslContextProvider; | ||
uses com.clickhouse.data.ClickHouseDataStreamFactory; | ||
uses com.clickhouse.logging.LoggerFactory; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* Declares com.clickhouse.r2dbc module. | ||
*/ | ||
module com.clickhouse.r2dbc { | ||
exports com.clickhouse.r2dbc; | ||
|
||
requires transitive com.clickhouse.client; | ||
requires transitive r2dbc.spi; | ||
requires transitive reactor.core; | ||
requires transitive org.lz4.java; | ||
|
||
uses com.clickhouse.client.ClickHouseClient; | ||
uses com.clickhouse.client.ClickHouseDnsResolver; | ||
uses com.clickhouse.client.ClickHouseSslContextProvider; | ||
uses com.clickhouse.data.ClickHouseDataStreamFactory; | ||
uses com.clickhouse.logging.LoggerFactory; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters