public class PublisherQueueContainer extends Object
| Constructor and Description |
|---|
PublisherQueueContainer(com.hazelcast.instance.Node node) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears all WAN queues in all containers.
|
int |
drainCacheQueues(int partitionId)
Drains all the cache queues maintained for the given partition.
|
int |
drainMapQueues(int partitionId)
Drains all the map queues maintained for the given partition.
|
Map<Integer,Integer> |
drainQueues()
Drains all the queues stored in this container and returns the
total of the drained elements in a map, per partition.
|
int |
drainQueues(int partitionId)
Drains all the queues maintained for the given partition.
|
void |
drainRandomWanQueue(int partitionId,
Collection<com.hazelcast.wan.WanReplicationEvent> drainTo,
int elementsToDrain)
Removes at most the given number of available elements from a random WAN
queue and for the given partition and adds them to the given collection.
|
PartitionWanEventContainer[] |
getContainers()
Returns all of the partition WAN event queue containers.
|
PartitionWanEventContainer |
getEventQueue(int partitionId)
Returns the
PartitionWanEventContainer for the specified
partitionId. |
com.hazelcast.wan.WanReplicationEvent |
pollCacheWanEvent(String nameWithPrefix,
int partitionId)
Polls the wan event queue for the cache with the name
nameWithPrefix on partition partitionId. |
com.hazelcast.wan.WanReplicationEvent |
pollMapWanEvent(String mapName,
int partitionId)
Polls the wan event queue for the map with the name
mapName on
partition partitionId. |
boolean |
publishCacheWanEvent(String nameWithPrefix,
int partitionId,
com.hazelcast.wan.WanReplicationEvent replicationEvent)
Publishes the
replicationEvent for the cache with the name
nameWithPrefix on the partition partitionId. |
boolean |
publishMapWanEvent(String mapName,
int partitionId,
com.hazelcast.wan.WanReplicationEvent replicationEvent)
Publishes the
replicationEvent for the given mapName
map on the partition partitionId |
int |
size(int partitionId)
Returns the size of all WAN queues for the given
partitionId. |
public PublisherQueueContainer(com.hazelcast.instance.Node node)
public com.hazelcast.wan.WanReplicationEvent pollCacheWanEvent(String nameWithPrefix, int partitionId)
nameWithPrefix on partition partitionId.nameWithPrefix - the cache namepartitionId - the partition of the wan eventpublic boolean publishCacheWanEvent(String nameWithPrefix, int partitionId, com.hazelcast.wan.WanReplicationEvent replicationEvent)
replicationEvent for the cache with the name
nameWithPrefix on the partition partitionId.nameWithPrefix - the cache namepartitionId - the partition ID for the published eventreplicationEvent - the published replication eventtrue if the element was added to this queue, else falsepublic com.hazelcast.wan.WanReplicationEvent pollMapWanEvent(String mapName, int partitionId)
mapName on
partition partitionId.mapName - the map namepartitionId - the partition of the wan eventpublic boolean publishMapWanEvent(String mapName, int partitionId, com.hazelcast.wan.WanReplicationEvent replicationEvent)
replicationEvent for the given mapName
map on the partition partitionIdmapName - the name of the map for which the event is
publishedpartitionId - the partition ID for the published eventreplicationEvent - the published replication eventtrue if the element was added to this queue, else
falsepublic void drainRandomWanQueue(int partitionId,
Collection<com.hazelcast.wan.WanReplicationEvent> drainTo,
int elementsToDrain)
partitionId - the partition ID for which a random WAN queue should be draineddrainTo - the collection to which to drain events toelementsToDrain - the maximum number of events to drainpublic PartitionWanEventContainer getEventQueue(int partitionId)
PartitionWanEventContainer for the specified
partitionId.partitionId - the partition ID for the WAN event containerpublic int size(int partitionId)
partitionId.partitionId - the partition IDpublic Map<Integer,Integer> drainQueues()
public int drainQueues(int partitionId)
partitionId - the partition ID for which queues need to be drainedpublic int drainMapQueues(int partitionId)
partitionId - the partition ID for which queues need to be drainedpublic int drainCacheQueues(int partitionId)
partitionId - the partition ID for which queues need to be drainedpublic PartitionWanEventContainer[] getContainers()
public void clear()
Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.