Package org.apache.ignite.internal
Class GridMessageListenHandler
- java.lang.Object
-
- org.apache.ignite.internal.GridMessageListenHandler
-
- All Implemented Interfaces:
Externalizable,Serializable,Cloneable,GridContinuousHandler
public class GridMessageListenHandler extends Object implements GridContinuousHandler
Continuous handler for message subscription.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.ignite.internal.processors.continuous.GridContinuousHandler
GridContinuousHandler.RegisterStatus
-
-
Constructor Summary
Constructors Constructor Description GridMessageListenHandler()Required byExternalizable.GridMessageListenHandler(@Nullable Object topic, IgniteBiPredicate<UUID,Object> pred)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcacheName()GridContinuousHandlerclone()Clones this handler.GridContinuousBatchcreateBatch()Creates new batch.booleanisEvents()booleanisMessaging()booleanisQuery()booleankeepBinary()voidnotifyCallback(UUID nodeId, UUID routineId, Collection<?> objs, GridKernalContext ctx)Notifies local callback.voidonBatchAcknowledged(UUID routineId, GridContinuousBatch batch, GridKernalContext ctx)Called when ack for a batch is received from client.voidonClientDisconnected()Client node disconnected callback.@Nullable ObjectorderedTopic()voidp2pMarshal(GridKernalContext ctx)Deploys and marshals inner objects (called only if peer deployment is enabled).voidp2pUnmarshal(UUID nodeId, GridKernalContext ctx)Unmarshals inner objects (called only if peer deployment is enabled).voidreadExternal(ObjectInput in)GridContinuousHandler.RegisterStatusregister(UUID nodeId, UUID routineId, GridKernalContext ctx)Registers listener.StringtoString()voidunregister(UUID routineId, GridKernalContext ctx)Unregisters listener.Map<Integer,T2<Long,Long>>updateCounters()voidupdateCounters(AffinityTopologyVersion topVer, Map<UUID,Map<Integer,T2<Long,Long>>> cntrsPerNode, Map<Integer,T2<Long,Long>> cntrs)voidwriteExternal(ObjectOutput out)-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.ignite.internal.processors.continuous.GridContinuousHandler
flushOnNodeLeft
-
-
-
-
Constructor Detail
-
GridMessageListenHandler
public GridMessageListenHandler()
Required byExternalizable.
-
GridMessageListenHandler
public GridMessageListenHandler(@Nullable @Nullable Object topic, IgniteBiPredicate<UUID,Object> pred)- Parameters:
topic- Topic.pred- Predicate.
-
-
Method Detail
-
isEvents
public boolean isEvents()
- Specified by:
isEventsin interfaceGridContinuousHandler- Returns:
Trueif for events.
-
isMessaging
public boolean isMessaging()
- Specified by:
isMessagingin interfaceGridContinuousHandler- Returns:
Trueif for messaging.
-
isQuery
public boolean isQuery()
- Specified by:
isQueryin interfaceGridContinuousHandler- Returns:
Trueif for continuous queries.
-
keepBinary
public boolean keepBinary()
- Specified by:
keepBinaryin interfaceGridContinuousHandler- Returns:
Trueif Ignite Binary objects should be passed to the listener and filter.
-
cacheName
public String cacheName()
- Specified by:
cacheNamein interfaceGridContinuousHandler- Returns:
- Cache name if this is a continuous query handler.
-
updateCounters
public void updateCounters(AffinityTopologyVersion topVer, Map<UUID,Map<Integer,T2<Long,Long>>> cntrsPerNode, Map<Integer,T2<Long,Long>> cntrs)
- Specified by:
updateCountersin interfaceGridContinuousHandler- Parameters:
topVer- Topology version.cntrsPerNode- Init state partition counters for node.cntrs- Init state for partition counters.
-
updateCounters
public Map<Integer,T2<Long,Long>> updateCounters()
- Specified by:
updateCountersin interfaceGridContinuousHandler- Returns:
- Init state for partition counters.
-
register
public GridContinuousHandler.RegisterStatus register(UUID nodeId, UUID routineId, GridKernalContext ctx)
Registers listener.- Specified by:
registerin interfaceGridContinuousHandler- Parameters:
nodeId- ID of the node that started routine.routineId- Routine ID.ctx- Kernal context.- Returns:
- Whether listener was actually registered.
-
unregister
public void unregister(UUID routineId, GridKernalContext ctx)
Unregisters listener.- Specified by:
unregisterin interfaceGridContinuousHandler- Parameters:
routineId- Routine ID.ctx- Kernal context.
-
notifyCallback
public void notifyCallback(UUID nodeId, UUID routineId, Collection<?> objs, GridKernalContext ctx)
Notifies local callback.- Specified by:
notifyCallbackin interfaceGridContinuousHandler- Parameters:
nodeId- ID of the node where notification came from.routineId- Routine ID.objs- Notification objects.ctx- Kernal context.
-
p2pMarshal
public void p2pMarshal(GridKernalContext ctx) throws IgniteCheckedException
Deploys and marshals inner objects (called only if peer deployment is enabled).- Specified by:
p2pMarshalin interfaceGridContinuousHandler- Parameters:
ctx- Kernal context.- Throws:
IgniteCheckedException- In case of error.
-
p2pUnmarshal
public void p2pUnmarshal(UUID nodeId, GridKernalContext ctx) throws IgniteCheckedException
Unmarshals inner objects (called only if peer deployment is enabled).- Specified by:
p2pUnmarshalin interfaceGridContinuousHandler- Parameters:
nodeId- Sender node ID.ctx- Kernal context.- Throws:
IgniteCheckedException- In case of error.
-
createBatch
public GridContinuousBatch createBatch()
Creates new batch.- Specified by:
createBatchin interfaceGridContinuousHandler- Returns:
- New batch.
-
onClientDisconnected
public void onClientDisconnected()
Client node disconnected callback.- Specified by:
onClientDisconnectedin interfaceGridContinuousHandler
-
onBatchAcknowledged
public void onBatchAcknowledged(UUID routineId, GridContinuousBatch batch, GridKernalContext ctx)
Called when ack for a batch is received from client.- Specified by:
onBatchAcknowledgedin interfaceGridContinuousHandler- Parameters:
routineId- Routine ID.batch- Acknowledged batch.ctx- Kernal context.
-
orderedTopic
@Nullable public @Nullable Object orderedTopic()
- Specified by:
orderedTopicin interfaceGridContinuousHandler- Returns:
- Topic for ordered notifications. If
null, notifications will be sent in non-ordered messages.
-
clone
public GridContinuousHandler clone()
Clones this handler.- Specified by:
clonein interfaceGridContinuousHandler- Overrides:
clonein classObject- Returns:
- Clone of this handler.
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
-