Examples of visitMmaps()


Examples of org.apache.hadoop.hdfs.client.ClientMmapManager.visitMmaps()

      IOUtils.readFully(fsIn, original, 0, TEST_FILE_LENGTH);
      fsIn.close();
      fsIn = fs.open(TEST_PATH);
      final ClientMmapManager mmapManager = fs.getClient().getMmapManager();
      final CountingVisitor countingVisitor = new CountingVisitor();
      mmapManager.visitMmaps(countingVisitor);
      Assert.assertEquals(0, countingVisitor.count);
      mmapManager.visitEvictable(countingVisitor);
      Assert.assertEquals(0, countingVisitor.count);
      results[0] = fsIn.read(null, 4096,
          EnumSet.of(ReadOption.SKIP_CHECKSUMS));
View Full Code Here

Examples of org.apache.hadoop.hdfs.client.ClientMmapManager.visitMmaps()

      results[0] = fsIn.read(null, 4096,
          EnumSet.of(ReadOption.SKIP_CHECKSUMS));
      fsIn.seek(0);
      results[1] = fsIn.read(null, 4096,
          EnumSet.of(ReadOption.SKIP_CHECKSUMS));
      mmapManager.visitMmaps(countingVisitor);
      Assert.assertEquals(1, countingVisitor.count);
      countingVisitor.reset();
      mmapManager.visitEvictable(countingVisitor);
      Assert.assertEquals(0, countingVisitor.count);
      countingVisitor.reset();
View Full Code Here

Examples of org.apache.hadoop.hdfs.client.ClientMmapManager.visitMmaps()

      Assert.assertEquals(0, countingVisitor.count);
      countingVisitor.reset();

      // The mmaps should be of the first block of the file.
      final ExtendedBlock firstBlock = DFSTestUtil.getFirstBlock(fs, TEST_PATH);
      mmapManager.visitMmaps(new ClientMmapManager.ClientMmapVisitor() {
        @Override
        public void accept(ClientMmap mmap) {
          Assert.assertEquals(firstBlock, mmap.getBlock());
        }
      });
View Full Code Here

Examples of org.apache.hadoop.hdfs.client.ClientMmapManager.visitMmaps()

      } catch (UnsupportedOperationException e) {
        // expected
      }

      // we should have 3 mmaps, 0 evictable
      mmapManager.visitMmaps(countingVisitor);
      Assert.assertEquals(3, countingVisitor.count);
      countingVisitor.reset();
      mmapManager.visitEvictable(countingVisitor);
      Assert.assertEquals(0, countingVisitor.count);
View Full Code Here

Examples of org.apache.hadoop.hdfs.client.ClientMmapManager.visitMmaps()

          }
          return (0 == countingVisitor.count);
        }
      }, 10, 10000);
      countingVisitor.reset();
      mmapManager.visitMmaps(countingVisitor);
      Assert.assertEquals(0, countingVisitor.count);
    } finally {
      if (fsIn != null) fsIn.close();
      if (fs != null) fs.close();
      if (cluster != null) cluster.shutdown();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.