public abstract class AbstractReplicationSourceGroup<T extends SourceGroupConfig> extends Object implements IReplicationSourceGroup, IReplicationGroupHistory, DynamicSourceGroupConfigHolder.IDynamicSourceGroupStateListener
Modifier and Type | Field and Description |
---|---|
protected Object |
_channelCreationLock |
protected Logger |
_specificLogger |
Constructor and Description |
---|
AbstractReplicationSourceGroup(DynamicSourceGroupConfigHolder groupConfigHolder,
IReplicationRouter replicationRouter,
IReplicationGroupBacklog groupBacklog,
String myLookupName,
IReplicationOutFilter outFilter,
IAsyncHandlerProvider asyncHandlerProvider,
IReplicationSourceGroupStateListener stateListener) |
Modifier and Type | Method and Description |
---|---|
void |
beginSynchronizing(String synchronizingMemberLookupName,
Object synchronizingSourceUniqueId)
Signal this source group that one of its channel is now used for space synchronization
replica
|
void |
beginSynchronizing(String synchronizingMemberLookupName,
Object synchronizingSourceUniqueId,
boolean isDirectPersistencySync) |
boolean |
checkChannelConnected(String sourceMemberLookupName) |
void |
close()
Close this replication group, once closed it can no longer be used
|
protected void |
closeReplicationChannels() |
void |
closeTemporaryChannel(String sourceMemberName)
Closes a temporary created channel
|
protected void |
createChannel(String memberLookupName,
boolean dynamicMember,
SourceGroupConfig config,
boolean connectSynchronously,
Object customBacklogMetadata) |
protected abstract AbstractReplicationSourceChannel |
createChannel(String memberLookupName,
IReplicationRouter replicationRouter,
IReplicationMonitoredConnection connection,
IReplicationChannelDataFilter dataFilter,
IReplicationGroupHistory groupHistory,
boolean dynamicMember,
SourceGroupConfig groupConfig,
Object customBacklogMetadata) |
protected void |
createReplicationChannels() |
void |
createTemporaryChannel(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 channel
|
String |
dumpState() |
int |
execute(IReplicationGroupOutContext groupContext)
Executes the replication specified by the provided group context
|
void |
execute(IReplicationUnreliableOperation operation) |
protected abstract int |
executeImpl(IReplicationGroupOutContext groupContext) |
boolean |
flushPendingReplication(long timeout,
TimeUnit units) |
IAsyncHandlerProvider |
getAsyncHandlerProvider() |
protected AbstractReplicationSourceChannel |
getChannel(String memberLookupName) |
ReplicationEndpointDetails |
getChannelEndpointDetails(String sourceMemberLookupName) |
EventsTracer<String> |
getChannelHistory(String memberName) |
Map<String,AbstractReplicationSourceChannel> |
getChannels() |
protected AbstractReplicationSourceChannel |
getChannelSafe(String synchronizingMemberLookupName) |
Map<String,Boolean> |
getChannelsStatus() |
DynamicSourceGroupConfigHolder |
getConfigHolder() |
IReplicationGroupBacklog |
getGroupBacklog() |
String |
getGroupName() |
protected String |
getLogPrefix() |
String |
getMyLookupName() |
IReplicationOutFilter |
getOutFilter() |
protected String[] |
getPotentialRemovedMembers(SourceGroupConfig config) |
IReplicationSourceGroupStateListener |
getStateListener() |
IReplicationSourceGroupStatistics |
getStatistics() |
void |
logEvent(String memberName,
String event) |
void |
logGroupEvent(String event) |
void |
memberAdded(MemberAddedEvent memberAddedEvent,
SourceGroupConfig newConfig) |
void |
memberRemoved(String memberName,
SourceGroupConfig newConfig) |
void |
monitorConsistencyLevel()
Monitors sla state of the replication group
|
protected void |
onClose() |
protected abstract void |
onCloseTemporaryChannel(String sourceMemberName,
AbstractReplicationSourceChannel channel) |
protected void |
onMemberAdded(MemberAddedEvent memberAddedEvent,
SourceGroupConfig newConfig) |
protected void |
onMemberRemoved(String memberName,
SourceGroupConfig newConfig) |
String |
outputDescendingEvents(String memberName) |
void |
registerWith(MetricRegistrator metricRegister) |
void |
sampleStatistics() |
protected void |
scanAndRemoveDroppedMembers() |
void |
setActive(MetricRegistrator metricRegistrator) |
void |
setPassive(boolean closeProxy) |
void |
stopSynchronization(String synchronizingMemberLookupName)
Signal this source group that one of its channel synchronization state is aborted
IReplicationSourceGroup.beginSynchronizing(String, Object) |
void |
synchronizationCopyStageDone(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.
|
boolean |
synchronizationDataGenerated(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 target
|
protected void |
validateGroupConsistencyLevelPolicy(GroupConsistencyLevelPolicy groupConsistencyLevelPolicy,
T sourceGroupConfig) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
beforeExecute, beforeExecuteGeneric, beforeTransactionExecute
protected final Logger _specificLogger
protected final Object _channelCreationLock
public AbstractReplicationSourceGroup(DynamicSourceGroupConfigHolder groupConfigHolder, IReplicationRouter replicationRouter, IReplicationGroupBacklog groupBacklog, String myLookupName, IReplicationOutFilter outFilter, IAsyncHandlerProvider asyncHandlerProvider, IReplicationSourceGroupStateListener stateListener)
protected void validateGroupConsistencyLevelPolicy(GroupConsistencyLevelPolicy groupConsistencyLevelPolicy, T sourceGroupConfig)
public void logEvent(String memberName, String event)
logEvent
in interface IReplicationGroupHistory
public void logGroupEvent(String event)
logGroupEvent
in interface IReplicationGroupHistory
public String outputDescendingEvents(String memberName)
outputDescendingEvents
in interface IReplicationGroupHistory
public EventsTracer<String> getChannelHistory(String memberName)
public String getMyLookupName()
public IReplicationOutFilter getOutFilter()
public IReplicationSourceGroupStateListener getStateListener()
public IAsyncHandlerProvider getAsyncHandlerProvider()
protected void createReplicationChannels()
protected void closeReplicationChannels()
public void memberAdded(MemberAddedEvent memberAddedEvent, SourceGroupConfig newConfig)
memberAdded
in interface DynamicSourceGroupConfigHolder.IDynamicSourceGroupStateListener
public void memberRemoved(String memberName, SourceGroupConfig newConfig)
memberRemoved
in interface DynamicSourceGroupConfigHolder.IDynamicSourceGroupStateListener
protected void onMemberRemoved(String memberName, SourceGroupConfig newConfig)
protected void onMemberAdded(MemberAddedEvent memberAddedEvent, SourceGroupConfig newConfig)
public void createTemporaryChannel(String memberName, Object customBacklogMetadata)
IReplicationSourceGroup
createTemporaryChannel
in interface IReplicationSourceGroup
memberName
- group member to create the channel topublic void closeTemporaryChannel(String sourceMemberName)
IReplicationSourceGroup
closeTemporaryChannel
in interface IReplicationSourceGroup
IReplicationSourceGroup.createTemporaryChannel(String, Object)
protected abstract void onCloseTemporaryChannel(String sourceMemberName, AbstractReplicationSourceChannel channel)
protected void createChannel(String memberLookupName, boolean dynamicMember, SourceGroupConfig config, boolean connectSynchronously, Object customBacklogMetadata)
public int execute(IReplicationGroupOutContext groupContext)
IReplicationSourceGroup
execute
in interface IReplicationSourceGroup
protected abstract int executeImpl(IReplicationGroupOutContext groupContext)
public void execute(IReplicationUnreliableOperation operation)
execute
in interface IReplicationSourceGroup
protected abstract AbstractReplicationSourceChannel createChannel(String memberLookupName, IReplicationRouter replicationRouter, IReplicationMonitoredConnection connection, IReplicationChannelDataFilter dataFilter, IReplicationGroupHistory groupHistory, boolean dynamicMember, SourceGroupConfig groupConfig, Object customBacklogMetadata)
public String getGroupName()
getGroupName
in interface IReplicationSourceGroup
public DynamicSourceGroupConfigHolder getConfigHolder()
getConfigHolder
in interface IReplicationSourceGroup
protected AbstractReplicationSourceChannel getChannel(String memberLookupName)
public void beginSynchronizing(String synchronizingMemberLookupName, Object synchronizingSourceUniqueId, boolean isDirectPersistencySync)
beginSynchronizing
in interface IReplicationSourceGroup
public void beginSynchronizing(String synchronizingMemberLookupName, Object synchronizingSourceUniqueId)
IReplicationSourceGroup
beginSynchronizing
in interface IReplicationSourceGroup
synchronizingMemberLookupName
- the channel target name that is used for
synchronizationprotected AbstractReplicationSourceChannel getChannelSafe(String synchronizingMemberLookupName)
public boolean synchronizationDataGenerated(String synchronizingMemberLookupName, String uid)
IReplicationSourceGroup
synchronizationDataGenerated
in interface IReplicationSourceGroup
public void synchronizationCopyStageDone(String synchronizingMemberLookupName)
IReplicationSourceGroup
synchronizationCopyStageDone
in interface IReplicationSourceGroup
public void stopSynchronization(String synchronizingMemberLookupName)
IReplicationSourceGroup
IReplicationSourceGroup.beginSynchronizing(String, Object)
stopSynchronization
in interface IReplicationSourceGroup
public boolean checkChannelConnected(String sourceMemberLookupName)
checkChannelConnected
in interface IReplicationSourceGroup
public ReplicationEndpointDetails getChannelEndpointDetails(String sourceMemberLookupName)
getChannelEndpointDetails
in interface IReplicationSourceGroup
public IReplicationGroupBacklog getGroupBacklog()
getGroupBacklog
in interface IReplicationSourceGroup
public void close()
IReplicationSourceGroup
close
in interface IReplicationSourceGroup
protected void onClose()
public Map<String,Boolean> getChannelsStatus()
getChannelsStatus
in interface IReplicationSourceGroup
protected String getLogPrefix()
public void setActive(MetricRegistrator metricRegistrator)
setActive
in interface IReplicationSourceGroup
public void setPassive(boolean closeProxy)
setPassive
in interface IReplicationSourceGroup
closeProxy
- - whether to close the stub proxy when it has no more references.public Map<String,AbstractReplicationSourceChannel> getChannels()
public void sampleStatistics()
sampleStatistics
in interface IReplicationSourceGroup
public IReplicationSourceGroupStatistics getStatistics()
getStatistics
in interface IReplicationSourceGroup
public void registerWith(MetricRegistrator metricRegister)
registerWith
in interface IReplicationSourceGroup
public void monitorConsistencyLevel() throws ConsistencyLevelViolationException
IReplicationSourceGroup
monitorConsistencyLevel
in interface IReplicationSourceGroup
ConsistencyLevelViolationException
- if the sla is breachedpublic boolean flushPendingReplication(long timeout, TimeUnit units)
flushPendingReplication
in interface IReplicationSourceGroup
protected void scanAndRemoveDroppedMembers()
protected String[] getPotentialRemovedMembers(SourceGroupConfig config)
public String dumpState()
dumpState
in interface IReplicationSourceGroup
Copyright © GigaSpaces.