Class CacheContinuousQueryManager<K,V>
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.GridCacheManagerAdapter<K,V>
-
- org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryManager<K,V>
-
- All Implemented Interfaces:
GridCacheManager<K,V>
public class CacheContinuousQueryManager<K,V> extends GridCacheManagerAdapter<K,V>
Continuous queries manager.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCacheContinuousQueryManager.CacheEntryEventImplprotected static classCacheContinuousQueryManager.JCacheQueryRemoteFilterFor handler version 2.0 this filter should not be serialized.
-
Field Summary
-
Fields inherited from class org.apache.ignite.internal.processors.cache.GridCacheManagerAdapter
cctx, log, starting
-
-
Constructor Summary
Constructors Constructor Description CacheContinuousQueryManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancelInternalQuery(UUID routineId)voidcancelJCacheQuery(javax.cache.configuration.CacheEntryListenerConfiguration cfg)voidcloseBackupUpdateCountersGaps(GridCacheContext cctx, int part, AffinityTopologyVersion topVer, GridLongList gaps)For cache updates in shared cache group need notify others caches CQ listeners that generated counter should be skipped.UUIDexecuteInternalQuery(javax.cache.event.CacheEntryUpdatedListener<?,?> locLsnr, CacheEntryEventSerializableFilter rmtFilter, boolean loc, boolean notifyExisting, boolean ignoreClassNotFound, boolean sync)voidexecuteJCacheQuery(javax.cache.configuration.CacheEntryListenerConfiguration cfg, boolean onStart, boolean keepBinary)UUIDexecuteQuery(@Nullable javax.cache.event.CacheEntryUpdatedListener locLsnr, @Nullable ContinuousQueryWithTransformer.EventListener locTransLsnr, @Nullable CacheEntryEventSerializableFilter<K,V> rmtFilter, @Nullable javax.cache.configuration.Factory<javax.cache.event.CacheEntryEventFilter<K,V>> rmtFilterFactory, @Nullable javax.cache.configuration.Factory<IgniteClosure<K,V>> rmtTransFactory, int bufSize, long timeInterval, boolean autoUnsubscribe, boolean loc, boolean keepBinary, boolean includeExpired)Iterable<javax.cache.event.CacheEntryEvent<?,?>>existingEntries(boolean keepBinary, javax.cache.event.CacheEntryEventFilter filter)voidflushOnExchangeDone(AffinityTopologyVersion topVer)protected GridTimeoutProcessor.CancelableTaskgetCancelableTask()USED ONLY FOR TESTING.voidonEntryExpired(GridCacheEntryEx e, KeyCacheObject key, CacheObject oldVal)voidonEntryUpdated(Map<UUID,CacheContinuousQueryListener> lsnrCol, KeyCacheObject key, CacheObject newVal, CacheObject oldVal, boolean internal, int partId, boolean primary, boolean preload, long updateCntr, @Nullable GridDhtAtomicAbstractUpdateFuture fut, AffinityTopologyVersion topVer)voidonEntryUpdated(KeyCacheObject key, CacheObject newVal, CacheObject oldVal, boolean internal, int partId, boolean primary, boolean preload, long updateCntr, @Nullable GridDhtAtomicAbstractUpdateFuture fut, AffinityTopologyVersion topVer)protected voidonKernalStart0()protected voidonKernalStop0(boolean cancel)voidonPartitionEvicted(int part)Partition evicted callback.@Nullable CounterSkipContextskipUpdateCounter(@Nullable CounterSkipContext skipCtx, int part, long cntr, AffinityTopologyVersion topVer, boolean primary)protected voidstart0()protected voidstop0(boolean cancel, boolean destroy)@Nullable Map<UUID,CacheContinuousQueryListener>updateListeners(boolean internal, boolean preload)-
Methods inherited from class org.apache.ignite.internal.processors.cache.GridCacheManagerAdapter
context, kernalStartInfo, kernalStopInfo, log, onDisconnected, onKernalStart, onKernalStop, printMemoryStats, start, startInfo, stop, stopInfo, toString
-
-
-
-
Method Detail
-
stop0
protected void stop0(boolean cancel, boolean destroy)- Overrides:
stop0in classGridCacheManagerAdapter<K,V>- Parameters:
cancel- Cancel flag.destroy- Cache destroy flag.
-
getCancelableTask
protected GridTimeoutProcessor.CancelableTask getCancelableTask()
USED ONLY FOR TESTING.- Returns:
- Internal cancelable future task for backup cleaner.
-
start0
protected void start0() throws IgniteCheckedException- Overrides:
start0in classGridCacheManagerAdapter<K,V>- Throws:
IgniteCheckedException- If failed.
-
onKernalStart0
protected void onKernalStart0() throws IgniteCheckedException- Overrides:
onKernalStart0in classGridCacheManagerAdapter<K,V>- Throws:
IgniteCheckedException- If failed.
-
onKernalStop0
protected void onKernalStop0(boolean cancel)
- Overrides:
onKernalStop0in classGridCacheManagerAdapter<K,V>- Parameters:
cancel- Cancel flag.
-
skipUpdateCounter
@Nullable public @Nullable CounterSkipContext skipUpdateCounter(@Nullable @Nullable CounterSkipContext skipCtx, int part, long cntr, AffinityTopologyVersion topVer, boolean primary)
- Parameters:
skipCtx- Context.part- Partition number.cntr- Update counter.topVer- Topology version.- Returns:
- Context.
-
closeBackupUpdateCountersGaps
@Nullable public void closeBackupUpdateCountersGaps(GridCacheContext cctx, int part, AffinityTopologyVersion topVer, GridLongList gaps)
For cache updates in shared cache group need notify others caches CQ listeners that generated counter should be skipped.- Parameters:
cctx- Cache context.part- Partition.topVer- Topology version.gaps- Even-length array of pairs [start, end] for each gap.
-
updateListeners
@Nullable public @Nullable Map<UUID,CacheContinuousQueryListener> updateListeners(boolean internal, boolean preload)
- Parameters:
internal- Internal entry flag (internal key or not user cache).preload- Whether update happened during preloading.- Returns:
- Registered listeners.
-
onEntryUpdated
public void onEntryUpdated(KeyCacheObject key, CacheObject newVal, CacheObject oldVal, boolean internal, int partId, boolean primary, boolean preload, long updateCntr, @Nullable @Nullable GridDhtAtomicAbstractUpdateFuture fut, AffinityTopologyVersion topVer) throws IgniteCheckedException
- Parameters:
key- Key.newVal- New value.oldVal- Old value.internal- Internal entry (internal key or not user cache).partId- Partition.primary-Trueif called on primary node.preload- Whether update happened during preloading.updateCntr- Update counter.fut- Dht atomic future.topVer- Topology version.- Throws:
IgniteCheckedException- In case of error.
-
onEntryUpdated
public void onEntryUpdated(Map<UUID,CacheContinuousQueryListener> lsnrCol, KeyCacheObject key, CacheObject newVal, CacheObject oldVal, boolean internal, int partId, boolean primary, boolean preload, long updateCntr, @Nullable @Nullable GridDhtAtomicAbstractUpdateFuture fut, AffinityTopologyVersion topVer) throws IgniteCheckedException
- Parameters:
lsnrCol- Listeners to notify.key- Key.newVal- New value.oldVal- Old value.internal- Internal entry (internal key or not user cache),partId- Partition.primary-Trueif called on primary node.preload- Whether update happened during preloading.updateCntr- Update counter.topVer- Topology version.fut- Dht atomic future.- Throws:
IgniteCheckedException- In case of error.
-
onEntryExpired
public void onEntryExpired(GridCacheEntryEx e, KeyCacheObject key, CacheObject oldVal) throws IgniteCheckedException
- Parameters:
e- Entry.key- Key.oldVal- Old value.- Throws:
IgniteCheckedException- In case of error.
-
executeQuery
public UUID executeQuery(@Nullable @Nullable javax.cache.event.CacheEntryUpdatedListener locLsnr, @Nullable @Nullable ContinuousQueryWithTransformer.EventListener locTransLsnr, @Nullable @Nullable CacheEntryEventSerializableFilter<K,V> rmtFilter, @Nullable @Nullable javax.cache.configuration.Factory<javax.cache.event.CacheEntryEventFilter<K,V>> rmtFilterFactory, @Nullable @Nullable javax.cache.configuration.Factory<IgniteClosure<K,V>> rmtTransFactory, int bufSize, long timeInterval, boolean autoUnsubscribe, boolean loc, boolean keepBinary, boolean includeExpired) throws IgniteCheckedException
- Parameters:
locLsnr- Local listener.rmtFilter- Remote filter.rmtFilterFactory- Remote filter factorybufSize- Buffer size.timeInterval- Time interval.autoUnsubscribe- Auto unsubscribe flag.loc- Local flag.- Returns:
- Continuous routine ID.
- Throws:
IgniteCheckedException- In case of error.
-
executeInternalQuery
public UUID executeInternalQuery(javax.cache.event.CacheEntryUpdatedListener<?,?> locLsnr, CacheEntryEventSerializableFilter rmtFilter, boolean loc, boolean notifyExisting, boolean ignoreClassNotFound, boolean sync) throws IgniteCheckedException
- Parameters:
locLsnr- Local listener.rmtFilter- Remote filter.loc- Local flag.notifyExisting- Notify existing flag.sync- Synchronous flag.- Returns:
- Continuous routine ID.
- Throws:
IgniteCheckedException- In case of error.
-
cancelInternalQuery
public void cancelInternalQuery(UUID routineId)
- Parameters:
routineId- Consume ID.
-
executeJCacheQuery
public void executeJCacheQuery(javax.cache.configuration.CacheEntryListenerConfiguration cfg, boolean onStart, boolean keepBinary) throws IgniteCheckedException- Parameters:
cfg- Listener configuration.onStart- Whether listener is created on node start.- Throws:
IgniteCheckedException- If failed.
-
cancelJCacheQuery
public void cancelJCacheQuery(javax.cache.configuration.CacheEntryListenerConfiguration cfg) throws IgniteCheckedException- Parameters:
cfg- Listener configuration.- Throws:
IgniteCheckedException- In case of error.
-
flushOnExchangeDone
public void flushOnExchangeDone(AffinityTopologyVersion topVer)
- Parameters:
topVer- Finished exchange topology version.
-
onPartitionEvicted
public void onPartitionEvicted(int part)
Partition evicted callback.- Parameters:
part- Partition number.
-
existingEntries
public Iterable<javax.cache.event.CacheEntryEvent<?,?>> existingEntries(boolean keepBinary, javax.cache.event.CacheEntryEventFilter filter) throws IgniteCheckedException
- Parameters:
keepBinary- Keep binary flag.filter- Filter.- Returns:
- Iterable for events created for existing cache entries.
- Throws:
IgniteCheckedException- If failed.
-
-