public class GridOffHeapProcessor extends GridProcessorAdapter
GridComponent.DiscoveryDataExchangeType
ctx, diagnosticLog, 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,
KeyCacheObject 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.
|
void |
destruct(String spaceName)
Destructs offheap map for given space name.
|
void |
enableEviction(String spaceName,
int part,
KeyCacheObject key,
byte[] keyBytes)
Enables eviction for entry after
valuePointer(java.lang.String, int, org.apache.ignite.internal.processors.cache.KeyCacheObject, byte[]) was called. |
long |
entriesCount(String spaceName)
Gets number of elements in the given space.
|
long |
entriesCount(String spaceName,
Set<Integer> parts)
Gets number of elements in the given space.
|
byte[] |
get(String spaceName,
int part,
KeyCacheObject key,
byte[] keyBytes)
Gets value bytes from offheap space for the given key.
|
<T> T |
getValue(String spaceName,
int part,
KeyCacheObject key,
byte[] keyBytes,
ClassLoader ldr)
Gets value from offheap space for the given key.
|
GridCloseableIterator<IgniteBiTuple<byte[],byte[]>> |
iterator(String spaceName)
Gets iterator over contents of the given space.
|
<T> GridCloseableIterator<T> |
iterator(String spaceName,
CX2<T2<Long,Integer>,T2<Long,Integer>,T> c)
Gets iterator over contents of the given space.
|
<T> GridCloseableIterator<T> |
iterator(String spaceName,
CX2<T2<Long,Integer>,T2<Long,Integer>,T> c,
int part)
Gets iterator over contents of the given space.
|
GridCloseableIterator<IgniteBiTuple<byte[],byte[]>> |
iterator(String spaceName,
int part)
Gets iterator over contents of partition.
|
void |
put(String spaceName,
int part,
KeyCacheObject key,
byte[] keyBytes,
byte[] valBytes)
Puts the given value to offheap space for the given key.
|
byte[] |
remove(String spaceName,
int part,
KeyCacheObject key,
byte[] keyBytes)
Removes value from offheap space for the given key.
|
boolean |
removex(String spaceName,
int part,
KeyCacheObject key,
byte[] keyBytes)
Removes value from offheap space for the given key.
|
boolean |
removex(String spaceName,
int part,
KeyCacheObject key,
byte[] keyBytes,
IgniteBiPredicate<Long,Integer> p)
Removes value from offheap space for the given key.
|
void |
stop(boolean cancel)
Stops grid component.
|
IgniteBiTuple<Long,Integer> |
valuePointer(String spaceName,
int part,
KeyCacheObject key,
byte[] keyBytes)
Gets value pointer from offheap space for the given key.
|
assertParameter, collectGridNodeData, collectJoiningNodeData, discoveryDataType, onDisconnected, onGridDataReceived, onJoiningNodeDataReceived, onKernalStart, onKernalStop, onReconnected, printMemoryStats, start, toString, validateNode
public 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 destruct(@Nullable String spaceName)
spaceName
- Space name.public void stop(boolean cancel) throws IgniteCheckedException
stop
in interface GridComponent
stop
in class GridProcessorAdapter
cancel
- If true
, then all ongoing tasks or jobs for relevant
components need to be cancelled.IgniteCheckedException
- Thrown in case of any errors.public boolean contains(@Nullable String spaceName, int part, KeyCacheObject key, byte[] keyBytes) throws IgniteCheckedException
spaceName
- Space name.part
- Partition.key
- Key.keyBytes
- Key bytes.true
If offheap space contains value for the given key.IgniteCheckedException
- If failed.@Nullable public byte[] get(@Nullable String spaceName, int part, KeyCacheObject key, byte[] keyBytes) throws IgniteCheckedException
spaceName
- Space name.part
- Partition.key
- Key.keyBytes
- Key bytes.IgniteCheckedException
- If failed.@Nullable public IgniteBiTuple<Long,Integer> valuePointer(@Nullable String spaceName, int part, KeyCacheObject key, byte[] keyBytes) throws IgniteCheckedException
put(java.lang.String, int, org.apache.ignite.internal.processors.cache.KeyCacheObject, byte[], byte[])
or
enableEviction(java.lang.String, int, org.apache.ignite.internal.processors.cache.KeyCacheObject, byte[])
is called.spaceName
- Space name.part
- Partition.key
- Key.keyBytes
- Key bytes.IgniteCheckedException
- If failed.public void enableEviction(@Nullable String spaceName, int part, KeyCacheObject key, byte[] keyBytes) throws IgniteCheckedException
valuePointer(java.lang.String, int, org.apache.ignite.internal.processors.cache.KeyCacheObject, byte[])
was called.spaceName
- Space name.part
- Partition.key
- Key.keyBytes
- Key bytes.IgniteCheckedException
- If failed.@Nullable public <T> T getValue(@Nullable String spaceName, int part, KeyCacheObject key, byte[] keyBytes, @Nullable ClassLoader ldr) throws IgniteCheckedException
spaceName
- Space name.part
- Partition.key
- Key.keyBytes
- Key bytes.ldr
- Class loader.IgniteCheckedException
- If failed.@Nullable public byte[] remove(@Nullable String spaceName, int part, KeyCacheObject key, byte[] keyBytes) throws IgniteCheckedException
spaceName
- Space name.part
- Partition.key
- Key.keyBytes
- Key bytes.IgniteCheckedException
- If failed.public void put(@Nullable String spaceName, int part, KeyCacheObject key, byte[] keyBytes, byte[] valBytes) throws IgniteCheckedException
spaceName
- Space name.part
- Partition.key
- Key.keyBytes
- Key bytes.valBytes
- Value bytes.IgniteCheckedException
- If failed.public boolean removex(@Nullable String spaceName, int part, KeyCacheObject key, byte[] keyBytes) throws IgniteCheckedException
spaceName
- Space name.part
- Partition.key
- Key.keyBytes
- Key bytes.true
If succeeded.IgniteCheckedException
- If failed.public boolean removex(@Nullable String spaceName, int part, KeyCacheObject key, byte[] keyBytes, IgniteBiPredicate<Long,Integer> p) throws IgniteCheckedException
spaceName
- Space name.part
- Partition.key
- Key.keyBytes
- Key bytes.p
- Value predicate (arguments are value address and value length).true
If succeeded.IgniteCheckedException
- If failed.public GridCloseableIterator<IgniteBiTuple<byte[],byte[]>> iterator(@Nullable String spaceName)
spaceName
- Space name.public <T> GridCloseableIterator<T> iterator(@Nullable String spaceName, CX2<T2<Long,Integer>,T2<Long,Integer>,T> c)
spaceName
- Space name.c
- Key/value closure.public <T> GridCloseableIterator<T> iterator(@Nullable String spaceName, CX2<T2<Long,Integer>,T2<Long,Integer>,T> c, int part)
spaceName
- Space name.c
- Key/value closure.part
- Partition.public long entriesCount(@Nullable String spaceName)
spaceName
- Space name. Optional.-1
if no space with the given name has been found.public long entriesCount(@Nullable String spaceName, Set<Integer> parts)
spaceName
- Space name. Optional.parts
- Partitions.-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<IgniteBiTuple<byte[],byte[]>> iterator(@Nullable String spaceName, int part)
spaceName
- Space name.part
- Partition.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.3.0 Release Date : October 28 2017