Class AbstractReplicationSourceChannel
java.lang.Object
com.gigaspaces.internal.cluster.node.impl.groups.AbstractReplicationSourceChannel
- All Implemented Interfaces:
IReplicationSourceChannel,IConnectionStateListener
- Direct Known Subclasses:
AsyncReplicationSourceChannel,SyncReplicationSourceChannel
public abstract class AbstractReplicationSourceChannel
extends Object
implements IReplicationSourceChannel, IConnectionStateListener
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ThreadLocalPool<ReplicatedDataPacketResource>protected final org.slf4j.Loggerprotected final org.slf4j.Loggerprotected final SegmentedAtomicInteger -
Constructor Summary
ConstructorsConstructorDescriptionAbstractReplicationSourceChannel(DynamicSourceGroupConfigHolder groupConfig, String groupName, String memberName, IReplicationRouter replicationRouter, IReplicationMonitoredConnection connection, IReplicationGroupBacklog groupBacklog, IReplicationOutFilter outFilter, IAsyncHandlerProvider asyncHandlerProvider, IReplicationChannelDataFilter dataFilter, IReplicationSourceGroupStateListener stateListener, IReplicationGroupHistory groupHistory, ReplicationStatistics.ReplicationMode channelType, Object customBacklogMetadata, String tag) AbstractReplicationSourceChannel(DynamicSourceGroupConfigHolder groupConfig, String groupName, String memberName, IReplicationRouter replicationRouter, IReplicationMonitoredConnection connection, IReplicationGroupBacklog groupBacklog, IReplicationOutFilter outFilter, IAsyncHandlerProvider asyncHandlerProvider, IReplicationChannelDataFilter dataFilter, IReplicationSourceGroupStateListener stateListener, IReplicationGroupHistory groupHistory, ReplicationStatistics.ReplicationMode channelType, Object customBacklogMetadata, String tag, boolean resetTarget) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidbeginSynchronizing(boolean isDirectPersistencySync) voidclose()protected abstract voidprotected voiddispatchBacklogDropped(IBacklogMemberState memberState) abstract voidprotected Throwableprotected intprotected List<IReplicationOrderedPacket>getPendingPackets(int batchSize) Get a list of packets that are waiting to be replicatedprotected intgetSampleTPBefore(long timeBefore, TimeUnit unit) protected PlatformLogicalVersionbooleanisActive()booleanisClosed()booleanbooleanbooleanprotected voidlogEventInHistory(String event) protected abstract voidprotected abstract voidonAsyncReplicateErrorResult(Throwable t, IReplicationOrderedPacket finalPacket) protected abstract voidonAsyncReplicateErrorResult(Throwable t, List<IReplicationOrderedPacket> finalPackets) voidonConnected(boolean newTarget) voidprotected abstract voidprotected StringbooleanvoidregisterWith(MetricRegistrator metricRegister) voidreplicate(IReplicationUnreliableOperation operation) protected intreplicate(IReplicationOrderedPacket packet) protected Futureprotected FuturereplicateAsync(List<IReplicationOrderedPacket> packets) protected intreplicateBatch(List<IReplicationOrderedPacket> packets) Replicate given packetsprotected voidThis method should be called when replicating packets that were generated at a considerable time before the actual replication (i.e async replication), this will replicate only packets that are not obsolete (i.eequals true)protected voidreplicateBatchDelayedAsync(List<IReplicationOrderedPacket> packets, IAsyncReplicationListener listener) voidSamples the channel through put, TP is measured between sample calls.voidprotected voidstart()voidvoidbooleanprotected void
-
Field Details
-
_specificLogger
protected final org.slf4j.Logger _specificLogger -
_specificVerboseLogger
protected final org.slf4j.Logger _specificVerboseLogger -
_statisticsCounter
-
_packetsPool
-
-
Constructor Details
-
AbstractReplicationSourceChannel
public AbstractReplicationSourceChannel(DynamicSourceGroupConfigHolder groupConfig, String groupName, String memberName, IReplicationRouter replicationRouter, IReplicationMonitoredConnection connection, IReplicationGroupBacklog groupBacklog, IReplicationOutFilter outFilter, IAsyncHandlerProvider asyncHandlerProvider, IReplicationChannelDataFilter dataFilter, IReplicationSourceGroupStateListener stateListener, IReplicationGroupHistory groupHistory, ReplicationStatistics.ReplicationMode channelType, Object customBacklogMetadata, String tag) -
AbstractReplicationSourceChannel
public AbstractReplicationSourceChannel(DynamicSourceGroupConfigHolder groupConfig, String groupName, String memberName, IReplicationRouter replicationRouter, IReplicationMonitoredConnection connection, IReplicationGroupBacklog groupBacklog, IReplicationOutFilter outFilter, IAsyncHandlerProvider asyncHandlerProvider, IReplicationChannelDataFilter dataFilter, IReplicationSourceGroupStateListener stateListener, IReplicationGroupHistory groupHistory, ReplicationStatistics.ReplicationMode channelType, Object customBacklogMetadata, String tag, boolean resetTarget)
-
-
Method Details
-
start
protected void start() -
getGroupName
-
getMemberName
-
getMyLookupName
-
getGroupBacklog
-
getConnection
-
isDataFiltered
public boolean isDataFiltered() -
getDataFilter
-
logEventInHistory
-
wrapConnection
protected void wrapConnection() -
onConnected
public void onConnected(boolean newTarget) - Specified by:
onConnectedin interfaceIConnectionStateListener
-
onDisconnected
public void onDisconnected()- Specified by:
onDisconnectedin interfaceIConnectionStateListener
-
dispatchBacklogDropped
- Throws:
RemoteException
-
onActiveImpl
protected abstract void onActiveImpl() -
onDisconnectedImpl
protected abstract void onDisconnectedImpl() -
isActive
public boolean isActive() -
getChannelState
-
pingTarget
public boolean pingTarget() -
isClosed
public boolean isClosed() -
close
public void close() -
closeImpl
protected abstract void closeImpl() -
beginSynchronizing
public void beginSynchronizing(boolean isDirectPersistencySync) throws CannotExecuteSynchronizeReplicaException -
beginSynchronizing
-
stopSynchronization
public void stopSynchronization() -
isSynchronizing
public boolean isSynchronizing() -
synchronizationDataGenerated
-
synchronizationCopyStageDone
public void synchronizationCopyStageDone() -
signalSynchronizingDone
- Throws:
RemoteException
-
replicateBatch
protected int replicateBatch(List<IReplicationOrderedPacket> packets) throws RemoteException, ReplicationException Replicate given packets- Returns:
- number of completed replications
- Throws:
RemoteExceptionReplicationException
-
replicate
protected int replicate(IReplicationOrderedPacket packet) throws RemoteException, ReplicationException - Throws:
RemoteExceptionReplicationException
-
replicateAsync
- Throws:
RemoteException
-
replicateAsync
- Throws:
RemoteException
-
onAsyncReplicateErrorResult
protected abstract void onAsyncReplicateErrorResult(Throwable t, List<IReplicationOrderedPacket> finalPackets) -
onAsyncReplicateErrorResult
protected abstract void onAsyncReplicateErrorResult(Throwable t, IReplicationOrderedPacket finalPacket) -
replicateBatchDelayed
protected void replicateBatchDelayed(List<IReplicationOrderedPacket> packets) throws RemoteException, ReplicationException This method should be called when replicating packets that were generated at a considerable time before the actual replication (i.e async replication), this will replicate only packets that are not obsolete (i.eequals true)- Throws:
RemoteExceptionReplicationException
-
replicateBatchDelayedAsync
protected void replicateBatchDelayedAsync(List<IReplicationOrderedPacket> packets, IAsyncReplicationListener listener) throws RemoteException - Throws:
RemoteException
-
getPendingPackets
Get a list of packets that are waiting to be replicated -
sampleStatistics
public void sampleStatistics()Samples the channel through put, TP is measured between sample calls. -
getLastSampledTP
protected int getLastSampledTP() -
getSampleTPBefore
-
isInconsistent
public boolean isInconsistent() -
getInconsistencyReason
-
getStatistics
-
registerWith
-
getChannelOpertingMode
-
flushPendingReplication
public abstract void flushPendingReplication() -
replicate
-
dumpState
-
onDumpState
-
getTargetReplicationEndpointDetails
-
getTargetLogicalVersion
-