@IgniteSpiNoop @IgniteSpiMultipleInstancesSupport(value=true) public class NoopSwapSpaceSpi extends IgniteSpiAdapter implements SwapSpaceSpi
SwapSpaceSpi. Exists for testing and benchmarking purposes.gridName, ignite| Constructor and Description |
|---|
NoopSwapSpaceSpi() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear(String space)
Entirely clears data space with given name, if any.
|
long |
count(String space)
Gets number of stored entries (keys) in data space with given name.
|
long |
count(String spaceName,
Set<Integer> parts)
Gets number of stored entries (keys) in data space with given name.
|
<K> IgniteSpiCloseableIterator<K> |
keyIterator(String spaceName,
SwapContext ctx)
Gets iterator over space keys.
|
Collection<Integer> |
partitions(String spaceName)
Gets partitions IDs that are stored in the passed in space.
|
IgniteSpiCloseableIterator<Map.Entry<byte[],byte[]>> |
rawIterator(String spaceName)
Gets raw iterator over space entries.
|
IgniteSpiCloseableIterator<Map.Entry<byte[],byte[]>> |
rawIterator(String spaceName,
int part)
Gets raw iterator over space entries.
|
byte[] |
read(String spaceName,
SwapKey key,
SwapContext ctx)
Reads stored value as array of bytes by key from data space with given name.
|
Map<SwapKey,byte[]> |
readAll(String spaceName,
Iterable<SwapKey> keys,
SwapContext ctx)
Reads stored values as array of bytes by all passed keys from data space with
given name.
|
void |
remove(String spaceName,
SwapKey key,
IgniteInClosure<byte[]> c,
SwapContext ctx)
Removes value stored in data space with given name corresponding to specified key.
|
void |
removeAll(String spaceName,
Collection<SwapKey> keys,
IgniteBiInClosure<SwapKey,byte[]> c,
SwapContext ctx)
Removes values stored in data space with given name corresponding to specified keys.
|
void |
setListener(SwapSpaceSpiListener evictLsnr)
Sets eviction listener to receive notifications on evicted swap entries.
|
long |
size(String space)
Gets size in bytes for data space with given name.
|
void |
spiStart(String gridName)
This method is called to start SPI.
|
void |
spiStop()
This method is called to stop SPI.
|
void |
store(String spaceName,
SwapKey key,
byte[] val,
SwapContext ctx)
Stores value as array of bytes with given key into data space with given name.
|
void |
storeAll(String spaceName,
Map<SwapKey,byte[]> pairs,
SwapContext ctx)
Stores key-value pairs (both keys and values are arrays of bytes) into data
space with given name.
|
String |
toString() |
addTimeoutObject, assertParameter, checkConfigurationConsistency0, configInfo, createSpiAttributeName, failureDetectionTimeout, failureDetectionTimeoutEnabled, failureDetectionTimeoutEnabled, getConsistentAttributeNames, getExceptionRegistry, getIgniteHome, getLocalNode, getLocalNodeId, getName, getNodeAttributes, getSpiContext, getStartTimestamp, getStartTimestampFormatted, getUpTime, getUpTimeFormatted, initFailureDetectionTimeout, injectables, injectResources, isNodeStopping, onClientDisconnected, onClientReconnected, onContextDestroyed, onContextDestroyed0, onContextInitialized, onContextInitialized0, registerMBean, removeTimeoutObject, setName, startInfo, startStopwatch, stopInfo, unregisterMBeanclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetName, getNodeAttributes, onClientDisconnected, onClientReconnected, onContextDestroyed, onContextInitializedpublic void spiStart(@Nullable
String gridName)
throws IgniteSpiException
spiStart in interface IgniteSpigridName - Name of grid instance this SPI is being started for
(null for default grid).IgniteSpiException - Throws in case of any error during SPI start.public void spiStop()
throws IgniteSpiException
Note that this method can be called at any point including during recovery of failed start. It should make no assumptions on what state SPI will be in when this method is called.
spiStop in interface IgniteSpiIgniteSpiException - Thrown in case of any error during SPI stop.public void clear(@Nullable
String space)
throws IgniteSpiException
clear in interface SwapSpaceSpispace - Space name to clear.IgniteSpiException - In case of any errors.public long size(@Nullable
String space)
throws IgniteSpiException
0.size in interface SwapSpaceSpispace - Space name to get size for.IgniteSpiException - In case of any errors.public long count(@Nullable
String space)
throws IgniteSpiException
0.count in interface SwapSpaceSpispace - Space name to get number of entries for.IgniteSpiException - In case of any errors.public long count(@Nullable
String spaceName,
Set<Integer> parts)
throws IgniteSpiException
0.count in interface SwapSpaceSpispaceName - Space name to get number of entries for.parts - Partitions.IgniteSpiException - In case of any errors.@Nullable
public byte[] read(@Nullable
String spaceName,
SwapKey key,
SwapContext ctx)
throws IgniteSpiException
null.read in interface SwapSpaceSpispaceName - Name of the data space to read from.key - Key used to read value from data space.ctx - Swap context.IgniteSpiException - In case of any errors.public Map<SwapKey,byte[]> readAll(@Nullable String spaceName, Iterable<SwapKey> keys, SwapContext ctx) throws IgniteSpiException
readAll in interface SwapSpaceSpispaceName - Name of the data space to read from.keys - Keys used to read values from data space.ctx - Swap context.IgniteSpiException - In case of any errors.public void remove(@Nullable
String spaceName,
SwapKey key,
@Nullable
IgniteInClosure<byte[]> c,
SwapContext ctx)
throws IgniteSpiException
remove in interface SwapSpaceSpispaceName - Space name to remove value from.key - Key to remove value in the specified space for.c - Optional closure that takes removed value and executes after actual
removing. If there was no value in storage the closure is not executed.ctx - Swap context.IgniteSpiException - In case of any errors.public void removeAll(@Nullable
String spaceName,
Collection<SwapKey> keys,
@Nullable
IgniteBiInClosure<SwapKey,byte[]> c,
SwapContext ctx)
throws IgniteSpiException
removeAll in interface SwapSpaceSpispaceName - Space name to remove values from.keys - Keys to remove value in the specified space for.c - Optional closure that takes removed value and executes after actual
removing. If there was no value in storage the closure is not executed.ctx - Swap context.IgniteSpiException - In case of any errors.public void store(@Nullable
String spaceName,
SwapKey key,
@Nullable
byte[] val,
SwapContext ctx)
throws IgniteSpiException
store in interface SwapSpaceSpispaceName - Space name to store key-value pair into.key - Key to store given value for. This key can be used further to
read or remove stored value.val - Some value as array of bytes to store into specified data space.ctx - Swap context.IgniteSpiException - In case of any errors.public void storeAll(@Nullable
String spaceName,
Map<SwapKey,byte[]> pairs,
SwapContext ctx)
throws IgniteSpiException
storeAll in interface SwapSpaceSpispaceName - Space name to store key-value pairs into.pairs - Map of stored key-value pairs where each one is an array of bytes.ctx - Swap context.IgniteSpiException - In case of any errors.public void setListener(@Nullable
SwapSpaceSpiListener evictLsnr)
setListener in interface SwapSpaceSpievictLsnr - Eviction listener (null to stop receiving notifications).public Collection<Integer> partitions(@Nullable String spaceName) throws IgniteSpiException
partitions in interface SwapSpaceSpispaceName - Space name.null if space is unknown.IgniteSpiException - If failed.public <K> IgniteSpiCloseableIterator<K> keyIterator(@Nullable String spaceName, SwapContext ctx) throws IgniteSpiException
keyIterator in interface SwapSpaceSpispaceName - Space name.ctx - Swap context.null if space is unknown.IgniteSpiException - If failed.public IgniteSpiCloseableIterator<Map.Entry<byte[],byte[]>> rawIterator(@Nullable String spaceName) throws IgniteSpiException
rawIterator in interface SwapSpaceSpispaceName - Space name.null if space is unknown.IgniteSpiException - If failed.public IgniteSpiCloseableIterator<Map.Entry<byte[],byte[]>> rawIterator(@Nullable String spaceName, int part) throws IgniteSpiException
rawIterator in interface SwapSpaceSpispaceName - Space name.part - Partition.null if space is unknown.IgniteSpiException - If failed.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.5.11 Release Date : April 8 2016