public class

AtomicParticipantAccessor

extends ParticipantAccessor
java.lang.Object
   ↳ org.apache.helix.api.accessor.ParticipantAccessor
     ↳ org.apache.helix.api.accessor.AtomicParticipantAccessor

Class Overview

An atomic version of the ParticipantAccessor. If atomic operations are required, use instances of this class. Atomicity is not guaranteed when using instances of ParticipantAccessor alongside instances of this class. Furthermore, depending on the semantics of the lock, lock acquisition may fail, in which case users should handle the return value of each function if necessary.

Using this class is quite expensive; it should thus be used sparingly and only in systems where contention on these operations is expected. For most systems running Helix, this is typically not the case.

Summary

Public Constructors
AtomicParticipantAccessor(ClusterId clusterId, HelixDataAccessor accessor, HelixLockable lockProvider)
Instantiate the accessor
Public Methods
void deleteMessagesFromParticipant(ParticipantId participantId, Set<MessageId> msgIdSet)
delete messages from participant
void initParticipantStructure(ParticipantId participantId)
Create empty persistent properties to ensure that there is a valid participant structure
void insertMessagesToParticipant(ParticipantId participantId, Map<MessageIdMessage> msgMap)
create messages for participant
Participant readParticipant(ParticipantId participantId)
read participant related data
boolean setParticipant(ParticipantConfig participantConfig)
Set the configuration of an existing participant
void updateMessageStatus(ParticipantId participantId, Map<MessageIdMessage> msgMap)
set messages of participant
ParticipantConfig updateParticipant(ParticipantId participantId, ParticipantConfig.Delta participantDelta)
Update a participant configuration
Protected Methods
ResourceAccessor resourceAccessor()
Get a ResourceAccessor instance
[Expand]
Inherited Methods
From class org.apache.helix.api.accessor.ParticipantAccessor
From class java.lang.Object

Public Constructors

public AtomicParticipantAccessor (ClusterId clusterId, HelixDataAccessor accessor, HelixLockable lockProvider)

Instantiate the accessor

Parameters
clusterId the cluster to access
accessor a HelixDataAccessor for the physical properties
lockProvider a lock provider

Public Methods

public void deleteMessagesFromParticipant (ParticipantId participantId, Set<MessageId> msgIdSet)

delete messages from participant

public void initParticipantStructure (ParticipantId participantId)

Create empty persistent properties to ensure that there is a valid participant structure

public void insertMessagesToParticipant (ParticipantId participantId, Map<MessageIdMessage> msgMap)

create messages for participant

Parameters
msgMap map of message-id to message

public Participant readParticipant (ParticipantId participantId)

read participant related data

Returns
  • participant, or null if participant not available

public boolean setParticipant (ParticipantConfig participantConfig)

Set the configuration of an existing participant

Parameters
participantConfig participant configuration
Returns
  • true if config was set, false if there was an error

public void updateMessageStatus (ParticipantId participantId, Map<MessageIdMessage> msgMap)

set messages of participant

Parameters
msgMap map of message-id to message

public ParticipantConfig updateParticipant (ParticipantId participantId, ParticipantConfig.Delta participantDelta)

Update a participant configuration

Parameters
participantId the participant to update
participantDelta changes to the participant
Returns
  • ParticipantConfig, or null if participant is not persisted

Protected Methods

protected ResourceAccessor resourceAccessor ()

Get a ResourceAccessor instance

Returns
  • ResourceAccessor