Package com.j_spaces.core.cluster
Class ReplicationPolicy
java.lang.Object
com.j_spaces.core.cluster.ReplicationPolicy
- All Implemented Interfaces:
SmartExternalizable,Externalizable,Serializable
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classReplication policy description for every member. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringthe name of the cluster this replication policy belongs tostatic final longstatic final Stringstatic final intstatic final intstatic final floatstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final Stringstatic final Stringstatic final MissingPacketsPolicystatic final booleanstatic final ReplicationProcessingTypestatic final intstatic final intstatic final RedoLogCapacityExceededPolicystatic final RedoLogCompactionstatic final floatstatic final longstatic final longstatic final intstatic final booleanstatic final intstatic final intstatic final booleanstatic final Stringstatic final intstatic final intstatic final booleanstatic final intstatic final Stringstatic final intstatic final Stringstatic final Stringbooleanfast one way replicationbooleantrue if sync-replication enabled, otherwise async-replintbooleanbooleanintlongintbooleanreplication policy description table: key: memberName, value: ReplicationPolicyDescription.longlongbooleanlonggroup's sync-replication information, if null, not sync replication defined.booleanstatic final Stringstatic final Stringstatic final intstatic final Stringstatic final intstatic final Stringstatic final Stringstatic final Stringstatic final intstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionJust for Externalizable.ReplicationPolicy(String clusterName, String replicationGroupName, List<String> replicationGroupMembersNames, List<SpaceURL> replicationGroupMembersURLs, String ownMemberName, Hashtable<String, ReplicationPolicy.ReplicationPolicyDescription> replMemberPolicyDescTable, SyncReplPolicy syncReplPolicy, MultiBucketReplicationPolicy multiBucketReplicationPolicy, SwapBacklogConfig swapRedologPolicy) -
Method Summary
Modifier and TypeMethodDescriptionlongintlonglonglonglonglonglonglonglonggetPrimaryTargets(List<String> excludeTargets) Returns a list of URLs or an empty list of primary targets .getRecoverableTargets(List<String> excludeTargets) Finds all the recovery targets in cluster.final intintlonglongintintgetSpaceMemberPosition(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.getSpaceReplicationUrl(String fullSpaceName) getSyncTargets(List<String> excludeTargets) Returns a list of URLs or an empty list of reliable targets to recover from.booleanbooleanbooleanbooleanbooleanreturnstrueif this member has sync-replication to at least one target.booleanbooleanbooleanbooleanfinal booleanvoidvoidsetAsyncChannelShutdownTimeout(long shutdownTimeout) voidsetBacklogWeightPolicy(String backlogWeightPolicy) voidsetConflictingOperationPolicy(ConflictingOperationPolicy conflictingOperationPolicy) voidsetConnectionMonitorThreadPoolSize(int connectionMonitorThreadPoolSize) voidsetDurableNotificationMaxDisconnectionTime(long notificationMaxDisconnectionTime) voidsetDurableNotificationMaxRedologCapacity(Long notificationMaxRedologCapacity) voidsetLocalViewMaxDisconnectionTime(long localViewMaxDisconnectionTime) voidsetLocalViewMaxRedologCapacity(Long localViewMaxRedologCapacity) voidsetLocalViewMaxRedologRecoveryCapacity(Long localViewMaxRedologRecoveryCapacity) voidsetMaxRedoLogCapacity(long capacity) voidsetMaxRedoLogMemoryCapacity(long capacity) voidsetMaxRedoLogRecoveryCapacity(long capacity) voidsetMirrorServiceConfig(MirrorServiceConfig mirrorServiceConfig) voidsetOnMissingPackets(MissingPacketsPolicy onMissingPackets) voidsetOnRecoveryRedoLogExceededBlockPrimary(boolean redoLogCapacityExceededDontBlock) voidvoidsetPermittedOperations(List<ReplicationOperationType> permittedOperations) voidsetPrimarySpaceSelector(LeaderSelector primarySpaceSelector) voidsetProcessingType(ReplicationProcessingType processingType) voidsetRecoveryChunkSize(int recoveryChunkSize) voidsetRecoveryThreadPoolSize(int recoveryThreadPoolSize) voidsetRedoLogCompaction(RedoLogCompaction redoLogCompaction) voidsetReliableAsyncCompletionNotifierInterval(long reliableAsyncCompletionNotifierInterval) voidsetReliableAsyncCompletionNotifierPacketsThreshold(long reliableAsyncCompletionNotifierPacketsThreshold) voidsetReliableAsyncRepl(boolean reliableAsyncRepl) Sets the async-replication 'reliable' indicator; default falsevoidsetReplicatedOriginalState(boolean isReplOriginalState) voidsetReplicateFullTake(boolean replicateFullTake) voidsetReplicateLeaseExpirations(boolean value) voidsetReplicateOnePhaseCommit(boolean replicateOnePhaseCommit) booleanshouldReplicate(ReplicationOperationType operType) toString()voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.gigaspaces.serialization.SmartExternalizable
enabledSmartExternalizableWithReference
-
Field Details
-
UNICAST_COMMUNICATION_MODE
- See Also:
-
MULTICAST_COMMUNICATION_MODE
- See Also:
-
UNICAST
public static final int UNICAST- See Also:
-
MULTICAST
public static final int MULTICAST- See Also:
-
ASYNC_REPLICATION_MODE
- See Also:
-
SYNC_REPLICATION_MODE
- See Also:
-
SYNC_REC_ACK_REPLICATION_MODE
- See Also:
-
BLOCK_OPERATIONS_MODE
- See Also:
-
DROP_OLDEST_MODE
- See Also:
-
RECOVER_MODE
- See Also:
-
IGNORE_MODE
- See Also:
-
GLOBAL_ORDER_MODE
- See Also:
-
MULTI_BUCKET_MODE
- See Also:
-
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
- 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
-
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
-
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
-
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
- See Also:
-
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
-
m_ReplicationGroupName
-
m_ReplicationGroupMembersNames
-
m_ReplicationGroupMembersURLs
-
m_ReplicateNotifyTemplates
public boolean m_ReplicateNotifyTemplates -
m_TriggerNotifyTemplates
public boolean m_TriggerNotifyTemplates -
m_SyncOnCommit
public boolean m_SyncOnCommit -
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 isOneWayReplicationfast one way replication -
m_IsSyncReplicationEnabled
public boolean m_IsSyncReplicationEnabledtrue if sync-replication enabled, otherwise async-repl -
m_SyncReplPolicy
group's sync-replication information, if null, not sync replication defined. -
clusterName
the name of the cluster this replication policy belongs to -
DEFAULT_MIRROR_SERVICE_NAME
- See Also:
-
DEFAULT_MIRROR_SERVICE_CONNECTOR_NAME
- See Also:
-
-
Constructor Details
-
ReplicationPolicy
public ReplicationPolicy()Just for Externalizable. -
ReplicationPolicy
public ReplicationPolicy(String clusterName, String replicationGroupName, List<String> replicationGroupMembersNames, List<SpaceURL> replicationGroupMembersURLs, String ownMemberName, Hashtable<String, ReplicationPolicy.ReplicationPolicyDescription> replMemberPolicyDescTable, SyncReplPolicy syncReplPolicy, MultiBucketReplicationPolicy multiBucketReplicationPolicy, SwapBacklogConfig swapRedologPolicy)
-
-
Method Details
-
setRedoLogCompaction
-
getRedoLogCompaction
-
isOnRecoveryRedoLogExceededBlockPrimary
public boolean isOnRecoveryRedoLogExceededBlockPrimary() -
setOnRecoveryRedoLogExceededBlockPrimary
public void setOnRecoveryRedoLogExceededBlockPrimary(boolean redoLogCapacityExceededDontBlock) -
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
setMirrorServiceConfig
-
getMirrorServiceConfig
- Returns:
nullif 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
-
setPermittedOperations
-
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
-
getMaxRedoLogMemoryCapacity
public long getMaxRedoLogMemoryCapacity() -
getBacklogWeightPolicy
-
getMaxRedoLogRecoveryCapacity
public long getMaxRedoLogRecoveryCapacity() -
setMaxRedoLogRecoveryCapacity
public void setMaxRedoLogRecoveryCapacity(long capacity) -
setLocalViewMaxRedologCapacity
-
getLocalViewMaxRedologCapacity
public long getLocalViewMaxRedologCapacity() -
setLocalViewMaxDisconnectionTime
public void setLocalViewMaxDisconnectionTime(long localViewMaxDisconnectionTime) -
getLocalViewMaxDisconnectionTime
public long getLocalViewMaxDisconnectionTime() -
setLocalViewMaxRedologRecoveryCapacity
-
getLocalViewMaxRedologRecoveryCapacity
public long getLocalViewMaxRedologRecoveryCapacity() -
setOnRedoLogCapacityExceeded
-
getOnRedoLogCapacityExceeded
-
isOwnerMemberHasSyncReplication
public boolean isOwnerMemberHasSyncReplication()returnstrueif this member has sync-replication to at least one target. -
setPrimarySpaceSelector
-
getPrimarySpaceSelector
-
getRecoverableTargets
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
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
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
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
-
setConflictingOperationPolicy
-
toString
-
getRecoveryThreadPoolSize
public int getRecoveryThreadPoolSize() -
setRecoveryThreadPoolSize
public void setRecoveryThreadPoolSize(int recoveryThreadPoolSize) -
getAsyncChannelShutdownTimeout
public long getAsyncChannelShutdownTimeout() -
setAsyncChannelShutdownTimeout
public void setAsyncChannelShutdownTimeout(long shutdownTimeout) -
setOnMissingPackets
-
getOnMissingPackets
-
setReplicateFullTake
public void setReplicateFullTake(boolean replicateFullTake) -
isReplicateFullTake
public boolean isReplicateFullTake() -
getSpaceReplicationUrl
-
getProcessingType
-
setProcessingType
-
getMultiBucketReplicationPolicy
-
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
-
getDurableNotificationMaxDisconnectionTime
public long getDurableNotificationMaxDisconnectionTime() -
setDurableNotificationMaxDisconnectionTime
public void setDurableNotificationMaxDisconnectionTime(long notificationMaxDisconnectionTime) -
setConnectionMonitorThreadPoolSize
public void setConnectionMonitorThreadPoolSize(int connectionMonitorThreadPoolSize) -
getConnectionMonitorThreadPoolSize
public int getConnectionMonitorThreadPoolSize() -
isNetworkCompressionEnabled
public boolean isNetworkCompressionEnabled()
-