public class GridSwapSpaceManager extends GridManagerAdapter<GridSwapSpaceSpi>
ctx, log| Constructor and Description |
|---|
GridSwapSpaceManager(GridKernalContext ctx) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear(String spaceName) |
<K> GridCloseableIterator<K> |
keysIterator(String spaceName,
ClassLoader ldr)
Gets iterator over space entries.
|
protected void |
onKernalStop0(boolean cancel) |
GridCloseableIterator<Map.Entry<byte[],byte[]>> |
rawIterator(String spaceName)
Gets iterator over space entries.
|
GridCloseableIterator<Map.Entry<byte[],byte[]>> |
rawIterator(String spaceName,
int part) |
byte[] |
read(String spaceName,
GridSwapKey key,
ClassLoader ldr)
Reads value from swap.
|
<T> T |
read(String spaceName,
Object key,
ClassLoader ldr)
Reads value from swap.
|
<T> T |
readValue(String spaceName,
GridSwapKey key,
ClassLoader ldr)
Reads value from swap.
|
void |
remove(String spaceName,
GridSwapKey key,
GridInClosure<byte[]> c,
ClassLoader ldr)
Removes value from swap.
|
void |
remove(String spaceName,
Object key,
GridInClosure<byte[]> c,
ClassLoader ldr)
Removes value from swap.
|
void |
removeAll(String spaceName,
Collection<GridSwapKey> keys,
GridBiInClosure<GridSwapKey,byte[]> c,
ClassLoader ldr)
Removes value from swap.
|
void |
start()
Starts grid component.
|
void |
stop(boolean cancel)
Stops grid component.
|
long |
swapKeys(String spaceName)
Gets number of swap entries (keys).
|
long |
swapSize(String spaceName)
Gets size in bytes for swap space.
|
void |
write(String spaceName,
GridSwapKey key,
byte[] val,
ClassLoader ldr)
Writes value to swap.
|
void |
write(String spaceName,
Object key,
Object val,
ClassLoader ldr)
Writes value to swap.
|
<K,V> void |
writeAll(String spaceName,
Iterable<GridCacheBatchSwapEntry<K,V>> swapped,
ClassLoader ldr)
Writes batch to swap.
|
addSpiAttributes, assertParameter, collectDiscoveryData, enabled, getSpi, getSpi, getSpis, onDiscoveryDataReceived, onKernalStart, onKernalStart0, onKernalStop, printMemoryStats, startInfo, startSpi, stopInfo, stopSpi, toString, validateNodepublic GridSwapSpaceManager(GridKernalContext ctx)
ctx - Grid kernal context.public void start()
throws GridException
GridException - Throws in case of any errors.protected void onKernalStop0(boolean cancel)
onKernalStop0 in class GridManagerAdapter<GridSwapSpaceSpi>cancel - Cancel flag.public void stop(boolean cancel)
throws GridException
cancel - If true, then all ongoing tasks or jobs for relevant
components need to be cancelled.GridException - Thrown in case of any errors.@Nullable public byte[] read(@Nullable String spaceName, GridSwapKey key, @Nullable ClassLoader ldr) throws GridException
spaceName - Space name.key - Key.ldr - Class loader (optional).GridException - If failed.@Nullable public <T> T read(@Nullable String spaceName, Object key, @Nullable ClassLoader ldr) throws GridException
spaceName - Space name.key - Key.ldr - Class loader (optional).GridException - If failed.@Nullable public <T> T readValue(@Nullable String spaceName, GridSwapKey key, @Nullable ClassLoader ldr) throws GridException
spaceName - Space name.key - Swap key.ldr - Class loader (optional).GridException - If failed.public void write(@Nullable String spaceName, GridSwapKey key, byte[] val, @Nullable ClassLoader ldr) throws GridException
spaceName - Space name.key - Key.val - Value.ldr - Class loader (optional).GridException - If failed.public <K,V> void writeAll(String spaceName, Iterable<GridCacheBatchSwapEntry<K,V>> swapped, @Nullable ClassLoader ldr) throws GridException
spaceName - Space name.swapped - Swapped entries.ldr - Class loader (optional).GridException - If failed.public void write(@Nullable String spaceName, Object key, @Nullable Object val, @Nullable ClassLoader ldr) throws GridException
spaceName - Space name.key - Key.val - Value.ldr - Class loader (optional).GridException - If failed.public void remove(@Nullable String spaceName, GridSwapKey key, @Nullable GridInClosure<byte[]> c, @Nullable ClassLoader ldr) throws GridException
spaceName - Space name.key - Key.c - Optional closure that takes removed value and executes after actual
removing. If there was no value in storage the closure is executed given
null value as parameter.ldr - Class loader (optional).GridException - If failed.public void removeAll(@Nullable String spaceName, Collection<GridSwapKey> keys, GridBiInClosure<GridSwapKey,byte[]> c, @Nullable ClassLoader ldr) throws GridException
spaceName - Space name.keys - Collection of keys.c - Optional closure that takes removed value and executes after actual
removing. If there was no value in storage the closure is executed given
null value as parameter.ldr - Class loader (optional).GridException - If failed.public void remove(@Nullable String spaceName, Object key, @Nullable GridInClosure<byte[]> c, @Nullable ClassLoader ldr) throws GridException
spaceName - Space name.key - Key.c - Optional closure that takes removed value and executes after actual
removing. If there was no value in storage the closure is executed given
null value as parameter.ldr - Class loader (optional).GridException - If failed.public long swapSize(@Nullable String spaceName) throws GridException
spaceName - Space name.GridException - If failed.public long swapKeys(@Nullable String spaceName) throws GridException
spaceName - Space name.GridException - If failed.public void clear(@Nullable String spaceName) throws GridException
spaceName - Space name.GridException - If failed.@Nullable public GridCloseableIterator<Map.Entry<byte[],byte[]>> rawIterator(@Nullable String spaceName) throws GridException
spaceName - Space name.null if space is unknown.GridSpiException - If failed.GridException@Nullable public GridCloseableIterator<Map.Entry<byte[],byte[]>> rawIterator(@Nullable String spaceName, int part) throws GridException
GridException@Nullable public <K> GridCloseableIterator<K> keysIterator(@Nullable String spaceName, @Nullable ClassLoader ldr) throws GridException
spaceName - Space name.ldr - Class loader.null if space is unknown.GridSpiException - If failed.GridExceptionCopyright © 2014. All rights reserved.