org.terracotta.offheapstore.paging
Class OffHeapStorageArea

java.lang.Object
  extended by org.terracotta.offheapstore.paging.OffHeapStorageArea

public class OffHeapStorageArea
extends Object

Author:
cdennis

Nested Class Summary
static interface OffHeapStorageArea.Owner
           
 
Constructor Summary
OffHeapStorageArea(PointerSize width, OffHeapStorageArea.Owner owner, PageSource pageSource, int pageSize, boolean thief, boolean victim)
           
OffHeapStorageArea(PointerSize width, OffHeapStorageArea.Owner owner, PageSource pageSource, int pageSize, boolean thief, boolean victim, float compressThreshold)
           
OffHeapStorageArea(PointerSize width, OffHeapStorageArea.Owner owner, PageSource pageSource, int initialPageSize, int maximalPageSize, boolean thief, boolean victim)
           
OffHeapStorageArea(PointerSize width, OffHeapStorageArea.Owner owner, PageSource pageSource, int initialPageSize, int maximalPageSize, boolean thief, boolean victim, float compressThreshold)
           
 
Method Summary
 long allocate(long size)
           
 void clear()
           
 void destroy()
           
 void free(long address)
           
 long getAllocatedMemory()
           
 long getOccupiedMemory()
           
 ByteBuffer readBuffer(long address, int length)
          Read the given range and return the data as a single read-only ByteBuffer.
 ByteBuffer[] readBuffers(long address, int length)
          Read the given range and return the data as an array of read-only ByteBuffers.
 byte readByte(long address)
           
 int readInt(long address)
           
 long readLong(long address)
           
 short readShort(long address)
           
 Collection<Page> release(Collection<Page> targets)
           
 void release(long address)
           
 boolean shrink()
           
 String toString()
           
 void validateStorageArea()
           
 void writeBuffer(long address, ByteBuffer data)
           
 void writeBuffers(long address, ByteBuffer[] data)
           
 void writeByte(long address, byte value)
           
 void writeInt(long address, int value)
           
 void writeLong(long address, long value)
           
 void writeShort(long address, short value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OffHeapStorageArea

public OffHeapStorageArea(PointerSize width,
                          OffHeapStorageArea.Owner owner,
                          PageSource pageSource,
                          int pageSize,
                          boolean thief,
                          boolean victim)

OffHeapStorageArea

public OffHeapStorageArea(PointerSize width,
                          OffHeapStorageArea.Owner owner,
                          PageSource pageSource,
                          int pageSize,
                          boolean thief,
                          boolean victim,
                          float compressThreshold)

OffHeapStorageArea

public OffHeapStorageArea(PointerSize width,
                          OffHeapStorageArea.Owner owner,
                          PageSource pageSource,
                          int initialPageSize,
                          int maximalPageSize,
                          boolean thief,
                          boolean victim)

OffHeapStorageArea

public OffHeapStorageArea(PointerSize width,
                          OffHeapStorageArea.Owner owner,
                          PageSource pageSource,
                          int initialPageSize,
                          int maximalPageSize,
                          boolean thief,
                          boolean victim,
                          float compressThreshold)
Method Detail

clear

public void clear()

readByte

public byte readByte(long address)

readShort

public short readShort(long address)

readInt

public int readInt(long address)

readLong

public long readLong(long address)

readBuffer

public ByteBuffer readBuffer(long address,
                             int length)
Read the given range and return the data as a single read-only ByteBuffer.

Parameters:
address - address to read from
length - number of bytes to read
Returns:
a read-only buffer

readBuffers

public ByteBuffer[] readBuffers(long address,
                                int length)
Read the given range and return the data as an array of read-only ByteBuffers.

Parameters:
address - address to read from
length - number of bytes to read
Returns:
an array of read-only buffers

writeByte

public void writeByte(long address,
                      byte value)

writeShort

public void writeShort(long address,
                       short value)

writeInt

public void writeInt(long address,
                     int value)

writeLong

public void writeLong(long address,
                      long value)

writeBuffer

public void writeBuffer(long address,
                        ByteBuffer data)

writeBuffers

public void writeBuffers(long address,
                         ByteBuffer[] data)

free

public void free(long address)

destroy

public void destroy()

allocate

public long allocate(long size)

getAllocatedMemory

public long getAllocatedMemory()

getOccupiedMemory

public long getOccupiedMemory()

toString

public String toString()
Overrides:
toString in class Object

validateStorageArea

public void validateStorageArea()

release

public void release(long address)

release

public Collection<Page> release(Collection<Page> targets)

shrink

public boolean shrink()


Copyright © 2016. All rights reserved.