public final class NullQueryCache extends Object implements InternalQueryCache
InternalQueryCache
implementation.Modifier and Type | Field and Description |
---|---|
static InternalQueryCache |
NULL_QUERY_CACHE
Null query cache implementation.
|
Modifier and Type | Method and Description |
---|---|
String |
addEntryListener(MapListener listener,
boolean includeValue) |
String |
addEntryListener(MapListener listener,
Object key,
boolean includeValue) |
String |
addEntryListener(MapListener listener,
Predicate predicate,
boolean includeValue) |
String |
addEntryListener(MapListener listener,
Predicate predicate,
Object key,
boolean includeValue) |
void |
addIndex(String attribute,
boolean ordered) |
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
void |
delete(Object key,
EntryEventType eventType) |
void |
destroy()
Destroys this cache.
|
Set<Map.Entry> |
entrySet() |
Set<Map.Entry> |
entrySet(Predicate predicate) |
Object |
get(Object key) |
Map |
getAll(Set keys) |
String |
getCacheId() |
IMap |
getDelegate() |
Extractors |
getExtractors() |
Indexes |
getIndexes() |
String |
getName()
Returns the name of this
QueryCache . |
String |
getPublisherListenerId() |
boolean |
isEmpty() |
Set |
keySet() |
Set |
keySet(Predicate predicate) |
void |
prepopulate(Object key,
Object value)
Used during initial population of query cache.
|
boolean |
reachedMaxCapacity()
Used to quit pre-population when max size is reached.
|
void |
recreate()
Recreates this query cache.
|
int |
removeEntriesOf(int partitionId)
Scans all entries in this
QueryCache to remove matching ones
with supplied partitionId |
boolean |
removeEntryListener(String id) |
void |
set(Object key,
Object value,
EntryEventType eventType) |
void |
setPublisherListenerId(String publisherListenerId) |
int |
size() |
boolean |
tryRecover()
This method can be used to recover from a possible event loss situation.
|
Collection |
values() |
Collection |
values(Predicate predicate) |
public static final InternalQueryCache NULL_QUERY_CACHE
public void set(Object key, Object value, EntryEventType eventType)
set
in interface InternalQueryCache
public void prepopulate(Object key, Object value)
InternalQueryCache
prepopulate
in interface InternalQueryCache
public void delete(Object key, EntryEventType eventType)
delete
in interface InternalQueryCache
public int removeEntriesOf(int partitionId)
InternalQueryCache
QueryCache
to remove matching ones
with supplied partitionId
removeEntriesOf
in interface InternalQueryCache
public IMap getDelegate()
getDelegate
in interface InternalQueryCache
public Indexes getIndexes()
getIndexes
in interface InternalQueryCache
public void clear()
clear
in interface InternalQueryCache
public void setPublisherListenerId(String publisherListenerId)
setPublisherListenerId
in interface InternalQueryCache
public String getPublisherListenerId()
getPublisherListenerId
in interface InternalQueryCache
public String getCacheId()
getCacheId
in interface InternalQueryCache
public boolean reachedMaxCapacity()
InternalQueryCache
reachedMaxCapacity
in interface InternalQueryCache
true
if this query cache is at its max capacity,
otherwise return false
QueryCacheConfig.isPopulate()
public Extractors getExtractors()
getExtractors
in interface InternalQueryCache
public void recreate()
InternalQueryCache
recreate
in interface InternalQueryCache
public Object get(Object key)
get
in interface QueryCache
IMap.get(Object)
public boolean containsKey(Object key)
containsKey
in interface QueryCache
IMap.containsKey(Object)
public boolean containsValue(Object value)
containsValue
in interface QueryCache
IMap.containsValue(Object)
public boolean isEmpty()
isEmpty
in interface QueryCache
Map.isEmpty()
public int size()
size
in interface QueryCache
Map.size()
public void addIndex(String attribute, boolean ordered)
addIndex
in interface QueryCache
IMap.addIndex(String, boolean)
public Map getAll(Set keys)
getAll
in interface QueryCache
IMap.getAll(Set)
public Set keySet()
keySet
in interface QueryCache
IMap.keySet()
public Set keySet(Predicate predicate)
keySet
in interface QueryCache
IMap.keySet(Predicate)
public Set<Map.Entry> entrySet()
entrySet
in interface QueryCache
IMap.entrySet()
public Set<Map.Entry> entrySet(Predicate predicate)
entrySet
in interface QueryCache
IMap.entrySet(Predicate)
public Collection values()
values
in interface QueryCache
IMap.values()
public Collection values(Predicate predicate)
values
in interface QueryCache
IMap.values(Predicate)
public String addEntryListener(MapListener listener, boolean includeValue)
addEntryListener
in interface QueryCache
IMap.addEntryListener(MapListener, boolean)
public String addEntryListener(MapListener listener, Object key, boolean includeValue)
addEntryListener
in interface QueryCache
IMap.addEntryListener(MapListener, Object, boolean)
public String addEntryListener(MapListener listener, Predicate predicate, boolean includeValue)
addEntryListener
in interface QueryCache
IMap.addEntryListener(MapListener, Predicate, boolean)
public String addEntryListener(MapListener listener, Predicate predicate, Object key, boolean includeValue)
addEntryListener
in interface QueryCache
IMap.addEntryListener(MapListener, Predicate, Object, boolean)
public boolean removeEntryListener(String id)
removeEntryListener
in interface QueryCache
IMap.removeEntryListener(String)
public String getName()
QueryCache
QueryCache
. The returned value will never be null.getName
in interface QueryCache
QueryCache
.public boolean tryRecover()
QueryCache
EventLostListener
This method tries to make consistent the data in this QueryCache
with the data in the underlying IMap
by replaying the events after last consistently received ones. As a result of this replaying logic, same event may
appear more than once to the QueryCache
listeners.
This method returns false
if the event is not in the buffer of event publisher side. That means recovery is not
possible.tryRecover
in interface QueryCache
true
if the QueryCache
content will be eventually consistent, otherwise false
.QueryCacheConfig.bufferSize
public void destroy()
QueryCache
destroy
in interface QueryCache
Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.