public class GridPartitionedCacheEntryImpl<K,V> extends GridCacheEntryImpl<K,V>
cached, ctx, key, MODES_SMART, proxy| Constructor and Description |
|---|
GridPartitionedCacheEntryImpl()
Empty constructor required for
Externalizable. |
GridPartitionedCacheEntryImpl(GridCacheProjectionImpl<K,V> nearPrj,
GridCacheContext<K,V> ctx,
K key,
GridCacheEntryEx<K,V> cached) |
| Modifier and Type | Method and Description |
|---|---|
<V1> V1 |
addMeta(String name,
V1 val)
Adds a new metadata.
|
<V1> V1 |
addMetaIfAbsent(String name,
Callable<V1> c)
Adds given metadata value only if it was absent.
|
<V1> V1 |
addMetaIfAbsent(String name,
V1 val)
Adds given metadata value only if it was absent.
|
<V1> Map<String,V1> |
allMeta()
Gets all metadata in this entry.
|
void |
copyMeta(GridMetadataAware from)
Copies all metadata from another instance.
|
void |
copyMeta(Map<String,?> data)
Copies all metadata from given map.
|
GridDhtCacheAdapter<K,V> |
dht() |
protected GridCacheEntryEx<K,V> |
entryEx(boolean touch,
long topVer) |
boolean |
evictDhtOnly(GridPredicate<GridCacheEntry<K,V>>[] filter) |
boolean |
evictNearOnly(GridPredicate<GridCacheEntry<K,V>>[] filter) |
boolean |
hasMeta(String name)
Tests whether or not given metadata is set.
|
boolean |
hasMeta(String name,
Object val)
Tests whether or not metadata with given name and value is set.
|
<V1> V1 |
meta(String name)
Gets metadata by name.
|
GridNearCacheAdapter<K,V> |
near() |
V |
peek(Collection<GridCachePeekMode> modes)
This method has the same semantic as
GridCacheProjection.peek(Object, Collection) method. |
V |
peekDht(GridPredicate<GridCacheEntry<K,V>>[] filter) |
protected GridCacheEntryEx<K,V> |
peekEx(long topVer) |
<V1> V1 |
putMetaIfAbsent(String name,
Callable<V1> c)
Adds given metadata value only if it was absent.
|
<V1> V1 |
putMetaIfAbsent(String name,
V1 val)
Adds given metadata value only if it was absent.
|
<V1> V1 |
removeMeta(String name)
Removes metadata by name.
|
<V1> boolean |
removeMeta(String name,
V1 val)
Removes metadata only if its current value is equal to
val passed in. |
<V1> boolean |
replaceMeta(String name,
V1 curVal,
V1 newVal)
Replaces given metadata with new
newVal value only if its current value
is equal to curVal. |
String |
toString() |
backup, clear, compact, equals, evict, expirationTime, get, getAsync, getKey, getValue, hashCode, isCached, isLocked, isLockedByThread, lock, lockAsync, memorySize, partition, peek, primary, projection, readExternal, reload, reloadAsync, remove, remove, removeAsync, removeAsync, removex, removexAsync, replace, replace, replaceAsync, replaceAsync, replacex, replacexAsync, reset, set, setAsync, setIfAbsent, setIfAbsentAsync, setValue, setx, setxAsync, setxIfAbsent, setxIfAbsentAsync, timeToLive, timeToLive, transform, transformAsync, unlock, unwrapNoCreate, version, writeExternalpublic GridPartitionedCacheEntryImpl()
Externalizable.public GridPartitionedCacheEntryImpl(GridCacheProjectionImpl<K,V> nearPrj, GridCacheContext<K,V> ctx, K key, @Nullable GridCacheEntryEx<K,V> cached)
nearPrj - Parent projection or null if entry belongs to default cache.ctx - Near cache context.key - key.cached - Cached entry (either from near or dht cache map).public GridDhtCacheAdapter<K,V> dht()
public GridNearCacheAdapter<K,V> near()
public boolean evictNearOnly(@Nullable GridPredicate<GridCacheEntry<K,V>>[] filter)
filter - Optional filter.True if evicted.public boolean evictDhtOnly(@Nullable GridPredicate<GridCacheEntry<K,V>>[] filter)
filter - Filter.True if evicted.public V peek(@Nullable Collection<GridCachePeekMode> modes) throws GridException
GridCacheProjection.peek(Object, Collection) method.peek in interface GridCacheEntry<K,V>peek in class GridCacheEntryImpl<K,V>modes - See GridCacheProjection.peek(Object, Collection).GridCacheProjection.peek(Object, Collection).GridException - See GridCacheProjection.peek(Object, Collection).@Nullable public V peekDht(@Nullable GridPredicate<GridCacheEntry<K,V>>[] filter)
filter - Filter.protected GridCacheEntryEx<K,V> entryEx(boolean touch, long topVer)
entryEx in class GridCacheEntryImpl<K,V>protected GridCacheEntryEx<K,V> peekEx(long topVer)
peekEx in class GridCacheEntryImpl<K,V>public <V1> V1 addMeta(String name, V1 val)
addMeta in interface GridMetadataAwareaddMeta in class GridCacheEntryImpl<K,V>V1 - Type of the value.name - Metadata name.val - Metadata value.null if there was none.public <V1> V1 addMetaIfAbsent(String name, Callable<V1> c)
addMetaIfAbsent in interface GridMetadataAwareaddMetaIfAbsent in class GridCacheEntryImpl<K,V>V1 - Type of the value.name - Metadata name.c - Factory closure to produce value to add if it's not attached already.
Not that unlike GridMetadataAware.addMeta(String, Object) method the factory closure will
not be called unless the value is required and therefore value will only be created
when it is actually needed. If null and metadata value is missing - null
will be returned from this method.public <V1> V1 addMetaIfAbsent(String name, V1 val)
GridMetadataAware.putMetaIfAbsent(String, Callable), this method always returns
the latest value and never previous one.addMetaIfAbsent in interface GridMetadataAwareaddMetaIfAbsent in class GridCacheEntryImpl<K,V>V1 - Type of the value.name - Metadata name.val - Value to add if it's not attached already.public <V1> Map<String,V1> allMeta()
allMeta in interface GridMetadataAwareallMeta in class GridCacheEntryImpl<K,V>V1 - Type of the value.public boolean hasMeta(String name)
hasMeta in interface GridMetadataAwarehasMeta in class GridCacheEntryImpl<K,V>name - Name of the metadata to test.public boolean hasMeta(String name, Object val)
true if
attachment with given name it set and its value is equals to provided value. Otherwise returns
false.hasMeta in interface GridMetadataAwarehasMeta in class GridCacheEntryImpl<K,V>name - Name of the metadata.val - Value to compare. Cannot be null.true if metadata with given name is set and its value is equals to provided value -
otherwise returns false.public <V1> V1 meta(String name)
meta in interface GridMetadataAwaremeta in class GridCacheEntryImpl<K,V>V1 - Type of the value.name - Metadata name.null.public <V1> V1 putMetaIfAbsent(String name, Callable<V1> c)
putMetaIfAbsent in interface GridMetadataAwareputMetaIfAbsent in class GridCacheEntryImpl<K,V>V1 - Type of the value.name - Metadata name.c - Factory closure to produce value to add if it's not attached already.
Not that unlike GridMetadataAware.addMeta(String, Object) method the factory closure will
not be called unless the value is required and therefore value will only be created
when it is actually needed.null if new value was put, or current value if put didn't happen.public <V1> V1 putMetaIfAbsent(String name, V1 val)
putMetaIfAbsent in interface GridMetadataAwareputMetaIfAbsent in class GridCacheEntryImpl<K,V>V1 - Type of the value.name - Metadata name.val - Value to add if it's not attached already.null if new value was put, or current value if put didn't happen.public <V1> V1 removeMeta(String name)
removeMeta in interface GridMetadataAwareremoveMeta in class GridCacheEntryImpl<K,V>V1 - Type of the value.name - Name of the metadata to remove.null.public <V1> boolean removeMeta(String name, V1 val)
val passed in.removeMeta in interface GridMetadataAwareremoveMeta in class GridCacheEntryImpl<K,V>V1 - Value type.name - Name of metadata attribute.val - Value to compare.True if value was removed, false otherwise.public <V1> boolean replaceMeta(String name, V1 curVal, V1 newVal)
newVal value only if its current value
is equal to curVal. Otherwise, it is no-op.replaceMeta in interface GridMetadataAwarereplaceMeta in class GridCacheEntryImpl<K,V>name - Name of the metadata.curVal - Current value to check.newVal - New value.true if replacement occurred, false otherwise.public void copyMeta(Map<String,?> data)
copyMeta in interface GridMetadataAwarecopyMeta in class GridCacheEntryImpl<K,V>data - Map to copy metadata from.public void copyMeta(GridMetadataAware from)
copyMeta in interface GridMetadataAwarecopyMeta in class GridCacheEntryImpl<K,V>from - Metadata aware instance to copy metadata from.public String toString()
toString in class GridCacheEntryImpl<K,V>Copyright © 2014. All rights reserved.