public class MetadataRaftGroupManager extends Object implements SnapshotAwareService<MetadataRaftGroupSnapshot>
| Modifier and Type | Field and Description |
|---|---|
static RaftGroupId |
INITIAL_METADATA_GROUP_ID |
public static final RaftGroupId INITIAL_METADATA_GROUP_ID
public MetadataRaftGroupSnapshot takeSnapshot(CPGroupId groupId, long commitIndex)
SnapshotAwareServiceCPGroupId.
The snapshot object returned from this method will be stored among
the Raft log and it can be sent to other Raft nodes anytime. Therefore,
this method must not return a snapshot object that can mutate after
the takeSnapshot() call.takeSnapshot in interface SnapshotAwareService<MetadataRaftGroupSnapshot>groupId - CPGroupId which is snapshot requested forcommitIndex - commitIndex of the taken snapshotCPGroupId.public void restoreSnapshot(CPGroupId groupId, long commitIndex, MetadataRaftGroupSnapshot snapshot)
SnapshotAwareServiceCPGroupId.restoreSnapshot in interface SnapshotAwareService<MetadataRaftGroupSnapshot>groupId - CPGroupId of the snapshot to be restoredcommitIndex - commitIndex of the restored snapshotsnapshot - snapshot for specified CPGroupIdpublic CPGroupId getMetadataGroupId()
public Collection<CPGroupId> getGroupIds()
public Collection<CPGroupId> getActiveGroupIds()
public CPGroupInfo getRaftGroup(CPGroupId groupId)
public CPGroupInfo getActiveRaftGroup(String groupName)
public void initializeMetadataRaftGroup(List<CPMemberInfo> initialMembers, int metadataMembersCount, long expectedGroupIdSeed)
public CPGroupId createRaftGroup(String groupName, Collection<CPMemberInfo> members, long commitIndex)
public void triggerDestroyRaftGroup(CPGroupId groupId)
public void forceDestroyRaftGroup(String groupName)
public void triggerRemoveMember(CPMemberInfo leavingMember)
public MembershipChangeContext completeRaftGroupMembershipChanges(Map<CPGroupId,Tuple2<Long,Long>> changedGroups)
public Collection<CPMemberInfo> getActiveMembers()
public void setActiveMembers(RaftGroupId metadataGroupId, Collection<CPMemberInfo> members)
public Collection<CPGroupId> getDestroyingGroupIds()
public MembershipChangeContext getMembershipChangeContext()
public void addActiveMember(CPMemberInfo member)
public void disableDiscovery()
Copyright © 2019. All Rights Reserved.