NSAmelchev commented on code in PR #10430:
URL: https://github.com/apache/ignite/pull/10430#discussion_r1054284410
##########
modules/compress/src/main/java/org/apache/ignite/internal/processors/compress/CompressionProcessorImpl.java:
##########
@@ -170,6 +177,28 @@ private ByteBuffer doCompactPage(ByteBuffer page, int
pageSize) throws IgniteChe
return compactPage;
}
+ /** Check if filesystem actually supports punching holes. */
+ private void checkPunchHole(Path storagePath, int fsBlockSz) throws
IgniteException {
+ Path testFile = storagePath.resolve("punch_hole_" + UUID.randomUUID()
+ ".test");
+
+ ByteBuffer buffer = GridUnsafe.allocateBuffer(fsBlockSz * 2);
+ GridUnsafe.zeroMemory(GridUnsafe.bufferAddress(buffer),
buffer.capacity());
+
+ try {
+ try (RandomAccessFileIO testFileIO = new
RandomAccessFileIO(testFile.toFile(), CREATE, WRITE)) {
+ testFileIO.writeFully(buffer);
+
+ testFileIO.punchHole(fsBlockSz, fsBlockSz);
+ }
+ finally {
+ Files.deleteIfExists(testFile);
+ }
+ }
+ catch (Exception e) {
Review Comment:
I think `LinkageError` should be caught too.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]