org.apache.blur.store.blockcache
Class BlockCache

java.lang.Object
  extended by org.apache.blur.store.blockcache.BlockCache
All Implemented Interfaces:
Closeable

public class BlockCache
extends Object
implements Closeable


Field Summary
static int _128M
           
static int _8K
           
static boolean UNMAP_SUPPORTED
          true, if this platform supports unmapping mmapped files.
 
Constructor Summary
BlockCache(boolean directAllocation, long totalMemory)
           
BlockCache(boolean directAllocation, long totalMemory, int slabSize)
           
 
Method Summary
 void close()
           
 boolean fetch(BlockCacheKey blockCacheKey, byte[] buffer)
           
 boolean fetch(BlockCacheKey blockCacheKey, byte[] buffer, int blockOffset, int off, int length)
           
 int getSize()
           
 boolean store(BlockCacheKey blockCacheKey, int blockOffset, byte[] data, int offset, int length)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNMAP_SUPPORTED

public static final boolean UNMAP_SUPPORTED
true, if this platform supports unmapping mmapped files.


_128M

public static final int _128M
See Also:
Constant Field Values

_8K

public static final int _8K
See Also:
Constant Field Values
Constructor Detail

BlockCache

public BlockCache(boolean directAllocation,
                  long totalMemory)

BlockCache

public BlockCache(boolean directAllocation,
                  long totalMemory,
                  int slabSize)
Method Detail

store

public boolean store(BlockCacheKey blockCacheKey,
                     int blockOffset,
                     byte[] data,
                     int offset,
                     int length)

fetch

public boolean fetch(BlockCacheKey blockCacheKey,
                     byte[] buffer,
                     int blockOffset,
                     int off,
                     int length)

fetch

public boolean fetch(BlockCacheKey blockCacheKey,
                     byte[] buffer)

getSize

public int getSize()

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Throws:
IOException


Copyright © 2012-2014 The Apache Software Foundation. All Rights Reserved.