HDFS-16625. Check assumption about PMDK availability (#4788)

Co-authored-by: Steve Vaughan Jr <s_vaughan@apple.com>
This commit is contained in:
Steve Vaughan 2022-08-23 06:35:59 -04:00 committed by GitHub
parent a73efb2d55
commit 4138661010
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -66,6 +66,7 @@ import java.util.function.Supplier;
import org.apache.hadoop.thirdparty.com.google.common.primitives.Ints; import org.apache.hadoop.thirdparty.com.google.common.primitives.Ints;
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_FSDATASETCACHE_MAX_THREADS_PER_VOLUME_KEY; import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_FSDATASETCACHE_MAX_THREADS_PER_VOLUME_KEY;
import static org.junit.Assume.assumeTrue;
/** /**
* Tests HDFS persistent memory cache by PmemMappableBlockLoader. * Tests HDFS persistent memory cache by PmemMappableBlockLoader.
@ -104,6 +105,8 @@ public class TestCacheByPmemMappableBlockLoader {
@BeforeClass @BeforeClass
public static void setUpClass() throws Exception { public static void setUpClass() throws Exception {
assumeTrue("Requires PMDK", NativeIO.POSIX.isPmdkAvailable());
oldInjector = DataNodeFaultInjector.get(); oldInjector = DataNodeFaultInjector.get();
DataNodeFaultInjector.set(new DataNodeFaultInjector() { DataNodeFaultInjector.set(new DataNodeFaultInjector() {
@Override @Override

View File

@ -27,6 +27,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;
import static org.junit.Assume.assumeTrue;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@ -103,6 +104,8 @@ public class TestPmemCacheRecovery {
@BeforeClass @BeforeClass
public static void setUpClass() throws Exception { public static void setUpClass() throws Exception {
assumeTrue("Requires PMDK", NativeIO.POSIX.isPmdkAvailable());
oldInjector = DataNodeFaultInjector.get(); oldInjector = DataNodeFaultInjector.get();
DataNodeFaultInjector.set(new DataNodeFaultInjector() { DataNodeFaultInjector.set(new DataNodeFaultInjector() {
@Override @Override