public abstract class AbstractReplicationSourceGroup<T extends SourceGroupConfig> extends Object implements IReplicationSourceGroup, IReplicationGroupHistory, DynamicSourceGroupConfigHolder.IDynamicSourceGroupStateListener
| Modifier and Type | Field and Description |
|---|---|
protected Object |
_channelCreationLock |
protected org.slf4j.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,
boolean resetTarget) |
protected abstract AbstractReplicationSourceChannel |
createChannel(String memberLookupName,
IReplicationRouter replicationRouter,
IReplicationMonitoredConnection connection,
IReplicationChannelDataFilter dataFilter,
IReplicationGroupHistory groupHistory,
boolean dynamicMember,
SourceGroupConfig groupConfig,
Object customBacklogMetadata,
boolean resetTarget) |
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, waitbeforeExecute, beforeExecuteGeneric, beforeTransactionExecuteprotected final org.slf4j.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 IReplicationGroupHistorypublic void logGroupEvent(String event)
logGroupEvent in interface IReplicationGroupHistorypublic String outputDescendingEvents(String memberName)
outputDescendingEvents in interface IReplicationGroupHistorypublic 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.IDynamicSourceGroupStateListenerpublic void memberRemoved(String memberName, SourceGroupConfig newConfig)
memberRemoved in interface DynamicSourceGroupConfigHolder.IDynamicSourceGroupStateListenerprotected void onMemberRemoved(String memberName, SourceGroupConfig newConfig)
protected void onMemberAdded(MemberAddedEvent memberAddedEvent, SourceGroupConfig newConfig)
public void createTemporaryChannel(String memberName, Object customBacklogMetadata)
IReplicationSourceGroupcreateTemporaryChannel in interface IReplicationSourceGroupmemberName - group member to create the channel topublic void closeTemporaryChannel(String sourceMemberName)
IReplicationSourceGroupcloseTemporaryChannel in interface IReplicationSourceGroupIReplicationSourceGroup.createTemporaryChannel(String, Object)protected abstract void onCloseTemporaryChannel(String sourceMemberName, AbstractReplicationSourceChannel channel)
protected void createChannel(String memberLookupName, boolean dynamicMember, SourceGroupConfig config, boolean connectSynchronously, Object customBacklogMetadata, boolean resetTarget)
public int execute(IReplicationGroupOutContext groupContext)
IReplicationSourceGroupexecute in interface IReplicationSourceGroupprotected abstract int executeImpl(IReplicationGroupOutContext groupContext)
public void execute(IReplicationUnreliableOperation operation)
execute in interface IReplicationSourceGroupprotected abstract AbstractReplicationSourceChannel createChannel(String memberLookupName, IReplicationRouter replicationRouter, IReplicationMonitoredConnection connection, IReplicationChannelDataFilter dataFilter, IReplicationGroupHistory groupHistory, boolean dynamicMember, SourceGroupConfig groupConfig, Object customBacklogMetadata, boolean resetTarget)
public String getGroupName()
getGroupName in interface IReplicationSourceGrouppublic DynamicSourceGroupConfigHolder getConfigHolder()
getConfigHolder in interface IReplicationSourceGroupprotected AbstractReplicationSourceChannel getChannel(String memberLookupName)
public void beginSynchronizing(String synchronizingMemberLookupName, Object synchronizingSourceUniqueId, boolean isDirectPersistencySync)
beginSynchronizing in interface IReplicationSourceGrouppublic void beginSynchronizing(String synchronizingMemberLookupName, Object synchronizingSourceUniqueId)
IReplicationSourceGroupbeginSynchronizing in interface IReplicationSourceGroupsynchronizingMemberLookupName - the channel target name that is used for
synchronizationprotected AbstractReplicationSourceChannel getChannelSafe(String synchronizingMemberLookupName)
public boolean synchronizationDataGenerated(String synchronizingMemberLookupName, String uid)
IReplicationSourceGroupsynchronizationDataGenerated in interface IReplicationSourceGrouppublic void synchronizationCopyStageDone(String synchronizingMemberLookupName)
IReplicationSourceGroupsynchronizationCopyStageDone in interface IReplicationSourceGrouppublic void stopSynchronization(String synchronizingMemberLookupName)
IReplicationSourceGroupIReplicationSourceGroup.beginSynchronizing(String, Object)stopSynchronization in interface IReplicationSourceGrouppublic boolean checkChannelConnected(String sourceMemberLookupName)
checkChannelConnected in interface IReplicationSourceGrouppublic ReplicationEndpointDetails getChannelEndpointDetails(String sourceMemberLookupName)
getChannelEndpointDetails in interface IReplicationSourceGrouppublic IReplicationGroupBacklog getGroupBacklog()
getGroupBacklog in interface IReplicationSourceGrouppublic void close()
IReplicationSourceGroupclose in interface IReplicationSourceGroupprotected void onClose()
public Map<String,Boolean> getChannelsStatus()
getChannelsStatus in interface IReplicationSourceGroupprotected String getLogPrefix()
public void setActive(MetricRegistrator metricRegistrator)
setActive in interface IReplicationSourceGrouppublic void setPassive(boolean closeProxy)
setPassive in interface IReplicationSourceGroupcloseProxy - - whether to close the stub proxy when it has no more references.public Map<String,AbstractReplicationSourceChannel> getChannels()
public void sampleStatistics()
sampleStatistics in interface IReplicationSourceGrouppublic IReplicationSourceGroupStatistics getStatistics()
getStatistics in interface IReplicationSourceGrouppublic void registerWith(MetricRegistrator metricRegister)
registerWith in interface IReplicationSourceGrouppublic void monitorConsistencyLevel()
throws ConsistencyLevelViolationException
IReplicationSourceGroupmonitorConsistencyLevel in interface IReplicationSourceGroupConsistencyLevelViolationException - if the sla is breachedpublic boolean flushPendingReplication(long timeout,
TimeUnit units)
flushPendingReplication in interface IReplicationSourceGroupprotected void scanAndRemoveDroppedMembers()
protected String[] getPotentialRemovedMembers(SourceGroupConfig config)
public String dumpState()
dumpState in interface IReplicationSourceGroupCopyright © GigaSpaces.