public class GridCacheSwapManager extends GridCacheManagerAdapter
cctx, log| Constructor and Description |
|---|
GridCacheSwapManager(boolean enabled) |
| Modifier and Type | Method and Description |
|---|---|
void |
addOffHeapListener(int part,
GridCacheSwapListener lsnr) |
void |
addSwapListener(int part,
GridCacheSwapListener lsnr) |
void |
clearSwap()
Clears swap.
|
boolean |
containsKey(KeyCacheObject key,
int part) |
GridCloseableIterator<Map.Entry<byte[],GridCacheSwapEntry>> |
iterator(int part)
Gets offheap and swap iterator over partition.
|
<K,V> Iterator<Map.Entry<K,V>> |
lazyOffHeapIterator(boolean keepBinary) |
<K,V> Iterator<Map.Entry<K,V>> |
lazySwapIterator(boolean keepBinary) |
long |
offHeapAllocatedSize()
Gets memory size allocated in off-heap.
|
boolean |
offHeapEnabled() |
long |
offHeapEntriesCount()
Gets number of elements in off-heap
|
int |
offheapEntriesCount(boolean primary,
boolean backup,
AffinityTopologyVersion topVer) |
long |
offheapEntriesCount(int partId) |
<K,V> Iterator<javax.cache.Cache.Entry<K,V>> |
offheapIterator(boolean primary,
boolean backup,
AffinityTopologyVersion topVer,
boolean keepBinary) |
GridCloseableIterator<Map.Entry<byte[],GridCacheSwapEntry>> |
offHeapIterator(int part)
Gets offheap iterator over partition.
|
Iterator<KeyCacheObject> |
offHeapKeyIterator(boolean primary,
boolean backup,
AffinityTopologyVersion topVer) |
int |
onUndeploy(ClassLoader ldr) |
GridCloseableIterator<Map.Entry<byte[],byte[]>> |
rawIterator()
Gets offheap and swap iterator over partition.
|
<T> GridCloseableIterator<T> |
rawOffHeapIterator(CX2<T2<Long,Integer>,T2<Long,Integer>,T> c,
Integer part,
boolean primary,
boolean backup) |
GridCloseableIterator<Map.Entry<byte[],byte[]>> |
rawOffHeapIterator(Integer part,
boolean primary,
boolean backup) |
GridCloseableIterator<Map.Entry<byte[],byte[]>> |
rawSwapIterator(boolean primary,
boolean backup) |
GridCloseableIterator<Map.Entry<byte[],byte[]>> |
rawSwapIterator(boolean primary,
boolean backup,
AffinityTopologyVersion topVer) |
GridCloseableIterator<Map.Entry<byte[],byte[]>> |
rawSwapIterator(int part) |
Collection<GridCacheBatchSwapEntry> |
readAndRemove(Collection<? extends KeyCacheObject> keys) |
GridCacheSwapEntry |
readOffheapBeforeRemove(KeyCacheObject key,
byte[] keyBytes,
int part)
Reads value from offheap and unswaps it for indexing.
|
CacheObject |
readValue(KeyCacheObject key,
boolean readOffheap,
boolean readSwap) |
void |
remove(KeyCacheObject key,
int part) |
void |
removeOffHeapListener(int part,
GridCacheSwapListener lsnr) |
void |
removeSwapListener(int part,
GridCacheSwapListener lsnr) |
String |
spaceName() |
void |
start0() |
protected void |
stop0(boolean cancel) |
boolean |
swapEnabled() |
int |
swapEntriesCount(boolean primary,
boolean backup,
AffinityTopologyVersion topVer) |
long |
swapEntriesCount(int partId) |
<K,V> Iterator<javax.cache.Cache.Entry<K,V>> |
swapIterator(boolean primary,
boolean backup,
AffinityTopologyVersion topVer,
boolean keepBinary) |
GridCloseableIterator<Map.Entry<byte[],GridCacheSwapEntry>> |
swapIterator(int part)
Gets swap space iterator over partition.
|
Iterator<KeyCacheObject> |
swapKeyIterator(boolean primary,
boolean backup,
AffinityTopologyVersion topVer) |
long |
swapKeys()
Gets number of swap entries (keys).
|
long |
swapSize() |
CacheObject |
unmarshalSwapEntryValue(byte[] bytes) |
void |
unwindOffheapEvicts() |
void |
writeToSwap(int part,
KeyCacheObject key,
byte[] entry)
Writes given bytes to swap.
|
context, kernalStartInfo, kernalStopInfo, log, onDisconnected, onKernalStart, onKernalStart0, onKernalStop, onKernalStop0, printMemoryStats, start, startInfo, stop, stopInfo, toStringpublic GridCacheSwapManager(boolean enabled)
enabled - Flag to indicate if swap is enabled.public void start0()
throws IgniteCheckedException
start0 in class GridCacheManagerAdapterIgniteCheckedException - If failed.protected void stop0(boolean cancel)
stop0 in class GridCacheManagerAdaptercancel - Cancel flag.public void unwindOffheapEvicts()
public boolean swapEnabled()
True if swap store is enabled.public boolean offHeapEnabled()
True if off-heap cache is enabled.public long swapSize()
throws IgniteCheckedException
IgniteCheckedException - If failed.public int swapEntriesCount(boolean primary,
boolean backup,
AffinityTopologyVersion topVer)
throws IgniteCheckedException
primary - If true includes primary entries.backup - If true includes backup entries.topVer - Topology version.IgniteCheckedException - If failed.public long swapEntriesCount(int partId)
throws IgniteCheckedException
partId - Partition ID to get swap entries count for.IgniteCheckedException - If failed.public int offheapEntriesCount(boolean primary,
boolean backup,
AffinityTopologyVersion topVer)
throws IgniteCheckedException
primary - If true includes primary entries.backup - If true includes backup entries.topVer - Topology version.IgniteCheckedException - If failed.public long offheapEntriesCount(int partId)
throws IgniteCheckedException
partId - Partition ID to get entries count for.IgniteCheckedException - If failed.public long swapKeys()
throws IgniteCheckedException
IgniteCheckedException - If failed.public void addSwapListener(int part,
GridCacheSwapListener lsnr)
part - Partition.lsnr - Listener.public void removeSwapListener(int part,
GridCacheSwapListener lsnr)
part - Partition.lsnr - Listener.public void addOffHeapListener(int part,
GridCacheSwapListener lsnr)
part - Partition.lsnr - Listener.public void removeOffHeapListener(int part,
GridCacheSwapListener lsnr)
part - Partition.lsnr - Listener.public boolean containsKey(KeyCacheObject key, int part) throws IgniteCheckedException
key - Key to check.part - Partition.True if key is contained.IgniteCheckedException - If failed.@Nullable public CacheObject readValue(KeyCacheObject key, boolean readOffheap, boolean readSwap) throws IgniteCheckedException
key - Key to read swap entry for.readOffheap - Read offheap flag.readSwap - Read swap flag.IgniteCheckedException - If read failed.public Collection<GridCacheBatchSwapEntry> readAndRemove(Collection<? extends KeyCacheObject> keys) throws IgniteCheckedException
keys - Collection of keys to remove from swap.IgniteCheckedException - If failed,public GridCacheSwapEntry readOffheapBeforeRemove(KeyCacheObject key, byte[] keyBytes, int part) throws IgniteCheckedException
key - Key.keyBytes - Key bytes.part - Partition.IgniteCheckedException - If failed.public void remove(KeyCacheObject key, int part) throws IgniteCheckedException
key - Key to remove.part - Partition.IgniteCheckedException - If failed.public void writeToSwap(int part,
KeyCacheObject key,
byte[] entry)
throws IgniteCheckedException
part - Partition.key - Key. If null then it will be deserialized from keyBytes.entry - Entry bytes.IgniteCheckedException - If failed.public void clearSwap()
throws IgniteCheckedException
IgniteCheckedException - If failed.@Nullable public GridCloseableIterator<Map.Entry<byte[],GridCacheSwapEntry>> iterator(int part) throws IgniteCheckedException
part - Partition to iterate over.IgniteCheckedException - If failed.@Nullable public GridCloseableIterator<Map.Entry<byte[],byte[]>> rawIterator() throws IgniteCheckedException
IgniteCheckedException - If failed.public <K,V> Iterator<Map.Entry<K,V>> lazySwapIterator(boolean keepBinary) throws IgniteCheckedException
keepBinary - Keep binary flag.IgniteCheckedException - If failed.public Iterator<KeyCacheObject> offHeapKeyIterator(boolean primary, boolean backup, AffinityTopologyVersion topVer)
public Iterator<KeyCacheObject> swapKeyIterator(boolean primary, boolean backup, AffinityTopologyVersion topVer) throws IgniteCheckedException
IgniteCheckedExceptionpublic <K,V> Iterator<Map.Entry<K,V>> lazyOffHeapIterator(boolean keepBinary)
keepBinary - Keep binary flag.public long offHeapEntriesCount()
0 if off-heap is disabled.public long offHeapAllocatedSize()
0 if off-heap is disabled.@Nullable public GridCloseableIterator<Map.Entry<byte[],GridCacheSwapEntry>> offHeapIterator(int part) throws IgniteCheckedException
part - Partition to iterate over.IgniteCheckedException - If failed.public <T> GridCloseableIterator<T> rawOffHeapIterator(CX2<T2<Long,Integer>,T2<Long,Integer>,T> c, @Nullable Integer part, boolean primary, boolean backup)
c - Key/value closure.part - Partition.primary - Include primaries.backup - Include backups.public GridCloseableIterator<Map.Entry<byte[],byte[]>> rawOffHeapIterator(@Nullable Integer part, boolean primary, boolean backup)
part - Partition.primary - Include primaries.backup - Include backups.@Nullable public GridCloseableIterator<Map.Entry<byte[],GridCacheSwapEntry>> swapIterator(int part) throws IgniteCheckedException
part - Partition to iterate over.IgniteCheckedException - If failed.public GridCloseableIterator<Map.Entry<byte[],byte[]>> rawSwapIterator(boolean primary, boolean backup) throws IgniteCheckedException
primary - Include primaries.backup - Include backups.IgniteCheckedException - If failed.public GridCloseableIterator<Map.Entry<byte[],byte[]>> rawSwapIterator(boolean primary, boolean backup, AffinityTopologyVersion topVer) throws IgniteCheckedException
primary - Include primaries.backup - Include backups.topVer - Affinity topology version.IgniteCheckedException - If failed.public GridCloseableIterator<Map.Entry<byte[],byte[]>> rawSwapIterator(int part) throws IgniteCheckedException
part - Partition.IgniteCheckedException - If failed.public <K,V> Iterator<javax.cache.Cache.Entry<K,V>> swapIterator(boolean primary, boolean backup, AffinityTopologyVersion topVer, boolean keepBinary) throws IgniteCheckedException
primary - If true includes primary entries.backup - If true includes backup entries.topVer - Topology version.keepBinary - Keep binary flag.IgniteCheckedException - If failed.public <K,V> Iterator<javax.cache.Cache.Entry<K,V>> offheapIterator(boolean primary, boolean backup, AffinityTopologyVersion topVer, boolean keepBinary) throws IgniteCheckedException
primary - If true includes primary entries.backup - If true includes backup entries.topVer - Topology version.keepBinary - Keep binary flag.IgniteCheckedException - If failed.public int onUndeploy(ClassLoader ldr)
ldr - Undeployed class loader.public String spaceName()
public CacheObject unmarshalSwapEntryValue(byte[] bytes) throws IgniteCheckedException
bytes - Bytes to unmarshal.IgniteCheckedException - If failed.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.9.0 Release Date : March 2 2017