public class GridOffHeapProcessor extends GridProcessorAdapter
ctx, log| Constructor and Description |
|---|
GridOffHeapProcessor(GridKernalContext ctx) |
| Modifier and Type | Method and Description |
|---|---|
long |
allocatedSize(String spaceName)
Gets size of a memory allocated for the entries of the given space.
|
boolean |
contains(String spaceName,
int part,
Object key,
byte[] keyBytes)
Checks if offheap space contains value for the given key.
|
void |
create(String spaceName,
int parts,
long init,
long max,
GridOffHeapEvictListener lsnr)
Creates offheap map for given space name.
|
long |
entriesCount(String spaceName)
Gets number of elements in the given space.
|
byte[] |
get(String spaceName,
int part,
Object key,
byte[] keyBytes)
Gets value bytes from offheap space for the given key.
|
<T> T |
getValue(String spaceName,
int part,
Object key,
byte[] keyBytes,
ClassLoader ldr)
Gets value from offheap space for the given key.
|
GridCloseableIterator<GridBiTuple<byte[],byte[]>> |
iterator(String spaceName)
Gets iterator over contents of the given space.
|
GridCloseableIterator<GridBiTuple<byte[],byte[]>> |
iterator(String spaceName,
int part)
Gets iterator over contents of partition.
|
void |
put(String spaceName,
int part,
Object key,
byte[] keyBytes,
byte[] valBytes)
Puts the given value to offheap space for the given key.
|
byte[] |
remove(String spaceName,
int part,
Object key,
byte[] keyBytes)
Removes value from offheap space for the given key.
|
boolean |
removex(String spaceName,
int part,
Object key,
byte[] keyBytes)
Removes value from offheap space for the given key.
|
void |
stop(boolean cancel)
Stops grid component.
|
addAttributes, assertParameter, collectDiscoveryData, onDiscoveryDataReceived, onKernalStart, onKernalStop, printMemoryStats, start, toString, validateNodepublic GridOffHeapProcessor(GridKernalContext ctx)
ctx - Kernal context.public void create(@Nullable String spaceName, int parts, long init, long max, @Nullable GridOffHeapEvictListener lsnr)
spaceName - Space name.parts - Partitions number.init - Initial size.max - Maximum size.lsnr - Eviction listener.public void stop(boolean cancel)
throws GridException
stop in interface GridComponentstop in class GridProcessorAdaptercancel - If true, then all ongoing tasks or jobs for relevant
components need to be cancelled.GridException - Thrown in case of any errors.public boolean contains(@Nullable String spaceName, int part, Object key, byte[] keyBytes) throws GridException
spaceName - Space name.part - Partition.key - Key.keyBytes - Key bytes.true If offheap space contains value for the given key.GridException - If failed.@Nullable public byte[] get(@Nullable String spaceName, int part, Object key, byte[] keyBytes) throws GridException
spaceName - Space name.part - Partition.key - Key.keyBytes - Key bytes.GridException - If failed.@Nullable public <T> T getValue(@Nullable String spaceName, int part, Object key, byte[] keyBytes, @Nullable ClassLoader ldr) throws GridException
spaceName - Space name.part - Partition.key - Key.keyBytes - Key bytes.ldr - Class loader.GridException - If failed.@Nullable public byte[] remove(@Nullable String spaceName, int part, Object key, byte[] keyBytes) throws GridException
spaceName - Space name.part - Partition.key - Key.keyBytes - Key bytes.GridException - If failed.public void put(@Nullable String spaceName, int part, Object key, byte[] keyBytes, byte[] valBytes) throws GridException
spaceName - Space name.part - Partition.key - Key.keyBytes - Key bytes.valBytes - Value bytes.GridException - If failed.public boolean removex(@Nullable String spaceName, int part, Object key, byte[] keyBytes) throws GridException
spaceName - Space name.part - Partition.key - Key.keyBytes - Key bytes.true If succeeded.GridException - If failed.public GridCloseableIterator<GridBiTuple<byte[],byte[]>> iterator(@Nullable String spaceName)
spaceName - Space name.public long entriesCount(@Nullable String spaceName)
spaceName - Space name. Optional.-1 if no space with the given name has been found.public long allocatedSize(@Nullable String spaceName)
spaceName - Space name. Optional.-1 if no space with the given name has been found.public GridCloseableIterator<GridBiTuple<byte[],byte[]>> iterator(@Nullable String spaceName, int part)
spaceName - Space name.part - Partition.Copyright © 2014. All rights reserved.