Class ReplicationPolicy

java.lang.Object
com.j_spaces.core.cluster.ReplicationPolicy
All Implemented Interfaces:
SmartExternalizable, Externalizable, Serializable

public class ReplicationPolicy extends Object implements Serializable, SmartExternalizable
See Also:
  • Field Details

    • UNICAST_COMMUNICATION_MODE

      public static final String UNICAST_COMMUNICATION_MODE
      See Also:
    • MULTICAST_COMMUNICATION_MODE

      public static final String MULTICAST_COMMUNICATION_MODE
      See Also:
    • UNICAST

      public static final int UNICAST
      See Also:
    • MULTICAST

      public static final int MULTICAST
      See Also:
    • ASYNC_REPLICATION_MODE

      public static final String ASYNC_REPLICATION_MODE
      See Also:
    • SYNC_REPLICATION_MODE

      public static final String SYNC_REPLICATION_MODE
      See Also:
    • SYNC_REC_ACK_REPLICATION_MODE

      public static final String SYNC_REC_ACK_REPLICATION_MODE
      See Also:
    • BLOCK_OPERATIONS_MODE

      public static final String BLOCK_OPERATIONS_MODE
      See Also:
    • DROP_OLDEST_MODE

      public static final String DROP_OLDEST_MODE
      See Also:
    • RECOVER_MODE

      public static final String RECOVER_MODE
      See Also:
    • IGNORE_MODE

      public static final String IGNORE_MODE
      See Also:
    • GLOBAL_ORDER_MODE

      public static final String GLOBAL_ORDER_MODE
      See Also:
    • MULTI_BUCKET_MODE

      public static final String MULTI_BUCKET_MODE
      See Also:
    • MULTI_SOURCE_MODE

      public static final String MULTI_SOURCE_MODE
      See Also:
    • FULL_REPLICATION

      public static final int FULL_REPLICATION
      See Also:
    • PARTIAL_REPLICATION

      public static final int PARTIAL_REPLICATION
      See Also:
    • DEFAULT_REPL_ORIGINAL_STATE

      public static final String DEFAULT_REPL_ORIGINAL_STATE
      See Also:
    • DEFAULT_REPL_CHUNK_SIZE

      public static final int DEFAULT_REPL_CHUNK_SIZE
      See Also:
    • DEFAULT_REPL_INTERVAL_MILLIS

      public static final int DEFAULT_REPL_INTERVAL_MILLIS
      See Also:
    • DEFAULT_REPL_INTERVAL_OPERS

      public static final int DEFAULT_REPL_INTERVAL_OPERS
      See Also:
    • DEFAULT_REPL_SPACE_FINDER_TIMEOUT

      public static final int DEFAULT_REPL_SPACE_FINDER_TIMEOUT
      See Also:
    • DEFAULT_REPL_SPACE_FINDER_REPORT_INTERVAL

      public static final int DEFAULT_REPL_SPACE_FINDER_REPORT_INTERVAL
      See Also:
    • DEFAULT_SYNC_ON_COMMIT_TIMEOUT

      public static final int DEFAULT_SYNC_ON_COMMIT_TIMEOUT
      See Also:
    • DEFAULT_ASYNC_CHANNEL_SHUTDOWN_TIMEOUT

      public static final long DEFAULT_ASYNC_CHANNEL_SHUTDOWN_TIMEOUT
      See Also:
    • DEFAULT_REPL_NETWORK_COMPRESSION

      public static final boolean DEFAULT_REPL_NETWORK_COMPRESSION
      See Also:
    • DEFAULT_MAX_REDO_LOG_CPACITY

      public static final long DEFAULT_MAX_REDO_LOG_CPACITY
      See Also:
    • DEFAULT_REDO_LOG_CAPACITY_EXCEEDED

      public static final RedoLogCapacityExceededPolicy DEFAULT_REDO_LOG_CAPACITY_EXCEEDED
    • DEFAULT_RECOVERY_CHUNK_SIZE

      public static final int DEFAULT_RECOVERY_CHUNK_SIZE
      See Also:
    • DEFAULT_RECOVERY_THREAD_POOL_SIZE

      public static final int DEFAULT_RECOVERY_THREAD_POOL_SIZE
      See Also:
    • DEFAULT_BLOBSTORE_RECOVERY_THREAD_POOL_SIZE

      public static final int DEFAULT_BLOBSTORE_RECOVERY_THREAD_POOL_SIZE
      See Also:
    • DEFAULT_MISSING_PACKETS

      public static final MissingPacketsPolicy DEFAULT_MISSING_PACKETS
    • DEFAULT_REPL_FULL_TAKE

      public static final boolean DEFAULT_REPL_FULL_TAKE
      See Also:
    • DEFAULT_OLD_MODULE

      public static final boolean DEFAULT_OLD_MODULE
      See Also:
    • DEFAULT_PROCESSING_TYPE

      public static final ReplicationProcessingType DEFAULT_PROCESSING_TYPE
    • DEFAULT_LOCALVIEW_REDOLOG_CAPACITY

      public static final long DEFAULT_LOCALVIEW_REDOLOG_CAPACITY
      See Also:
    • DEFAULT_LOCALVIEW_MAX_DISCONNECTION_TIME

      public static final long DEFAULT_LOCALVIEW_MAX_DISCONNECTION_TIME
      See Also:
    • DEFAULT_LOCALVIEW_REDOLOG_RECOVERY_CAPACITY

      public static final long DEFAULT_LOCALVIEW_REDOLOG_RECOVERY_CAPACITY
      See Also:
    • DEFAULT_DURABLE_NOTIFICATION_REDOLOG_CAPACITY

      public static final long DEFAULT_DURABLE_NOTIFICATION_REDOLOG_CAPACITY
      See Also:
    • DEFAULT_DURABLE_NOTIFICATION_MAX_DISCONNECTION_TIME

      public static final long DEFAULT_DURABLE_NOTIFICATION_MAX_DISCONNECTION_TIME
      See Also:
    • DEFAULT_RELIABLE_ASYNC_STATE_NOTIFY_INTERVAL

      public static final long DEFAULT_RELIABLE_ASYNC_STATE_NOTIFY_INTERVAL
      See Also:
    • DEFAULT_RELIABLE_ASYNC_STATE_NOTIFY_PACKETS

      public static final long DEFAULT_RELIABLE_ASYNC_STATE_NOTIFY_PACKETS
      See Also:
    • DEFAULT_REPLICATE_ONE_PHASE_COMMIT

      public static final boolean DEFAULT_REPLICATE_ONE_PHASE_COMMIT
      See Also:
    • DEFAULT_CONNECTION_MONITOR_THREAD_POOL_SIZE

      public static final int DEFAULT_CONNECTION_MONITOR_THREAD_POOL_SIZE
      See Also:
    • DEFAULT_BACKLOG_WEIGHT_POLICY

      public static final String DEFAULT_BACKLOG_WEIGHT_POLICY
      See Also:
    • DEFAULT_REDO_LOG_COMPACTION

      public static final RedoLogCompaction DEFAULT_REDO_LOG_COMPACTION
    • DEFAULT_DISCARDED_PACKET_WEIGHT_LOAD_FACTOR

      public static final float DEFAULT_DISCARDED_PACKET_WEIGHT_LOAD_FACTOR
    • DEFAULT_REDO_LOG_COMPACTION_BATCH_SIZE

      public static final float DEFAULT_REDO_LOG_COMPACTION_BATCH_SIZE
    • m_OwnMemberName

      public String m_OwnMemberName
    • m_ReplicationGroupName

      public String m_ReplicationGroupName
    • m_ReplicationGroupMembersNames

      public List<String> m_ReplicationGroupMembersNames
    • m_ReplicationGroupMembersURLs

      public List<SpaceURL> m_ReplicationGroupMembersURLs
    • m_ReplicateNotifyTemplates

      public boolean m_ReplicateNotifyTemplates
    • m_TriggerNotifyTemplates

      public boolean m_TriggerNotifyTemplates
    • m_SyncOnCommit

      public boolean m_SyncOnCommit
    • m_ReplicationMode

      public String m_ReplicationMode
    • m_PolicyType

      public int m_PolicyType
    • m_ReplicationChunkSize

      public int m_ReplicationChunkSize
    • m_ReplicationIntervalMillis

      public long m_ReplicationIntervalMillis
    • m_ReplicationIntervalOperations

      public int m_ReplicationIntervalOperations
    • m_SpaceFinderTimeout

      public long m_SpaceFinderTimeout
    • m_SpaceFinderReportInterval

      public long m_SpaceFinderReportInterval
    • m_SyncOnCommitTimeout

      public long m_SyncOnCommitTimeout
    • m_ReplicationNetworkCompression

      public boolean m_ReplicationNetworkCompression
    • m_Recovery

      public boolean m_Recovery
    • m_ReplMemberPolicyDescTable

      replication policy description table: key: memberName, value: ReplicationPolicyDescription.
    • isOneWayReplication

      public boolean isOneWayReplication
      fast one way replication
    • m_IsSyncReplicationEnabled

      public boolean m_IsSyncReplicationEnabled
      true if sync-replication enabled, otherwise async-repl
    • m_SyncReplPolicy

      public SyncReplPolicy m_SyncReplPolicy
      group's sync-replication information, if null, not sync replication defined.
    • clusterName

      public String clusterName
      the name of the cluster this replication policy belongs to
    • DEFAULT_MIRROR_SERVICE_NAME

      public static final String DEFAULT_MIRROR_SERVICE_NAME
      See Also:
    • DEFAULT_MIRROR_SERVICE_CONNECTOR_NAME

      public static final String DEFAULT_MIRROR_SERVICE_CONNECTOR_NAME
      See Also:
  • Constructor Details

  • Method Details

    • setRedoLogCompaction

      public void setRedoLogCompaction(RedoLogCompaction redoLogCompaction)
    • getRedoLogCompaction

      public RedoLogCompaction getRedoLogCompaction()
    • isOnRecoveryRedoLogExceededBlockPrimary

      public boolean isOnRecoveryRedoLogExceededBlockPrimary()
    • setOnRecoveryRedoLogExceededBlockPrimary

      public void setOnRecoveryRedoLogExceededBlockPrimary(boolean redoLogCapacityExceededDontBlock)
    • writeExternal

      public void writeExternal(ObjectOutput out) throws IOException
      Specified by:
      writeExternal in interface Externalizable
      Throws:
      IOException
    • readExternal

      public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
      Specified by:
      readExternal in interface Externalizable
      Throws:
      IOException
      ClassNotFoundException
    • setMirrorServiceConfig

      public void setMirrorServiceConfig(MirrorServiceConfig mirrorServiceConfig)
    • getMirrorServiceConfig

      public MirrorServiceConfig getMirrorServiceConfig()
      Returns:
      null if the mirror-service disabled
    • isMirrorServiceEnabled

      public boolean isMirrorServiceEnabled()
      Returns:
      if the mirror service enabled for entire replication group
    • isReliableAsyncRepl

      public boolean isReliableAsyncRepl()
      Returns:
      the async-replication 'reliable' indicator; default false
    • shouldReplicate

      public boolean shouldReplicate(ReplicationOperationType operType)
    • setPermittedOperations

      public void setPermittedOperations(List<ReplicationOperationType> permittedOperations)
    • setReliableAsyncRepl

      public void setReliableAsyncRepl(boolean reliableAsyncRepl)
      Sets the async-replication 'reliable' indicator; default false
      Parameters:
      reliableAsyncRepl - true if reliable-async-replication is enabled; false otherwise.
    • setMaxRedoLogCapacity

      public void setMaxRedoLogCapacity(long capacity)
    • getMaxRedoLogCapacity

      public long getMaxRedoLogCapacity()
    • setMaxRedoLogMemoryCapacity

      public void setMaxRedoLogMemoryCapacity(long capacity)
    • setBacklogWeightPolicy

      public void setBacklogWeightPolicy(String backlogWeightPolicy)
    • getMaxRedoLogMemoryCapacity

      public long getMaxRedoLogMemoryCapacity()
    • getBacklogWeightPolicy

      public String getBacklogWeightPolicy()
    • getMaxRedoLogRecoveryCapacity

      public long getMaxRedoLogRecoveryCapacity()
    • setMaxRedoLogRecoveryCapacity

      public void setMaxRedoLogRecoveryCapacity(long capacity)
    • setLocalViewMaxRedologCapacity

      public void setLocalViewMaxRedologCapacity(Long localViewMaxRedologCapacity)
    • getLocalViewMaxRedologCapacity

      public long getLocalViewMaxRedologCapacity()
    • setLocalViewMaxDisconnectionTime

      public void setLocalViewMaxDisconnectionTime(long localViewMaxDisconnectionTime)
    • getLocalViewMaxDisconnectionTime

      public long getLocalViewMaxDisconnectionTime()
    • setLocalViewMaxRedologRecoveryCapacity

      public void setLocalViewMaxRedologRecoveryCapacity(Long localViewMaxRedologRecoveryCapacity)
    • getLocalViewMaxRedologRecoveryCapacity

      public long getLocalViewMaxRedologRecoveryCapacity()
    • setOnRedoLogCapacityExceeded

      public void setOnRedoLogCapacityExceeded(RedoLogCapacityExceededPolicy policy)
    • getOnRedoLogCapacityExceeded

      public RedoLogCapacityExceededPolicy getOnRedoLogCapacityExceeded()
    • isOwnerMemberHasSyncReplication

      public boolean isOwnerMemberHasSyncReplication()
      returns true if this member has sync-replication to at least one target.
    • setPrimarySpaceSelector

      public void setPrimarySpaceSelector(LeaderSelector primarySpaceSelector)
    • getPrimarySpaceSelector

      public LeaderSelector getPrimarySpaceSelector()
    • getRecoverableTargets

      public List<SpaceURL> getRecoverableTargets(List<String> excludeTargets)
      Finds all the recovery targets in cluster. The targets are ordered according to their reliability. First all primary targets are added. Then the sync targets, and only then all the others.
      Parameters:
      excludeTargets - targets that should be excluded from search
      Returns:
      a list of recoverable members SpaceURLs. returns empty list if recovery is disabled.
    • getSyncTargets

      public List<SpaceURL> getSyncTargets(List<String> excludeTargets)
      Returns a list of URLs or an empty list of reliable targets to recover from. A 'reliable' target is one that replicates synchronously to 'this' source.

      This differs from getRecoverableTargets(java.util.List) in that:
      1. all URLs are returned and there is no multicast URL - We need specific members.
      2. The target is chosen only if it sync-replicates to 'this', in contrast to returning a target which 'this' replicates to.

      Returns:
      a list of URLs or an empty list of reliable targets to recover from. Never returns null.
    • getPrimaryTargets

      public List<SpaceURL> getPrimaryTargets(List<String> excludeTargets)
      Returns a list of URLs or an empty list of primary targets .
      Returns:
      a list of URLs or an empty list of primary targets. Never returns null.
    • getSpaceMemberPosition

      public int getSpaceMemberPosition(String spaceMemberName)
      This method returns the relative position of the specified space member in the replication group, or -1 if the space member is not found. Positions are counted from 0 to #nodes - 1. The position can be used as a unique identifier of the space within its group.
    • getRecoveryChunkSize

      public final int getRecoveryChunkSize()
    • setRecoveryChunkSize

      public void setRecoveryChunkSize(int recoveryChunkSize)
    • isReplicateOriginalState

      public final boolean isReplicateOriginalState()
    • setReplicatedOriginalState

      public void setReplicatedOriginalState(boolean isReplOriginalState)
    • getConflictingOperationPolicy

      public ConflictingOperationPolicy getConflictingOperationPolicy()
    • setConflictingOperationPolicy

      public void setConflictingOperationPolicy(ConflictingOperationPolicy conflictingOperationPolicy)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getRecoveryThreadPoolSize

      public int getRecoveryThreadPoolSize()
    • setRecoveryThreadPoolSize

      public void setRecoveryThreadPoolSize(int recoveryThreadPoolSize)
    • getAsyncChannelShutdownTimeout

      public long getAsyncChannelShutdownTimeout()
    • setAsyncChannelShutdownTimeout

      public void setAsyncChannelShutdownTimeout(long shutdownTimeout)
    • setOnMissingPackets

      public void setOnMissingPackets(MissingPacketsPolicy onMissingPackets)
    • getOnMissingPackets

      public MissingPacketsPolicy getOnMissingPackets()
    • setReplicateFullTake

      public void setReplicateFullTake(boolean replicateFullTake)
    • isReplicateFullTake

      public boolean isReplicateFullTake()
    • getSpaceReplicationUrl

      public SpaceURL getSpaceReplicationUrl(String fullSpaceName)
    • getProcessingType

      public ReplicationProcessingType getProcessingType()
    • setProcessingType

      public void setProcessingType(ReplicationProcessingType processingType)
    • getMultiBucketReplicationPolicy

      public MultiBucketReplicationPolicy getMultiBucketReplicationPolicy()
    • getSwapRedologPolicy

      public SwapBacklogConfig getSwapRedologPolicy()
    • isFullReplication

      public boolean isFullReplication()
    • isReplicateLeaseExpirations

      public boolean isReplicateLeaseExpirations()
    • setReplicateLeaseExpirations

      public void setReplicateLeaseExpirations(boolean value)
    • getReplicationTargetsCount

      public int getReplicationTargetsCount()
    • setReliableAsyncCompletionNotifierInterval

      public void setReliableAsyncCompletionNotifierInterval(long reliableAsyncCompletionNotifierInterval)
    • getReliableAsyncCompletionNotifierInterval

      public long getReliableAsyncCompletionNotifierInterval()
    • getReliableAsyncCompletionNotifierPacketsThreshold

      public long getReliableAsyncCompletionNotifierPacketsThreshold()
    • setReliableAsyncCompletionNotifierPacketsThreshold

      public void setReliableAsyncCompletionNotifierPacketsThreshold(long reliableAsyncCompletionNotifierPacketsThreshold)
    • isReplicateOnePhaseCommit

      public boolean isReplicateOnePhaseCommit()
    • setReplicateOnePhaseCommit

      public void setReplicateOnePhaseCommit(boolean replicateOnePhaseCommit)
    • getDurableNotificationMaxRedologCapacity

      public long getDurableNotificationMaxRedologCapacity()
    • setDurableNotificationMaxRedologCapacity

      public void setDurableNotificationMaxRedologCapacity(Long notificationMaxRedologCapacity)
    • getDurableNotificationMaxDisconnectionTime

      public long getDurableNotificationMaxDisconnectionTime()
    • setDurableNotificationMaxDisconnectionTime

      public void setDurableNotificationMaxDisconnectionTime(long notificationMaxDisconnectionTime)
    • setConnectionMonitorThreadPoolSize

      public void setConnectionMonitorThreadPoolSize(int connectionMonitorThreadPoolSize)
    • getConnectionMonitorThreadPoolSize

      public int getConnectionMonitorThreadPoolSize()
    • isNetworkCompressionEnabled

      public boolean isNetworkCompressionEnabled()