Class AbstractReplicationSourceGroup<T extends SourceGroupConfig>
java.lang.Object
com.gigaspaces.internal.cluster.node.impl.groups.AbstractReplicationSourceGroup<T>
- All Implemented Interfaces:
DynamicSourceGroupConfigHolder.IDynamicSourceGroupStateListener,IReplicationGroupHistory,IReplicationSourceGroup
- Direct Known Subclasses:
AsyncReplicationSourceGroup,ReliableAsyncReplicationSourceGroup,SyncReplicationSourceGroup
public abstract class AbstractReplicationSourceGroup<T extends SourceGroupConfig>
extends Object
implements IReplicationSourceGroup, IReplicationGroupHistory, DynamicSourceGroupConfigHolder.IDynamicSourceGroupStateListener
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractReplicationSourceGroup(DynamicSourceGroupConfigHolder groupConfigHolder, IReplicationRouter replicationRouter, IReplicationGroupBacklog groupBacklog, String myLookupName, IReplicationOutFilter outFilter, IAsyncHandlerProvider asyncHandlerProvider, IReplicationSourceGroupStateListener stateListener) -
Method Summary
Modifier and TypeMethodDescriptionvoidbeginSynchronizing(String synchronizingMemberLookupName, Object synchronizingSourceUniqueId) Signal this source group that one of its channel is now used for space synchronization replicavoidbeginSynchronizing(String synchronizingMemberLookupName, Object synchronizingSourceUniqueId, boolean isDirectPersistencySync) booleancheckChannelConnected(String sourceMemberLookupName) voidclose()Close this replication group, once closed it can no longer be usedprotected voidvoidcloseTemporaryChannel(String sourceMemberName) Closes a temporary created channelprotected voidcreateChannel(String memberLookupName, boolean dynamicMember, SourceGroupConfig config, boolean connectSynchronously, Object customBacklogMetadata, boolean resetTarget) protected abstract AbstractReplicationSourceChannelcreateChannel(String memberLookupName, IReplicationRouter replicationRouter, IReplicationMonitoredConnection connection, IReplicationChannelDataFilter dataFilter, IReplicationGroupHistory groupHistory, boolean dynamicMember, SourceGroupConfig groupConfig, Object customBacklogMetadata, boolean resetTarget) protected voidvoidcreateTemporaryChannel(String memberName, Object customBacklogMetadata) Creates a temporary channel to an existing member of this group, if a channel is already created then this method does nothing This method should be called when there is a need to create a temporary channel from this group to the target group to perform some operation and should not be used for a persistent channelintexecute(IReplicationGroupOutContext groupContext) Executes the replication specified by the provided group contextvoidexecute(IReplicationUnreliableOperation operation) protected abstract intexecuteImpl(IReplicationGroupOutContext groupContext) booleanflushPendingReplication(long timeout, TimeUnit units) protected AbstractReplicationSourceChannelgetChannel(String memberLookupName) getChannelEndpointDetails(String sourceMemberLookupName) getChannelHistory(String memberName) protected AbstractReplicationSourceChannelgetChannelSafe(String synchronizingMemberLookupName) protected Stringprotected String[]voidvoidlogGroupEvent(String event) voidmemberAdded(MemberAddedEvent memberAddedEvent, SourceGroupConfig newConfig) voidmemberRemoved(String memberName, SourceGroupConfig newConfig) voidMonitors sla state of the replication groupprotected voidonClose()protected abstract voidonCloseTemporaryChannel(String sourceMemberName, AbstractReplicationSourceChannel channel) protected voidonMemberAdded(MemberAddedEvent memberAddedEvent, SourceGroupConfig newConfig) protected voidonMemberRemoved(String memberName, SourceGroupConfig newConfig) outputDescendingEvents(String memberName) voidregisterWith(MetricRegistrator metricRegister) voidprotected voidvoidsetActive(MetricRegistrator metricRegistrator) voidsetPassive(boolean closeProxy) voidstopSynchronization(String synchronizingMemberLookupName) Signal this source group that one of its channel synchronization state is abortedIReplicationSourceGroup.beginSynchronizing(String, Object)voidsynchronizationCopyStageDone(String synchronizingMemberLookupName) During synchronization process, notify the channel specified by the target name that the copy iteration process is done in order for the filtering mechanism to know that any following packets occurred completely after the synchronization copy stage.booleansynchronizationDataGenerated(String synchronizingMemberLookupName, String uid) During synchronization process, notify the channel specified by the target name, that a sync data was generated in order for it to know to filter older data when replicating to targetprotected voidvalidateGroupConsistencyLevelPolicy(GroupConsistencyLevelPolicy groupConsistencyLevelPolicy, T sourceGroupConfig) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.gigaspaces.internal.cluster.node.impl.groups.IReplicationSourceGroup
beforeExecute, beforeExecuteGeneric, beforeTransactionExecute
-
Field Details
-
_specificLogger
protected final org.slf4j.Logger _specificLogger -
_channelCreationLock
-
-
Constructor Details
-
AbstractReplicationSourceGroup
public AbstractReplicationSourceGroup(DynamicSourceGroupConfigHolder groupConfigHolder, IReplicationRouter replicationRouter, IReplicationGroupBacklog groupBacklog, String myLookupName, IReplicationOutFilter outFilter, IAsyncHandlerProvider asyncHandlerProvider, IReplicationSourceGroupStateListener stateListener)
-
-
Method Details
-
validateGroupConsistencyLevelPolicy
protected void validateGroupConsistencyLevelPolicy(GroupConsistencyLevelPolicy groupConsistencyLevelPolicy, T sourceGroupConfig) -
logEvent
- Specified by:
logEventin interfaceIReplicationGroupHistory
-
logGroupEvent
- Specified by:
logGroupEventin interfaceIReplicationGroupHistory
-
outputDescendingEvents
- Specified by:
outputDescendingEventsin interfaceIReplicationGroupHistory
-
getChannelHistory
-
getMyLookupName
-
getOutFilter
-
getStateListener
-
getAsyncHandlerProvider
-
createReplicationChannels
protected void createReplicationChannels() -
closeReplicationChannels
protected void closeReplicationChannels() -
memberAdded
- Specified by:
memberAddedin interfaceDynamicSourceGroupConfigHolder.IDynamicSourceGroupStateListener
-
memberRemoved
- Specified by:
memberRemovedin interfaceDynamicSourceGroupConfigHolder.IDynamicSourceGroupStateListener
-
onMemberRemoved
-
onMemberAdded
-
createTemporaryChannel
Description copied from interface:IReplicationSourceGroupCreates a temporary channel to an existing member of this group, if a channel is already created then this method does nothing This method should be called when there is a need to create a temporary channel from this group to the target group to perform some operation and should not be used for a persistent channel- Specified by:
createTemporaryChannelin interfaceIReplicationSourceGroup- Parameters:
memberName- group member to create the channel to
-
closeTemporaryChannel
Description copied from interface:IReplicationSourceGroupCloses a temporary created channel- Specified by:
closeTemporaryChannelin interfaceIReplicationSourceGroup- See Also:
-
onCloseTemporaryChannel
protected abstract void onCloseTemporaryChannel(String sourceMemberName, AbstractReplicationSourceChannel channel) -
createChannel
protected void createChannel(String memberLookupName, boolean dynamicMember, SourceGroupConfig config, boolean connectSynchronously, Object customBacklogMetadata, boolean resetTarget) -
execute
Description copied from interface:IReplicationSourceGroupExecutes the replication specified by the provided group context- Specified by:
executein interfaceIReplicationSourceGroup- Returns:
- true iff the replication ended.
-
executeImpl
-
execute
- Specified by:
executein interfaceIReplicationSourceGroup
-
createChannel
protected abstract AbstractReplicationSourceChannel createChannel(String memberLookupName, IReplicationRouter replicationRouter, IReplicationMonitoredConnection connection, IReplicationChannelDataFilter dataFilter, IReplicationGroupHistory groupHistory, boolean dynamicMember, SourceGroupConfig groupConfig, Object customBacklogMetadata, boolean resetTarget) -
getGroupName
- Specified by:
getGroupNamein interfaceIReplicationSourceGroup- Returns:
- group name
-
getConfigHolder
- Specified by:
getConfigHolderin interfaceIReplicationSourceGroup
-
getChannel
-
beginSynchronizing
public void beginSynchronizing(String synchronizingMemberLookupName, Object synchronizingSourceUniqueId, boolean isDirectPersistencySync) - Specified by:
beginSynchronizingin interfaceIReplicationSourceGroup
-
beginSynchronizing
public void beginSynchronizing(String synchronizingMemberLookupName, Object synchronizingSourceUniqueId) Description copied from interface:IReplicationSourceGroupSignal this source group that one of its channel is now used for space synchronization replica- Specified by:
beginSynchronizingin interfaceIReplicationSourceGroup- Parameters:
synchronizingMemberLookupName- the channel target name that is used for synchronization
-
getChannelSafe
-
synchronizationDataGenerated
Description copied from interface:IReplicationSourceGroupDuring synchronization process, notify the channel specified by the target name, that a sync data was generated in order for it to know to filter older data when replicating to target- Specified by:
synchronizationDataGeneratedin interfaceIReplicationSourceGroup
-
synchronizationCopyStageDone
Description copied from interface:IReplicationSourceGroupDuring synchronization process, notify the channel specified by the target name that the copy iteration process is done in order for the filtering mechanism to know that any following packets occurred completely after the synchronization copy stage.- Specified by:
synchronizationCopyStageDonein interfaceIReplicationSourceGroup
-
stopSynchronization
Description copied from interface:IReplicationSourceGroupSignal this source group that one of its channel synchronization state is abortedIReplicationSourceGroup.beginSynchronizing(String, Object)- Specified by:
stopSynchronizationin interfaceIReplicationSourceGroup
-
checkChannelConnected
- Specified by:
checkChannelConnectedin interfaceIReplicationSourceGroup- Returns:
- true is an underlying channel to the specified member is connected
-
getChannelEndpointDetails
- Specified by:
getChannelEndpointDetailsin interfaceIReplicationSourceGroup
-
getGroupBacklog
- Specified by:
getGroupBacklogin interfaceIReplicationSourceGroup- Returns:
- underlying group backlog
-
close
public void close()Description copied from interface:IReplicationSourceGroupClose this replication group, once closed it can no longer be used- Specified by:
closein interfaceIReplicationSourceGroup
-
onClose
protected void onClose() -
getChannelsStatus
- Specified by:
getChannelsStatusin interfaceIReplicationSourceGroup
-
getLogPrefix
-
setActive
- Specified by:
setActivein interfaceIReplicationSourceGroup
-
setPassive
public void setPassive(boolean closeProxy) - Specified by:
setPassivein interfaceIReplicationSourceGroup- Parameters:
closeProxy- - whether to close the stub proxy when it has no more references.
-
getChannels
-
sampleStatistics
public void sampleStatistics()- Specified by:
sampleStatisticsin interfaceIReplicationSourceGroup
-
getStatistics
- Specified by:
getStatisticsin interfaceIReplicationSourceGroup
-
registerWith
- Specified by:
registerWithin interfaceIReplicationSourceGroup
-
monitorConsistencyLevel
Description copied from interface:IReplicationSourceGroupMonitors sla state of the replication group- Specified by:
monitorConsistencyLevelin interfaceIReplicationSourceGroup- Throws:
ConsistencyLevelViolationException- if the sla is breached
-
flushPendingReplication
- Specified by:
flushPendingReplicationin interfaceIReplicationSourceGroup
-
scanAndRemoveDroppedMembers
protected void scanAndRemoveDroppedMembers() -
getPotentialRemovedMembers
-
dumpState
- Specified by:
dumpStatein interfaceIReplicationSourceGroup
-