public class CommandAckCollector extends Object
Acknowledges are used between the owners and the originator. They signal the completion of a write operation. The operation can complete successfully or not.
The acknowledges are valid on the same cache topology id. So, each acknowledge is tagged with the command topology id. Acknowledges from previous topology id are discarded.
The acknowledges from the primary owner carry the return value of the operation.
Modifier and Type | Class and Description |
---|---|
static interface |
CommandAckCollector.MultiTargetCollector |
Constructor and Description |
---|
CommandAckCollector() |
Modifier and Type | Method and Description |
---|---|
void |
backupAck(long id,
Address from,
int topologyId)
Acknowledges a write operation completion in the backup owner.
|
void |
completeExceptionally(long id,
Throwable throwable,
int topologyId)
Acknowledges an exception during the operation execution.
|
<T> Collector<T> |
create(long id,
Collection<Address> backupOwners,
int topologyId)
Creates a collector for a single key write operation.
|
BiasedCollector |
createBiased(long id,
int topologyId) |
CommandAckCollector.MultiTargetCollector |
createMultiTargetCollector(long id,
int primaries,
int topologyId) |
<T> Collector<T> |
createSegmentBasedCollector(long id,
Map<Address,Collection<Integer>> backups,
int topologyId)
Creates a collector for
PutMapCommand . |
List<Long> |
getPendingCommands() |
boolean |
hasPendingBackupAcks(long id) |
void |
multiKeyBackupAck(long id,
Address from,
int segment,
int topologyId)
Acknowledges a
PutMapCommand completion in the backup owner. |
void |
onMembersChange(Collection<Address> members)
Notifies a change in member list.
|
void |
start() |
public void start()
public <T> Collector<T> create(long id, Collection<Address> backupOwners, int topologyId)
id
- the id from CommandInvocationId
.backupOwners
- the backup owners of the key.topologyId
- the current topology id.public BiasedCollector createBiased(long id, int topologyId)
public CommandAckCollector.MultiTargetCollector createMultiTargetCollector(long id, int primaries, int topologyId)
public <T> Collector<T> createSegmentBasedCollector(long id, Map<Address,Collection<Integer>> backups, int topologyId)
PutMapCommand
.id
- the id from CommandInvocationId.getId()
.backups
- a map between a backup owner and its segments affected.topologyId
- the current topology id.public void multiKeyBackupAck(long id, Address from, int segment, int topologyId)
PutMapCommand
completion in the backup owner.id
- the id from CommandInvocationId.getId()
.from
- the backup owner.segment
- the segments affected and acknowledged.topologyId
- the topology id.public void backupAck(long id, Address from, int topologyId)
id
- the id from CommandInvocationId.getId()
.from
- the backup owner.topologyId
- the topology id.public void completeExceptionally(long id, Throwable throwable, int topologyId)
The collector is completed without waiting any further acknowledges.
id
- the id from CommandInvocationId.getId()
.throwable
- the Throwable
.topologyId
- the topology id.public List<Long> getPendingCommands()
CommandInvocationId.getId()
(testing purposes only)public boolean hasPendingBackupAcks(long id)
id
- the id from CommandInvocationId.getId()
.true
if there are acknowledges pending from the backup owners, false
otherwise. (testing
purposes only)public void onMembersChange(Collection<Address> members)
members
- the new cluster members.Copyright © 2021 JBoss by Red Hat. All rights reserved.