VMware GemFire Java API Reference
Package org.apache.geode.cache.wan
Interface GatewaySender
-
public interface GatewaySender- Since:
- GemFire 7.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classGatewaySender.OrderPolicyThe order policy.
-
Field Summary
Fields Modifier and Type Field Description static intCONNECTION_RETRY_INTERVALRetry a connection from sender to receiver after specified time interval (in milliseconds) in case receiver is not up and running.static intDEFAULT_ALERT_THRESHOLDThe default alert threshold in millisecondsstatic booleanDEFAULT_BATCH_CONFLATIONThe default batch conflationstatic intDEFAULT_BATCH_SIZEThe default batch sizestatic intDEFAULT_BATCH_TIME_INTERVALThe default batch time interval in millisecondsstatic booleanDEFAULT_DISK_SYNCHRONOUSThe default value ( true) for writing to disk synchronously in case of persistence.static intDEFAULT_DISPATCHER_THREADSstatic intDEFAULT_DISTRIBUTED_SYSTEM_IDstatic booleanDEFAULT_ENFORCE_THREADS_CONNECT_SAME_RECEIVERstatic booleanDEFAULT_FORWARD_EXPIRATION_DESTROYstatic booleanDEFAULT_IS_FOR_INTERNAL_USEstatic booleanDEFAULT_IS_PARALLELstatic booleanDEFAULT_MANUAL_STARTDeprecated.- Manual start of senders is deprecated and will be removed in a later release.static intDEFAULT_MAXIMUM_QUEUE_MEMORYThe default maximum amount of memory (MB) to allow in the queue before overflowing entries to diskstatic booleanDEFAULT_MUST_GROUP_TRANSACTION_EVENTSDeprecated.since GemFire 10.2, no replacement as this is no longer supported.static GatewaySender.OrderPolicyDEFAULT_ORDER_POLICYstatic intDEFAULT_PARALLELISM_REPLICATED_REGIONstatic booleanDEFAULT_PERSISTENCE_ENABLEDThe default value (false)of whether to persist queue data to disk or not.static intDEFAULT_SOCKET_BUFFER_SIZEThe default buffer size for socket buffers from a sending GatewaySender to its receivingGatewayReceiver.static intDEFAULT_SOCKET_READ_TIMEOUTThe default amount of time in milliseconds that a socket read between a sendingGatewayand its receivingGatewaywill block.static booleanEARLY_ACKstatic intGATEWAY_CONNECTION_IDLE_TIMEOUTstatic java.lang.StringGATEWAY_CONNECTION_READ_TIMEOUT_PROPERTYThe obsolete socket read timeout java system property.static longGATEWAY_SENDER_TIMEOUTTime, in seconds, that we allow before aGatewaySenderis considered dead and should be abortedstatic intGET_TRANSACTION_EVENTS_FROM_QUEUE_RETRIESDeprecated.since GemFire 10.2, no replacement as this is no longer supported.static intGET_TRANSACTION_EVENTS_FROM_QUEUE_WAIT_TIME_MSDeprecated.since GemFire 10.2, no replacement as this is no longer supported.static intMINIMUM_SOCKET_READ_TIMEOUTThe default minimum socket read timeout.static intQUEUE_OPLOG_SIZESize of the oplog file used for the persistent queue in bytesstatic booleanREMOVE_FROM_QUEUE_ON_EXCEPTIONDeprecated.since GemFire 10.2, useGatewayReceiverFactory.setEventRetryAttempts(int)instead.static org.apache.geode.logging.internal.deprecation.DeprecatedSystemPropertyremoveFromQueueOnException
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidaddGatewayEventFilter(GatewayEventFilter filter)Adds the providedGatewayEventFilterto this GatewaySender.voiddestroy()Destroys the GatewaySender.intgetAlertThreshold()Returns the alert threshold in milliseconds for entries in a GatewaySender's queue.intgetBatchSize()Returns the batch size for this GatewaySender.intgetBatchTimeInterval()Returns the batch time interval for this GatewaySender.java.lang.StringgetDiskStoreName()Gets the disk store name for overflow or persistence.intgetDispatcherThreads()Returns the number of dispatcher threads working for thisGatewaySender.booleangetEnforceThreadsConnectSameReceiver()Returns enforceThreadsConnectSameReceiver boolean property for this GatewaySender.GatewayEventFailureListenergetGatewayEventFailureListener()Returns thisGatewaySender'sGatewayEventFailureListener.java.util.List<GatewayEventFilter>getGatewayEventFilters()Returns the list ofGatewayEventFilteradded to this GatewaySender.GatewayEventSubstitutionFiltergetGatewayEventSubstitutionFilter()Returns thisGatewaySender'sGatewayEventSubstitutionFilter.java.util.List<GatewayTransportFilter>getGatewayTransportFilters()Deprecated.for removal in a future release.java.lang.StringgetId()Returns the id of this GatewaySender.intgetMaximumQueueMemory()Returns the maximum amount of memory (in MB) for a GatewaySender's queue.intgetMaxParallelismForReplicatedRegion()GatewaySender.OrderPolicygetOrderPolicy()Returns the order policy followed while dispatching the events to remote ds.intgetRemoteDSId()Returns the id of the remoteGatewayReceiver's DistributedSystem.intgetSocketBufferSize()Returns the configured buffer size of the socket connection between this GatewaySender and its receivingGatewayReceiver.intgetSocketReadTimeout()Returns the amount of time in milliseconds that a socket read between a sending GatewaySender and its receivingGatewayReceiverwill block.booleanisBatchConflationEnabled()Answers whether to enable batch conflation for a GatewaySender 's queue.booleanisDiskSynchronous()Returns isDiskSynchronous boolean property for this GatewaySender.booleanisManualStart()Deprecated.- Manual start of senders is deprecated and will be removed in a later release.booleanisParallel()Returns isParallel boolean property for this GatewaySender.booleanisPaused()Returns whether or not this GatewaySender is paused.booleanisPersistenceEnabled()Returns true if persistence is enabled for this GatewaySender, otherwise returns false.booleanisRunning()Returns whether or not this GatewaySender is running.booleanmustGroupTransactionEvents()Deprecated.since GemFire 10.2, no replacement as this is no longer supported.voidpause()Pauses the dispatching of the events from the underlying queue.voidrebalance()Rebalances this GatewaySender.voidremoveGatewayEventFilter(GatewayEventFilter filter)Removes the providedGatewayEventFilterfrom this GatewaySender.voidresume()Resumes this paused GatewaySender.voidstart()Starts this GatewaySender.voidstartWithCleanQueue()Starts this GatewaySender and discards previous queue content.voidstop()Stops this GatewaySender.
-
-
-
Field Detail
-
DEFAULT_MANUAL_START
@Deprecated static final boolean DEFAULT_MANUAL_START
Deprecated.- Manual start of senders is deprecated and will be removed in a later release.The default value (false) for manually starting aGatewaySender.- See Also:
- Constant Field Values
-
DEFAULT_DISK_SYNCHRONOUS
static final boolean DEFAULT_DISK_SYNCHRONOUS
The default value ( true) for writing to disk synchronously in case of persistence.- See Also:
- Constant Field Values
-
DEFAULT_SOCKET_BUFFER_SIZE
static final int DEFAULT_SOCKET_BUFFER_SIZE
The default buffer size for socket buffers from a sending GatewaySender to its receivingGatewayReceiver.- See Also:
- Constant Field Values
-
DEFAULT_SOCKET_READ_TIMEOUT
static final int DEFAULT_SOCKET_READ_TIMEOUT
The default amount of time in milliseconds that a socket read between a sendingGatewayand its receivingGatewaywill block.
-
MINIMUM_SOCKET_READ_TIMEOUT
static final int MINIMUM_SOCKET_READ_TIMEOUT
The default minimum socket read timeout.- See Also:
- Constant Field Values
-
QUEUE_OPLOG_SIZE
static final int QUEUE_OPLOG_SIZE
Size of the oplog file used for the persistent queue in bytes
-
DEFAULT_PERSISTENCE_ENABLED
static final boolean DEFAULT_PERSISTENCE_ENABLED
The default value (false)of whether to persist queue data to disk or not.- See Also:
- Constant Field Values
-
DEFAULT_BATCH_CONFLATION
static final boolean DEFAULT_BATCH_CONFLATION
The default batch conflation- See Also:
- Constant Field Values
-
DEFAULT_BATCH_SIZE
static final int DEFAULT_BATCH_SIZE
The default batch size- See Also:
- Constant Field Values
-
DEFAULT_BATCH_TIME_INTERVAL
static final int DEFAULT_BATCH_TIME_INTERVAL
The default batch time interval in milliseconds- See Also:
- Constant Field Values
-
DEFAULT_ALERT_THRESHOLD
static final int DEFAULT_ALERT_THRESHOLD
The default alert threshold in milliseconds- See Also:
- Constant Field Values
-
DEFAULT_PARALLELISM_REPLICATED_REGION
static final int DEFAULT_PARALLELISM_REPLICATED_REGION
-
DEFAULT_DISTRIBUTED_SYSTEM_ID
static final int DEFAULT_DISTRIBUTED_SYSTEM_ID
- See Also:
- Constant Field Values
-
DEFAULT_DISPATCHER_THREADS
static final int DEFAULT_DISPATCHER_THREADS
- See Also:
- Constant Field Values
-
DEFAULT_FORWARD_EXPIRATION_DESTROY
static final boolean DEFAULT_FORWARD_EXPIRATION_DESTROY
- See Also:
- Constant Field Values
-
DEFAULT_ORDER_POLICY
@Immutable static final GatewaySender.OrderPolicy DEFAULT_ORDER_POLICY
-
DEFAULT_MAXIMUM_QUEUE_MEMORY
static final int DEFAULT_MAXIMUM_QUEUE_MEMORY
The default maximum amount of memory (MB) to allow in the queue before overflowing entries to disk- See Also:
- Constant Field Values
-
GATEWAY_SENDER_TIMEOUT
static final long GATEWAY_SENDER_TIMEOUT
Time, in seconds, that we allow before aGatewaySenderis considered dead and should be aborted
-
GATEWAY_CONNECTION_READ_TIMEOUT_PROPERTY
static final java.lang.String GATEWAY_CONNECTION_READ_TIMEOUT_PROPERTY
The obsolete socket read timeout java system property. Since customers have been given this property, it is used to log a warning.- See Also:
- Constant Field Values
-
GATEWAY_CONNECTION_IDLE_TIMEOUT
static final int GATEWAY_CONNECTION_IDLE_TIMEOUT
-
removeFromQueueOnException
@Immutable static final org.apache.geode.logging.internal.deprecation.DeprecatedSystemProperty removeFromQueueOnException
-
REMOVE_FROM_QUEUE_ON_EXCEPTION
@Deprecated static final boolean REMOVE_FROM_QUEUE_ON_EXCEPTION
Deprecated.since GemFire 10.2, useGatewayReceiverFactory.setEventRetryAttempts(int)instead. If one wants to keep retrying failed event, retry attempts needs to be set to -1.If the System property is set, use it. Otherwise, set default to 'true'.
-
EARLY_ACK
static final boolean EARLY_ACK
-
DEFAULT_IS_PARALLEL
static final boolean DEFAULT_IS_PARALLEL
- See Also:
- Constant Field Values
-
DEFAULT_MUST_GROUP_TRANSACTION_EVENTS
@Deprecated static final boolean DEFAULT_MUST_GROUP_TRANSACTION_EVENTS
Deprecated.since GemFire 10.2, no replacement as this is no longer supported.- See Also:
- Constant Field Values
-
DEFAULT_IS_FOR_INTERNAL_USE
static final boolean DEFAULT_IS_FOR_INTERNAL_USE
- See Also:
- Constant Field Values
-
DEFAULT_ENFORCE_THREADS_CONNECT_SAME_RECEIVER
static final boolean DEFAULT_ENFORCE_THREADS_CONNECT_SAME_RECEIVER
- See Also:
- Constant Field Values
-
CONNECTION_RETRY_INTERVAL
static final int CONNECTION_RETRY_INTERVAL
Retry a connection from sender to receiver after specified time interval (in milliseconds) in case receiver is not up and running. Default is set to 1000 milliseconds i.e. 1 second.
-
GET_TRANSACTION_EVENTS_FROM_QUEUE_RETRIES
@Deprecated static final int GET_TRANSACTION_EVENTS_FROM_QUEUE_RETRIES
Deprecated.since GemFire 10.2, no replacement as this is no longer supported.Number of times to retry to get events for a transaction from the gateway sender queue when group-transaction-events is set to true. When group-transaction-events is set to true and a batch ready to be sent does not contain all the events for all the transactions to which the events belong, the gateway sender will try to get the missing events of the transactions from the queue to add them to the batch before sending it. If the missing events are not in the queue when the gateway sender tries to get them it will retry for a maximum of times equal to the value set in this parameter before delivering the batch without the missing events and logging an error. Setting this parameter to a very low value could cause that under heavy load and group-transaction-events set to true, batches are sent with incomplete transactions. Setting it to a high value could cause that under heavy load and group-transaction-events set to true, batches are held for some time before being sent.
-
GET_TRANSACTION_EVENTS_FROM_QUEUE_WAIT_TIME_MS
@Deprecated static final int GET_TRANSACTION_EVENTS_FROM_QUEUE_WAIT_TIME_MS
Deprecated.since GemFire 10.2, no replacement as this is no longer supported.Milliseconds to wait before retrying to get events for a transaction from the gateway sender queue when group-transaction-events is true.
-
-
Method Detail
-
start
void start()
Starts this GatewaySender. Once the GatewaySender is running, its configuration cannot be changed.
-
startWithCleanQueue
void startWithCleanQueue()
Starts this GatewaySender and discards previous queue content. Once the GatewaySender is running, its configuration cannot be changed.
-
stop
void stop()
Stops this GatewaySender. The scope of this operation is the VM on which it is invoked. In case the GatewaySender is parallel, the GatewaySender will be stopped on individual node where this API is called. If the GatewaySender is not parallel, then the GatewaySender will stop on this VM and the secondary GatewaySender will become primary and start dispatching events. The GatewaySender will wait for GatewaySender.MAXIMUM_SHUTDOWN_WAIT_TIME seconds before stopping itself. If the system property is set to -1 then it will wait until all the events are dispatched from the queue.- See Also:
isParallel()
-
pause
void pause()
Pauses the dispatching of the events from the underlying queue. It should be kept in mind that the events will still be getting queued into the queue. The scope of this operation is the VM on which it is invoked. In case the GatewaySender is parallel, the GatewaySender will be paused on individual node where this API is called and the GatewaySender on other VM's can still dispatch events. In case the GatewaySender is not parallel, and the running GatewaySender on which this API is invoked is not primary then PRIMARY GatewaySender will still continue dispatching events. The batch of events that are in the process of being dispatched are dispatched irrespective of the state of pause operation. We can expect maximum of one batch of events being received at the GatewayReceiver even after the GatewaySenders were paused.- See Also:
isParallel(),getBatchSize(),resume()
-
resume
void resume()
Resumes this paused GatewaySender.
-
rebalance
void rebalance()
Rebalances this GatewaySender.
-
isRunning
boolean isRunning()
Returns whether or not this GatewaySender is running.- Returns:
- whether this GatewaySender is running
-
isPaused
boolean isPaused()
Returns whether or not this GatewaySender is paused.- Returns:
- whether this GatewaySender is paused
-
addGatewayEventFilter
void addGatewayEventFilter(GatewayEventFilter filter)
Adds the providedGatewayEventFilterto this GatewaySender.- Parameters:
filter- theGatewayEventFilterto add
-
removeGatewayEventFilter
void removeGatewayEventFilter(GatewayEventFilter filter)
Removes the providedGatewayEventFilterfrom this GatewaySender.- Parameters:
filter- theGatewayEventFilterto remove
-
getGatewayEventSubstitutionFilter
GatewayEventSubstitutionFilter getGatewayEventSubstitutionFilter()
Returns thisGatewaySender'sGatewayEventSubstitutionFilter.- Returns:
- this
GatewaySender'sGatewayEventSubstitutionFilter
-
getId
java.lang.String getId()
Returns the id of this GatewaySender.- Returns:
- the id of this GatewaySender.
-
getRemoteDSId
int getRemoteDSId()
Returns the id of the remoteGatewayReceiver's DistributedSystem.- Returns:
- the id of the remote
GatewayReceiver's DistributedSystem.
-
getSocketBufferSize
int getSocketBufferSize()
Returns the configured buffer size of the socket connection between this GatewaySender and its receivingGatewayReceiver. The default is 32768 bytes.- Returns:
- the configured buffer size of the socket connection between this GatewaySender and its
receiving
GatewayReceiver
-
getSocketReadTimeout
int getSocketReadTimeout()
Returns the amount of time in milliseconds that a socket read between a sending GatewaySender and its receivingGatewayReceiverwill block. The default value is 0 which is interpreted as infinite timeout.- Returns:
- the amount of time in milliseconds that a socket read between a sending GatewaySender
and its receiving
GatewayReceiverwill block
-
getDiskStoreName
java.lang.String getDiskStoreName()
Gets the disk store name for overflow or persistence.- Returns:
- disk store name
-
getMaximumQueueMemory
int getMaximumQueueMemory()
Returns the maximum amount of memory (in MB) for a GatewaySender's queue. The default is 100.- Returns:
- maximum amount of memory (in MB) for a GatewaySender's queue
-
getBatchSize
int getBatchSize()
Returns the batch size for this GatewaySender. Default batchSize is 100.- Returns:
- the batch size for this GatewaySender.
-
getBatchTimeInterval
int getBatchTimeInterval()
Returns the batch time interval for this GatewaySender. Default value of batchTimeInterval is 1000.- Returns:
- the batch time interval for this GatewaySender
-
isBatchConflationEnabled
boolean isBatchConflationEnabled()
Answers whether to enable batch conflation for a GatewaySender 's queue. The default value is false.- Returns:
- whether to enable batch conflation for batches sent from a GatewaySender to its
corresponding
GatewayReceiver.
-
isPersistenceEnabled
boolean isPersistenceEnabled()
Returns true if persistence is enabled for this GatewaySender, otherwise returns false. Default is false if not set explicitly.- Returns:
- true if persistence is enabled for this GatewaySender
-
getAlertThreshold
int getAlertThreshold()
Returns the alert threshold in milliseconds for entries in a GatewaySender's queue. Default value is 0.- Returns:
- the alert threshold for entries in a GatewaySender's queue
-
getGatewayEventFilters
java.util.List<GatewayEventFilter> getGatewayEventFilters()
Returns the list ofGatewayEventFilteradded to this GatewaySender.- Returns:
- the list of
GatewayEventFilteradded to this GatewaySender.
-
getGatewayTransportFilters
@Deprecated java.util.List<GatewayTransportFilter> getGatewayTransportFilters()
Deprecated.for removal in a future release. No replacement is planned.Returns the list ofGatewayTransportFilteradded to this GatewaySender.- Returns:
- the list of
GatewayTransportFilteradded to this GatewaySender.
-
isDiskSynchronous
boolean isDiskSynchronous()
Returns isDiskSynchronous boolean property for this GatewaySender. Default value is true.- Returns:
- isDiskSynchronous boolean property for this GatewaySender
-
isManualStart
@Deprecated boolean isManualStart()
Deprecated.- Manual start of senders is deprecated and will be removed in a later release.Returns the manual start boolean property for this GatewaySender. Default is false i.e. the GatewaySender will automatically start once created.- Returns:
- the manual start boolean property for this GatewaySender
-
isParallel
boolean isParallel()
Returns isParallel boolean property for this GatewaySender.- Returns:
- isParallel boolean property for this GatewaySender
-
mustGroupTransactionEvents
@Deprecated boolean mustGroupTransactionEvents()
Deprecated.since GemFire 10.2, no replacement as this is no longer supported.Returns groupTransactionEvents boolean property for this GatewaySender.- Returns:
- groupTransactionEvents boolean property for this GatewaySender
-
getDispatcherThreads
int getDispatcherThreads()
Returns the number of dispatcher threads working for thisGatewaySender. Default number of dispatcher threads is 5.- Returns:
- the number of dispatcher threads working for this
GatewaySender
-
getOrderPolicy
GatewaySender.OrderPolicy getOrderPolicy()
Returns the order policy followed while dispatching the events to remote ds. Order policy is set only when dispatcher threads are > 1. Default value of order policy is KEY.- Returns:
- the order policy followed while dispatching the events to remote ds.
-
getMaxParallelismForReplicatedRegion
int getMaxParallelismForReplicatedRegion()
-
destroy
void destroy()
Destroys the GatewaySender.In case of ParallelGatewaySender, the destroy operation does distributed destroy of the Queue Region. In case of SerialGatewaySender, the Queue Region is destroyed locally.
- Since:
- Geode 1.1
-
getEnforceThreadsConnectSameReceiver
boolean getEnforceThreadsConnectSameReceiver()
Returns enforceThreadsConnectSameReceiver boolean property for this GatewaySender.- Returns:
- enforceThreadsConnectSameReceiver boolean property for this GatewaySender
-
getGatewayEventFailureListener
GatewayEventFailureListener getGatewayEventFailureListener()
Returns thisGatewaySender'sGatewayEventFailureListener.- Returns:
- this
GatewaySender'sGatewayEventFailureListener - Since:
- GemFire 10.2
-
-