Examples of cacheBlock()


Examples of org.apache.accumulo.core.file.blockfile.cache.LruBlockCache.cacheBlock()

   
    // Oldest multi block should be evicted now
    assertEquals(null, cache.getBlock(multiBlocks[0].blockName));
   
    // Insert another memory block
    cache.cacheBlock(memoryBlocks[3].blockName, memoryBlocks[3].buf, true);
   
    // Three evictions, three evicted.
    assertEquals(3, cache.getEvictionCount());
    assertEquals(3, cache.getEvictedCount());
   
View Full Code Here

Examples of org.apache.accumulo.core.file.blockfile.cache.LruBlockCache.cacheBlock()

    // Oldest memory block should be evicted now
    assertEquals(null, cache.getBlock(memoryBlocks[0].blockName));
   
    // Add a block that is twice as big (should force two evictions)
    Block[] bigBlocks = generateFixedBlocks(3, blockSize * 3, "big");
    cache.cacheBlock(bigBlocks[0].blockName, bigBlocks[0].buf);
   
    // Four evictions, six evicted (inserted block 3X size, expect +3 evicted)
    assertEquals(4, cache.getEvictionCount());
    assertEquals(6, cache.getEvictedCount());
   
View Full Code Here

Examples of org.apache.accumulo.core.file.blockfile.cache.LruBlockCache.cacheBlock()

   
    // Make the big block a multi block
    cache.getBlock(bigBlocks[0].blockName);
   
    // Cache another single big block
    cache.cacheBlock(bigBlocks[1].blockName, bigBlocks[1].buf);
   
    // Five evictions, nine evicted (3 new)
    assertEquals(5, cache.getEvictionCount());
    assertEquals(9, cache.getEvictedCount());
   
View Full Code Here

Examples of org.apache.accumulo.core.file.blockfile.cache.LruBlockCache.cacheBlock()

    assertEquals(null, cache.getBlock(singleBlocks[1].blockName));
    assertEquals(null, cache.getBlock(multiBlocks[1].blockName));
    assertEquals(null, cache.getBlock(multiBlocks[2].blockName));
   
    // Cache a big memory block
    cache.cacheBlock(bigBlocks[2].blockName, bigBlocks[2].buf, true);
   
    // Six evictions, twelve evicted (3 new)
    assertEquals(6, cache.getEvictionCount());
    assertEquals(12, cache.getEvictedCount());
   
View Full Code Here

Examples of org.apache.accumulo.core.file.blockfile.cache.LruBlockCache.cacheBlock()

    Block[] singleBlocks = generateFixedBlocks(20, blockSize, "single");
    Block[] multiBlocks = generateFixedBlocks(5, blockSize, "multi");
   
    // Add 5 multi blocks
    for (Block block : multiBlocks) {
      cache.cacheBlock(block.blockName, block.buf);
      cache.getBlock(block.blockName);
    }
   
    // Add 5 single blocks
    for (int i = 0; i < 5; i++) {
View Full Code Here

Examples of org.apache.accumulo.core.file.blockfile.cache.LruBlockCache.cacheBlock()

      cache.getBlock(block.blockName);
    }
   
    // Add 5 single blocks
    for (int i = 0; i < 5; i++) {
      cache.cacheBlock(singleBlocks[i].blockName, singleBlocks[i].buf);
    }
   
    // An eviction ran
    assertEquals(1, cache.getEvictionCount());
   
View Full Code Here

Examples of org.apache.accumulo.core.file.blockfile.cache.LruBlockCache.cacheBlock()

    // Every time we reach 10 total blocks (every 4 inserts) we get 4 single
    // blocks evicted. Inserting 13 blocks should yield 3 more evictions and
    // 12 more evicted.
   
    for (int i = 5; i < 18; i++) {
      cache.cacheBlock(singleBlocks[i].blockName, singleBlocks[i].buf);
    }
   
    // 4 total evictions, 16 total evicted
    assertEquals(4, cache.getEvictionCount());
    assertEquals(16, cache.getEvictedCount());
View Full Code Here

Examples of org.apache.accumulo.core.file.blockfile.cache.LruBlockCache.cacheBlock()

   
    // Add all blocks from all priorities
    for (int i = 0; i < 10; i++) {
     
      // Just add single blocks
      cache.cacheBlock(singleBlocks[i].blockName, singleBlocks[i].buf);
     
      // Add and get multi blocks
      cache.cacheBlock(multiBlocks[i].blockName, multiBlocks[i].buf);
      cache.getBlock(multiBlocks[i].blockName);
     
View Full Code Here

Examples of org.apache.accumulo.core.file.blockfile.cache.LruBlockCache.cacheBlock()

     
      // Just add single blocks
      cache.cacheBlock(singleBlocks[i].blockName, singleBlocks[i].buf);
     
      // Add and get multi blocks
      cache.cacheBlock(multiBlocks[i].blockName, multiBlocks[i].buf);
      cache.getBlock(multiBlocks[i].blockName);
     
      // Add memory blocks as such
      cache.cacheBlock(memoryBlocks[i].blockName, memoryBlocks[i].buf, true);
    }
View Full Code Here

Examples of org.apache.accumulo.core.file.blockfile.cache.LruBlockCache.cacheBlock()

      // Add and get multi blocks
      cache.cacheBlock(multiBlocks[i].blockName, multiBlocks[i].buf);
      cache.getBlock(multiBlocks[i].blockName);
     
      // Add memory blocks as such
      cache.cacheBlock(memoryBlocks[i].blockName, memoryBlocks[i].buf, true);
    }
   
    // Do not expect any evictions yet
    assertEquals(0, cache.getEvictionCount());
   
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.