Package org.apache.hadoop.hdfs.client

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


      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));
      fsIn.seek(0);
      results[1] = fsIn.read(null, 4096,
View Full Code Here


      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();

      // The mmaps should be of the first block of the file.
      final ExtendedBlock firstBlock = DFSTestUtil.getFirstBlock(fs, TEST_PATH);
View Full Code Here

      // 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);

      // After we close the cursors, the mmaps should be evictable for
      // a brief period of time.  Then, they should be closed (we're
      // using a very quick timeout)
View Full Code Here

      }
      GenericTestUtils.waitFor(new Supplier<Boolean>() {
        public Boolean get() {
          countingVisitor.reset();
          try {
            mmapManager.visitEvictable(countingVisitor);
          } catch (InterruptedException e) {
            e.printStackTrace();
            return false;
          }
          return (0 == countingVisitor.count);
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.