This is an automated email from the ASF dual-hosted git repository.
wyk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git
The following commit(s) were added to refs/heads/master by this push:
new 2e724f90ca [NO ISSUE] Use DebugHolePuncher for non-linux machines
2e724f90ca is described below
commit 2e724f90caafdba4e9d1b32449f799fe6210df7c
Author: Wail Alkowaileet <[email protected]>
AuthorDate: Wed May 22 20:41:49 2024 -0700
[NO ISSUE] Use DebugHolePuncher for non-linux machines
- user model changes: no
- storage format changes: no
- interface changes: no
Details:
Use DebugHolePuncher instead of throwing an exception
on non-linux boxes.
Change-Id: Id19aabffdd52d6578cd48e0e8578bec3fe729a8a
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18312
Reviewed-by: Michael Blow <[email protected]>
Integration-Tests: Jenkins <[email protected]>
Tested-by: Wail Alkowaileet <[email protected]>
---
.../asterix/cloud/lazy/filesystem/HolePuncherProvider.java | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git
a/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/lazy/filesystem/HolePuncherProvider.java
b/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/lazy/filesystem/HolePuncherProvider.java
index 406f2f30b5..a2cdda8763 100644
---
a/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/lazy/filesystem/HolePuncherProvider.java
+++
b/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/lazy/filesystem/HolePuncherProvider.java
@@ -18,6 +18,9 @@
*/
package org.apache.asterix.cloud.lazy.filesystem;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
import java.io.IOException;
import java.nio.ByteBuffer;
@@ -31,6 +34,7 @@ import org.apache.hyracks.api.io.IFileHandle;
import org.apache.hyracks.cloud.filesystem.FileSystemOperationDispatcherUtil;
public final class HolePuncherProvider {
+ private static final Logger LOGGER = LogManager.getLogger();
private static final IHolePuncher UNSUPPORTED =
HolePuncherProvider::unsupported;
private static final IHolePuncher LINUX =
HolePuncherProvider::linuxPunchHole;
@@ -45,13 +49,12 @@ public final class HolePuncherProvider {
if (FileSystemOperationDispatcherUtil.isLinux()) {
return LINUX;
- } else if (cloudProperties.isStorageDebugModeEnabled()) {
- // Running on debug mode on a non-Linux box
- return new DebugHolePuncher(cloudIOManager, bufferProvider);
}
- throw new UnsupportedOperationException(
- "Hole puncher is not supported using " +
FileSystemOperationDispatcherUtil.getOSName());
+ // Running a debug hole puncher on a non-Linux box
+ String osName = FileSystemOperationDispatcherUtil.getOSName();
+ LOGGER.warn("Using 'DebugHolePuncher' as the OS '{}' does not support
punishing holes", osName);
+ return new DebugHolePuncher(cloudIOManager, bufferProvider);
}
private static int unsupported(IFileHandle fileHandle, long offset, long
length) {