public class CacheContinuousQueryHandler<K,V> extends Object implements GridContinuousHandler
GridContinuousHandler.RegisterStatus
Modifier and Type | Field and Description |
---|---|
static int |
DFLT_CONTINUOUS_QUERY_BACKUP_ACK_THRESHOLD |
static int |
DFLT_CONTINUOUS_QUERY_LISTENER_MAX_BUFFER_SIZE |
static String |
IGNITE_CONTINUOUS_QUERY_BACKUP_ACK_THRESHOLD |
static String |
IGNITE_CONTINUOUS_QUERY_LISTENER_MAX_BUFFER_SIZE |
protected IgniteInternalFuture<Void> |
initFut
Initialization future.
|
protected IgniteInternalFuture<Void> |
p2pUnmarshalFut
P2P unmarshalling future.
|
Constructor and Description |
---|
CacheContinuousQueryHandler()
Required by
Externalizable . |
CacheContinuousQueryHandler(String cacheName,
Object topic,
@Nullable javax.cache.event.CacheEntryUpdatedListener<K,V> locLsnr,
@Nullable CacheEntryEventSerializableFilter<K,V> rmtFilter,
boolean oldValRequired,
boolean sync,
boolean ignoreExpired,
boolean ignoreClsNotFound)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
cacheName() |
GridContinuousHandler |
clone()
Clones this handler.
|
GridContinuousBatch |
createBatch()
Creates new batch.
|
boolean |
filter(org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryEvent evt) |
void |
flushOnNodeLeft()
Node which started routine leave topology.
|
javax.cache.event.CacheEntryEventFilter |
getEventFilter() |
protected javax.cache.event.CacheEntryEventFilter |
getEventFilter0()
Returns an event filter without waiting on the unmarshalling future.
|
@Nullable IgniteClosure<javax.cache.event.CacheEntryEvent<? extends K,? extends V>,?> |
getTransformer() |
protected void |
initRemoteFilter(javax.cache.event.CacheEntryEventFilter filter,
GridKernalContext ctx)
Performs resource injection and checks asynchrony for the provided remote filter.
|
void |
internal(boolean internal) |
boolean |
isEvents() |
boolean |
isMarshalled() |
boolean |
isMessaging() |
boolean |
isQuery() |
boolean |
keepBinary() |
void |
keepBinary(boolean keepBinary) |
javax.cache.event.CacheEntryUpdatedListener<K,V> |
localListener() |
boolean |
localOnly() |
void |
localOnly(boolean locOnly) |
@Nullable ContinuousQueryWithTransformer.EventListener<?> |
localTransformedEventListener() |
void |
notifyCallback(UUID nodeId,
UUID routineId,
Collection<?> objs,
GridKernalContext ctx)
Notifies local callback.
|
boolean |
notifyExisting() |
void |
notifyExisting(boolean notifyExisting) |
boolean |
oldValueRequired() |
void |
onBatchAcknowledged(UUID routineId,
GridContinuousBatch batch,
GridKernalContext ctx)
Called when ack for a batch is received from client.
|
void |
onClientDisconnected()
Client node disconnected callback.
|
@Nullable Object |
orderedTopic() |
void |
p2pMarshal(GridKernalContext ctx)
Deploys and marshals inner objects (called only if peer deployment is enabled).
|
protected <T> T |
p2pUnmarshal(org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryDeployableObject depObj,
UUID nodeId,
GridKernalContext ctx) |
void |
p2pUnmarshal(UUID nodeId,
GridKernalContext ctx)
Unmarshals inner objects (called only if peer deployment is enabled).
|
void |
readExternal(ObjectInput in) |
GridContinuousHandler.RegisterStatus |
register(UUID nodeId,
UUID routineId,
GridKernalContext ctx)
Registers listener.
|
void |
skipPrimaryCheck(boolean skipPrimaryCheck) |
void |
taskNameHash(int taskHash) |
String |
toString() |
void |
unregister(UUID routineId,
GridKernalContext ctx)
Unregisters listener.
|
Map<Integer,T2<Long,Long>> |
updateCounters() |
void |
updateCounters(AffinityTopologyVersion topVer,
Map<UUID,Map<Integer,T2<Long,Long>>> cntrsPerNode,
Map<Integer,T2<Long,Long>> cntrs) |
void |
writeExternal(ObjectOutput out) |
public static final int DFLT_CONTINUOUS_QUERY_BACKUP_ACK_THRESHOLD
public static final int DFLT_CONTINUOUS_QUERY_LISTENER_MAX_BUFFER_SIZE
@SystemProperty(value="The size of the buffer with acknowledgment events that are sent to backup nodes", type=java.lang.Long.class, defaults="100") public static final String IGNITE_CONTINUOUS_QUERY_BACKUP_ACK_THRESHOLD
@SystemProperty(value="The maximum size of the continuous query listener buffer. 10% of events are dropped once the buffer is full", type=java.lang.Long.class, defaults="10000") public static final String IGNITE_CONTINUOUS_QUERY_LISTENER_MAX_BUFFER_SIZE
protected transient IgniteInternalFuture<Void> p2pUnmarshalFut
protected transient IgniteInternalFuture<Void> initFut
public CacheContinuousQueryHandler()
Externalizable
.public CacheContinuousQueryHandler(String cacheName, Object topic, @Nullable @Nullable javax.cache.event.CacheEntryUpdatedListener<K,V> locLsnr, @Nullable @Nullable CacheEntryEventSerializableFilter<K,V> rmtFilter, boolean oldValRequired, boolean sync, boolean ignoreExpired, boolean ignoreClsNotFound)
cacheName
- Cache name.topic
- Topic for ordered messages.locLsnr
- Local listener.rmtFilter
- Remote filter.oldValRequired
- Old value required flag.sync
- Synchronous flag.ignoreExpired
- Ignore expired events flag.public void internal(boolean internal)
internal
- Internal query.public void notifyExisting(boolean notifyExisting)
notifyExisting
- Notify existing.public boolean notifyExisting()
True
if handler should obtain existing entries,false
otherwise.public boolean oldValueRequired()
True
if old value required for handler, false
otherwise.public javax.cache.event.CacheEntryUpdatedListener<K,V> localListener()
public void localOnly(boolean locOnly)
locOnly
- Local only.public boolean localOnly()
True
if handler are local only, false
otherwise.public void taskNameHash(int taskHash)
taskHash
- Task hash.public void skipPrimaryCheck(boolean skipPrimaryCheck)
skipPrimaryCheck
- Whether to skip primary check for REPLICATED cache.public boolean isEvents()
isEvents
in interface GridContinuousHandler
True
if for events.public boolean isMessaging()
isMessaging
in interface GridContinuousHandler
True
if for messaging.public boolean isQuery()
isQuery
in interface GridContinuousHandler
True
if for continuous queries.public boolean keepBinary()
keepBinary
in interface GridContinuousHandler
True
if Ignite Binary objects should be passed to the listener and filter.public void keepBinary(boolean keepBinary)
keepBinary
- Keep binary flag.public String cacheName()
cacheName
in interface GridContinuousHandler
public void updateCounters(AffinityTopologyVersion topVer, Map<UUID,Map<Integer,T2<Long,Long>>> cntrsPerNode, Map<Integer,T2<Long,Long>> cntrs)
updateCounters
in interface GridContinuousHandler
topVer
- Topology version.cntrsPerNode
- Init state partition counters for node.cntrs
- Init state for partition counters.public Map<Integer,T2<Long,Long>> updateCounters()
updateCounters
in interface GridContinuousHandler
public GridContinuousHandler.RegisterStatus register(UUID nodeId, UUID routineId, GridKernalContext ctx) throws IgniteCheckedException
register
in interface GridContinuousHandler
nodeId
- ID of the node that started routine.routineId
- Routine ID.ctx
- Kernal context.IgniteCheckedException
- In case of error.protected void initRemoteFilter(javax.cache.event.CacheEntryEventFilter filter, GridKernalContext ctx) throws IgniteCheckedException
filter
- Remote filter.ctx
- Kernal context.IgniteCheckedException
- If failed to perform resource injection.public javax.cache.event.CacheEntryEventFilter getEventFilter() throws IgniteCheckedException
IgniteCheckedException
- If P2P unmarshalling failed.protected javax.cache.event.CacheEntryEventFilter getEventFilter0()
@Nullable public @Nullable IgniteClosure<javax.cache.event.CacheEntryEvent<? extends K,? extends V>,?> getTransformer()
@Nullable public @Nullable ContinuousQueryWithTransformer.EventListener<?> localTransformedEventListener()
public void unregister(UUID routineId, GridKernalContext ctx)
unregister
in interface GridContinuousHandler
routineId
- Routine ID.ctx
- Kernal context.public void notifyCallback(UUID nodeId, UUID routineId, Collection<?> objs, GridKernalContext ctx)
notifyCallback
in interface GridContinuousHandler
nodeId
- ID of the node where notification came from.routineId
- Routine ID.objs
- Notification objects.ctx
- Kernal context.public boolean filter(org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryEvent evt)
evt
- Query event.True
if event passed filter otherwise false
.public void onClientDisconnected()
onClientDisconnected
in interface GridContinuousHandler
public void flushOnNodeLeft()
flushOnNodeLeft
in interface GridContinuousHandler
public void p2pMarshal(GridKernalContext ctx) throws IgniteCheckedException
p2pMarshal
in interface GridContinuousHandler
ctx
- Kernal context.IgniteCheckedException
- In case of error.public void p2pUnmarshal(UUID nodeId, GridKernalContext ctx) throws IgniteCheckedException
p2pUnmarshal
in interface GridContinuousHandler
nodeId
- Sender node ID.ctx
- Kernal context.IgniteCheckedException
- In case of error.public boolean isMarshalled()
protected <T> T p2pUnmarshal(org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryDeployableObject depObj, UUID nodeId, GridKernalContext ctx) throws IgniteCheckedException
T
- Result type.depObj
- Deployable object to unmarshal.nodeId
- Sender node Id.ctx
- Kernal context.IgniteCheckedException
- In case of unmarshalling failures.public GridContinuousBatch createBatch()
createBatch
in interface GridContinuousHandler
public void onBatchAcknowledged(UUID routineId, GridContinuousBatch batch, GridKernalContext ctx)
onBatchAcknowledged
in interface GridContinuousHandler
routineId
- Routine ID.batch
- Acknowledged batch.ctx
- Kernal context.@Nullable public @Nullable Object orderedTopic()
orderedTopic
in interface GridContinuousHandler
null
, notifications
will be sent in non-ordered messages.public GridContinuousHandler clone()
clone
in interface GridContinuousHandler
clone
in class Object
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.10.0 Release Date : March 10 2021