-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Core][jdk17] Support jdk17 #7086
base: dev
Are you sure you want to change the base?
Conversation
public static DateTimeFormatter TIME_FORMAT = | ||
new DateTimeFormatterBuilder() | ||
.appendPattern("HH:mm:ss") | ||
.appendFraction(ChronoField.NANO_OF_SECOND, 0, 9, true) | ||
.toFormatter(); | ||
|
||
public Map<String, DateTimeFormatter> fieldFormatterMap = new HashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Format date format instead using toString. Strings generated in different jdk versions are inconsistent
LzopCodec lzo = new LzopCodec(); | ||
Path path = Paths.get(file.getAbsolutePath() + ".lzo"); | ||
OutputStream outputStream = lzo.createOutputStream(Files.newOutputStream(path)); | ||
outputStream.write(Files.readAllBytes(file.toPath())); | ||
outputStream.close(); | ||
// Define the output path | ||
Path path = Paths.get(file.getAbsolutePath() + ".lzma"); | ||
|
||
// Use try-with-resources to ensure streams are closed properly | ||
try (FileInputStream fis = new FileInputStream(file); | ||
FileOutputStream fos = new FileOutputStream(path.toFile()); | ||
LZMACompressorOutputStream lzmaOut = new LZMACompressorOutputStream(fos)) { | ||
|
||
byte[] buffer = new byte[1024]; | ||
int len; | ||
while ((len = fis.read(buffer)) != -1) { | ||
lzmaOut.write(buffer, 0, len); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolve Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.RuntimeException: java.lang.reflect.InaccessibleObjectException: Unable to make field long java.nio.Buffer.address accessible: module java.base does not "opens java.nio" to unnamed module @3025782f [in thread "main"]
. Skip jdk17 test environment
final String datetime = "2023-12-22 00:00:00"; | ||
LocalDateTime parse = DateTimeUtils.parse(datetime, Formatter.YYYY_MM_DD_HH_MM_SS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jdk17 optimizes timestamps and temporarily uses a fixed format
Purpose of this pull request
Refer to https://issues.apache.org/jira/browse/FLINK-15736
LocalFileIT
test on jdk 17Does this PR introduce any user-facing change?
How was this patch tested?
Check list
New License Guide
release-note
.