Examples of BucketEntry


Examples of org.apache.hadoop.hbase.io.hfile.bucket.BucketCache.BucketEntry

  throws CacheFullException, BucketAllocatorException, IOException, InterruptedException {
    this.bc.cacheBlock(this.plainKey, plainCacheable);
    RAMQueueEntry rqe = q.remove();
    RAMQueueEntry spiedRqe = Mockito.spy(rqe);
    final CacheFullException cfe = new CacheFullException(0, 0);
    BucketEntry mockedBucketEntry = Mockito.mock(BucketEntry.class);
    Mockito.doThrow(cfe).
      doReturn(mockedBucketEntry).
      when(spiedRqe).writeToCache((IOEngine)Mockito.any(), (BucketAllocator)Mockito.any(),
        (UniqueIndexMap<Integer>)Mockito.any(), (AtomicLong)Mockito.any());
    this.q.add(spiedRqe);
View Full Code Here

Examples of org.apache.hadoop.hbase.io.hfile.bucket.BucketCache.BucketEntry

  public void add(Map.Entry<BlockCacheKey, BucketEntry> entry) {
    if (cacheSize < maxSize) {
      queue.add(entry);
      cacheSize += entry.getValue().getLength();
    } else {
      BucketEntry head = queue.peek().getValue();
      if (entry.getValue().compareTo(head) > 0) {
        cacheSize += entry.getValue().getLength();
        cacheSize -= head.getLength();
        if (cacheSize > maxSize) {
          queue.poll();
        } else {
          cacheSize += head.getLength();
        }
        queue.add(entry);
      }
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.io.hfile.bucket.BucketCache.BucketEntry

  public void add(Map.Entry<BlockCacheKey, BucketEntry> entry) {
    if (cacheSize < maxSize) {
      queue.add(entry);
      cacheSize += entry.getValue().getLength();
    } else {
      BucketEntry head = queue.peek().getValue();
      if (entry.getValue().compareTo(head) > 0) {
        cacheSize += entry.getValue().getLength();
        cacheSize -= head.getLength();
        if (cacheSize > maxSize) {
          queue.poll();
        } else {
          cacheSize += head.getLength();
        }
        queue.add(entry);
      }
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.io.hfile.bucket.BucketCache.BucketEntry

      throws IOException, InterruptedException {
    this.bc.cacheBlock(this.plainKey, plainCacheable);
    RAMQueueEntry rqe = q.remove();
    RAMQueueEntry spiedRqe = Mockito.spy(rqe);
    final CacheFullException cfe = new CacheFullException(0, 0);
    BucketEntry mockedBucketEntry = Mockito.mock(BucketEntry.class);
    Mockito.doThrow(cfe).
      doReturn(mockedBucketEntry).
      when(spiedRqe).writeToCache((IOEngine)Mockito.any(), (BucketAllocator)Mockito.any(),
        (UniqueIndexMap<Integer>)Mockito.any(), (AtomicLong)Mockito.any());
    this.q.add(spiedRqe);
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.