Search in sources :

Example 1 with CacheManipulator

use of org.apache.hadoop.io.nativeio.NativeIO.POSIX.CacheManipulator in project hadoop by apache.

the class TestEnhancedByteBufferAccess method init.

@BeforeClass
public static void init() {
    sockDir = new TemporarySocketDirectory();
    DomainSocket.disableBindPathValidation();
    prevCacheManipulator = NativeIO.POSIX.getCacheManipulator();
    NativeIO.POSIX.setCacheManipulator(new CacheManipulator() {

        @Override
        public void mlock(String identifier, ByteBuffer mmap, long length) throws IOException {
            LOG.info("mlocking " + identifier);
        }
    });
}
Also used : CacheManipulator(org.apache.hadoop.io.nativeio.NativeIO.POSIX.CacheManipulator) IOException(java.io.IOException) ByteBuffer(java.nio.ByteBuffer) TemporarySocketDirectory(org.apache.hadoop.net.unix.TemporarySocketDirectory) BeforeClass(org.junit.BeforeClass)

Aggregations

IOException (java.io.IOException)1 ByteBuffer (java.nio.ByteBuffer)1 CacheManipulator (org.apache.hadoop.io.nativeio.NativeIO.POSIX.CacheManipulator)1 TemporarySocketDirectory (org.apache.hadoop.net.unix.TemporarySocketDirectory)1 BeforeClass (org.junit.BeforeClass)1