public class

ParticipantAccessor

extends Object
java.lang.Object
   ↳ org.apache.helix.api.accessor.ParticipantAccessor
Known Direct Subclasses

Summary

Public Constructors
ParticipantAccessor(HelixDataAccessor accessor)
Public Methods
void deleteMessagesFromParticipant(ParticipantId participantId, Set<MessageId> msgIdSet)
delete messages from participant
boolean disableParticipant(ParticipantId participantId)
disable participant
boolean disablePartitionsForParticipant(ParticipantId participantId, ResourceId resourceId, Set<PartitionId> disablePartitionIdSet)
disable partitions on a participant
boolean dropCurrentState(ResourceId resourceId, ParticipantId participantId, SessionId sessionId)
drop resource current state of a participant
boolean dropUserConfig(ParticipantId participantId)
Clear any user-specified configuration from the participant
boolean enableParticipant(ParticipantId participantId)
enable participant
boolean enablePartitionsForParticipant(ParticipantId participantId, ResourceId resourceId, Set<PartitionId> enablePartitionIdSet)
enable partitions on a 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
boolean isParticipantStructureValid(ParticipantId participantId)
check if participant structure is valid
Participant readParticipant(ParticipantId participantId)
read participant related data
UserConfig readUserConfig(ParticipantId participantId)
Read the user config of the participant
boolean resetParticipants(Set<ParticipantId> resetParticipantIdSet)
Reset partitions assigned to a set of participants
boolean resetPartitionsForParticipant(ParticipantId participantId, ResourceId resourceId, Set<PartitionId> resetPartitionIdSet)
reset partitions on a participant
boolean setParticipant(ParticipantConfig participantConfig)
Set the configuration of an existing participant
boolean setUserConfig(ParticipantId participantId, UserConfig userConfig)
Set the user config of the participant, overwriting existing user configs
boolean swapParticipants(ParticipantId oldParticipantId, ParticipantId newParticipantId)
Let a new participant take the place of an existing participant
void updateCurrentState(ResourceId resourceId, ParticipantId participantId, SessionId sessionId, CurrentState curStateUpdate)
update resource current state of a participant
void updateMessageStatus(ParticipantId participantId, Map<MessageIdMessage> msgMap)
set messages of participant
ParticipantConfig updateParticipant(ParticipantId participantId, ParticipantConfig.Delta participantDelta)
Update a participant configuration
boolean updateUserConfig(ParticipantId participantId, UserConfig userConfig)
Add user configuration to the existing participant user configuration.
Protected Methods
ResourceAccessor resourceAccessor()
Get a ResourceAccessor instance
void swapParticipantsInIdealState(IdealState idealState, ParticipantId oldParticipantId, ParticipantId newParticipantId)
Replace occurrences of participants in preference lists and maps
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ParticipantAccessor (HelixDataAccessor accessor)

Public Methods

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

delete messages from participant

public boolean disableParticipant (ParticipantId participantId)

disable participant

Returns
  • true if disabled successfully, false otherwise

public boolean disablePartitionsForParticipant (ParticipantId participantId, ResourceId resourceId, Set<PartitionId> disablePartitionIdSet)

disable partitions on a participant

Returns
  • true if disabled successfully, false otherwise

public boolean dropCurrentState (ResourceId resourceId, ParticipantId participantId, SessionId sessionId)

drop resource current state of a participant

Parameters
resourceId resource id
participantId participant id
sessionId session id
Returns
  • true if dropped, false otherwise

public boolean dropUserConfig (ParticipantId participantId)

Clear any user-specified configuration from the participant

Parameters
participantId the participant to update
Returns
  • true if the config was cleared, false otherwise

public boolean enableParticipant (ParticipantId participantId)

enable participant

Returns
  • true if enabled successfully, false otherwise

public boolean enablePartitionsForParticipant (ParticipantId participantId, ResourceId resourceId, Set<PartitionId> enablePartitionIdSet)

enable partitions on a participant

Returns
  • true if enabled successfully, false otherwise

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 boolean isParticipantStructureValid (ParticipantId participantId)

check if participant structure is valid

Returns
  • true if valid or false otherwise

public Participant readParticipant (ParticipantId participantId)

read participant related data

Returns
  • participant, or null if participant not available

public UserConfig readUserConfig (ParticipantId participantId)

Read the user config of the participant

Parameters
participantId the participant to to look up
Returns
  • UserConfig, or null

public boolean resetParticipants (Set<ParticipantId> resetParticipantIdSet)

Reset partitions assigned to a set of participants

Parameters
resetParticipantIdSet the participants to reset
Returns
  • true if reset, false otherwise

public boolean resetPartitionsForParticipant (ParticipantId participantId, ResourceId resourceId, Set<PartitionId> resetPartitionIdSet)

reset partitions on a participant

Returns
  • true if partitions reset, false otherwise

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 boolean setUserConfig (ParticipantId participantId, UserConfig userConfig)

Set the user config of the participant, overwriting existing user configs

Parameters
participantId the participant to update
userConfig the new user config
Returns
  • true if the user config was set, false otherwise

public boolean swapParticipants (ParticipantId oldParticipantId, ParticipantId newParticipantId)

Let a new participant take the place of an existing participant

Parameters
oldParticipantId the participant to drop
newParticipantId the participant that takes its place
Returns
  • true if swap successful, false otherwise

public void updateCurrentState (ResourceId resourceId, ParticipantId participantId, SessionId sessionId, CurrentState curStateUpdate)

update resource current state of a participant

Parameters
resourceId resource id
participantId participant id
sessionId session id
curStateUpdate current state change delta

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

public boolean updateUserConfig (ParticipantId participantId, UserConfig userConfig)

Add user configuration to the existing participant user configuration. Overwrites properties with the same key

Parameters
userConfig the user config key-value pairs to add
Returns
  • true if the user config was updated, false otherwise

Protected Methods

protected ResourceAccessor resourceAccessor ()

Get a ResourceAccessor instance

Returns
  • ResourceAccessor

protected void swapParticipantsInIdealState (IdealState idealState, ParticipantId oldParticipantId, ParticipantId newParticipantId)

Replace occurrences of participants in preference lists and maps

Parameters
idealState the current ideal state
oldParticipantId the participant to drop
newParticipantId the participant that replaces it