VMware GemFire Java API Reference
Package org.apache.geode.cache.wan
Interface GatewaySenderFactory
-
public interface GatewaySenderFactoryFactory to create SerialGatewaySender- Since:
- GemFire 7.0
- See Also:
GatewaySender
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description GatewaySenderFactoryaddGatewayEventFilter(GatewayEventFilter filter)Adds aGatewayEventFilterGatewaySenderFactoryaddGatewayTransportFilter(GatewayTransportFilter filter)Adds aGatewayTransportFilterGatewaySendercreate(java.lang.String id, int remoteDSId)Creates aGatewaySenderto communicate with remote distributed systemGatewaySenderFactoryremoveGatewayEventFilter(GatewayEventFilter filter)Removes the providedGatewayEventFilterfrom this GatewaySender.GatewaySenderFactoryremoveGatewayTransportFilter(GatewayTransportFilter filter)Removes the providedGatewayTransportFilterfrom this GatewaySender.GatewaySenderFactorysetAlertThreshold(int threshold)Sets the alert threshold in milliseconds for entries in aGatewaySender's queue.GatewaySenderFactorysetBatchConflationEnabled(boolean isConflation)Sets whether to enable batch conflation for aGatewaySender's queue.GatewaySenderFactorysetBatchSize(int size)Sets the batch size to be picked at the time of dispatching from aGatewaySender's queue.GatewaySenderFactorysetBatchTimeInterval(int interval)Sets a time interval in milliseconds to wait to form a batch to be dispatched from aGatewaySender's queue.GatewaySenderFactorysetDiskStoreName(java.lang.String name)Sets the disk store name for overflow or persistenceGatewaySenderFactorysetDiskSynchronous(boolean isSynchronous)Sets whether or not the writing to the disk is synchronous.GatewaySenderFactorysetDispatcherThreads(int numThreads)Sets the number of dispatcher thread.GatewaySenderFactorysetEnforceThreadsConnectSameReceiver(boolean enforceThreadsConnectSameReceiver)If true, receiver member id is checked by all dispatcher threads when the connection is established to ensure they connect to the same receiver.GatewaySenderFactorysetGatewayEventSubstitutionFilter(GatewayEventSubstitutionFilter filter)Sets the providedGatewayEventSubstitutionFilterin this GatewaySenderFactory.GatewaySenderFactorysetGroupTransactionEvents(boolean groupTransactionEvents)Indicates whether events belonging to the same transaction must be delivered inside the same batch, i.e.GatewaySenderFactorysetManualStart(boolean start)Deprecated.- Manual start of senders is deprecated and will be removed in a later release.GatewaySenderFactorysetMaximumQueueMemory(int maxQueueMemory)Sets the maximum amount of memory (in MB) for aGatewaySender's queue.GatewaySenderFactorysetOrderPolicy(GatewaySender.OrderPolicy policy)SetsOrderPolicyfor this GatewaySender.GatewaySenderFactorysetParallel(boolean isParallel)Indicates whether all VMs need to distribute events to remote site.GatewaySenderFactorysetParallelFactorForReplicatedRegion(int parallel)GatewaySenderFactorysetPersistenceEnabled(boolean isPersistence)Sets whether to enable persistence for aGatewaySender's queue.GatewaySenderFactorysetSocketBufferSize(int size)Sets the buffer size in bytes of the socket connection for thisGatewaySender.GatewaySenderFactorysetSocketReadTimeout(int timeout)Sets the number of milliseconds to wait for a response from aGatewayReceiverbefore timing out the operation and trying anotherGatewayReceiver(if any are available).
-
-
-
Method Detail
-
setParallel
GatewaySenderFactory setParallel(boolean isParallel)
Indicates whether all VMs need to distribute events to remote site. In this case only the events originating in a particular VM will be dispatched in order.- Parameters:
isParallel- boolean to indicate whether distribution policy is parallel- Returns:
- this factory
-
setGroupTransactionEvents
GatewaySenderFactory setGroupTransactionEvents(boolean groupTransactionEvents)
Indicates whether events belonging to the same transaction must be delivered inside the same batch, i.e. they cannot be spread across different batches.groupTransactionEventscan be enabled only on parallel gateway senders or on serial gateway senders with just one dispatcher thread. It cannot be enabled if batch conflation is enabled.- Parameters:
groupTransactionEvents- boolean to indicate whether events from the same transaction must be delivered inside the same batch.- Returns:
- this factory
-
addGatewayEventFilter
GatewaySenderFactory addGatewayEventFilter(GatewayEventFilter filter)
Adds aGatewayEventFilter- Parameters:
filter- GatewayEventFilter- Returns:
- this factory
-
addGatewayTransportFilter
GatewaySenderFactory addGatewayTransportFilter(GatewayTransportFilter filter)
Adds aGatewayTransportFilter- Parameters:
filter- GatewayTransportFilter- Returns:
- this factory
-
setSocketBufferSize
GatewaySenderFactory setSocketBufferSize(int size)
Sets the buffer size in bytes of the socket connection for thisGatewaySender. The default is 32768 bytes.- Parameters:
size- The size in bytes of the socket buffer- Returns:
- this factory
-
setSocketReadTimeout
GatewaySenderFactory setSocketReadTimeout(int timeout)
Sets the number of milliseconds to wait for a response from aGatewayReceiverbefore timing out the operation and trying anotherGatewayReceiver(if any are available). Default is 0 which means infinite timeout.- Parameters:
timeout- number of milliseconds to wait for a response from a GatewayReceiver- Returns:
- this factory
- Throws:
java.lang.IllegalArgumentException- iftimeoutis less than0.
-
setDiskStoreName
GatewaySenderFactory setDiskStoreName(java.lang.String name)
Sets the disk store name for overflow or persistence- Parameters:
name- the disk store name for overflow or persistence- Returns:
- this factory
-
setDispatcherThreads
GatewaySenderFactory setDispatcherThreads(int numThreads)
Sets the number of dispatcher thread. Default number of dispatcher threads is 5.- Parameters:
numThreads- the number of dispatcher threads- Returns:
- this factory
-
setOrderPolicy
GatewaySenderFactory setOrderPolicy(GatewaySender.OrderPolicy policy)
SetsOrderPolicyfor this GatewaySender. Default order policy is KEY.- Parameters:
policy- theOrderPolicyfor this GatewaySender- Returns:
- this factory
-
setMaximumQueueMemory
GatewaySenderFactory setMaximumQueueMemory(int maxQueueMemory)
Sets the maximum amount of memory (in MB) for aGatewaySender's queue. Default is 100.- Parameters:
maxQueueMemory- The maximum amount of memory (in MB) for aGatewaySender's queue.- Returns:
- this factory
-
setBatchSize
GatewaySenderFactory setBatchSize(int size)
Sets the batch size to be picked at the time of dispatching from aGatewaySender's queue. Default batchSize is 100.- Parameters:
size- The size of batches sent from aGatewaySenderto its correspondingGatewayReceiver.- Returns:
- this factory
-
setBatchTimeInterval
GatewaySenderFactory setBatchTimeInterval(int interval)
Sets a time interval in milliseconds to wait to form a batch to be dispatched from aGatewaySender's queue. Default is 1000.- Parameters:
interval- The maximum time interval (in milliseconds) that can elapse before a partial batch is sent from aGatewaySenderto its correspondingGatewayReceiver.- Returns:
- this factory
-
setBatchConflationEnabled
GatewaySenderFactory setBatchConflationEnabled(boolean isConflation)
Sets whether to enable batch conflation for aGatewaySender's queue. Default is false.- Parameters:
isConflation- Whether or not to enable batch conflation for batches sent from aGatewaySenderto its correspondingGatewayReceiver.- Returns:
- this factory
-
setPersistenceEnabled
GatewaySenderFactory setPersistenceEnabled(boolean isPersistence)
Sets whether to enable persistence for aGatewaySender's queue. Default is false.- Parameters:
isPersistence- Whether to enable persistence for aGatewaySender's queue- Returns:
- this factory
-
setAlertThreshold
GatewaySenderFactory setAlertThreshold(int threshold)
Sets the alert threshold in milliseconds for entries in aGatewaySender's queue. Default value is 0.- Parameters:
threshold- the alert threshold for entries in aGatewaySender's queue- Returns:
- this factory
-
setManualStart
@Deprecated GatewaySenderFactory setManualStart(boolean start)
Deprecated.- Manual start of senders is deprecated and will be removed in a later release.Sets the manual start boolean property for thisGatewaySender. Default is false i.e. theGatewaySenderwill automatically start once created.- Parameters:
start- the manual start boolean property for thisGatewaySender- Returns:
- this factory
-
setDiskSynchronous
GatewaySenderFactory setDiskSynchronous(boolean isSynchronous)
Sets whether or not the writing to the disk is synchronous. Default is true.- Parameters:
isSynchronous- boolean if true indicates synchronous writes- Returns:
- this factory
-
removeGatewayEventFilter
GatewaySenderFactory removeGatewayEventFilter(GatewayEventFilter filter)
Removes the providedGatewayEventFilterfrom this GatewaySender.- Parameters:
filter- theGatewayEventFilterto remove- Returns:
- this factory
-
removeGatewayTransportFilter
GatewaySenderFactory removeGatewayTransportFilter(GatewayTransportFilter filter)
Removes the providedGatewayTransportFilterfrom this GatewaySender.- Parameters:
filter- theGatewayTransportFilterto remove- Returns:
- this factory
-
setParallelFactorForReplicatedRegion
GatewaySenderFactory setParallelFactorForReplicatedRegion(int parallel)
-
setGatewayEventSubstitutionFilter
GatewaySenderFactory setGatewayEventSubstitutionFilter(GatewayEventSubstitutionFilter filter)
Sets the providedGatewayEventSubstitutionFilterin this GatewaySenderFactory.- Parameters:
filter- TheGatewayEventSubstitutionFilter- Returns:
- this factory
-
setEnforceThreadsConnectSameReceiver
GatewaySenderFactory setEnforceThreadsConnectSameReceiver(boolean enforceThreadsConnectSameReceiver)
If true, receiver member id is checked by all dispatcher threads when the connection is established to ensure they connect to the same receiver. Instead of starting all dispatcher threads in parallel, one thread is started first, and after that the rest are started in parallel. Default is false.- Parameters:
enforceThreadsConnectSameReceiver- boolean if true threads will verify if they are connected to the same receiver- Returns:
- this factory
-
create
GatewaySender create(java.lang.String id, int remoteDSId)
Creates aGatewaySenderto communicate with remote distributed system- Parameters:
id- unique id for this SerialGatewaySenderremoteDSId- unique id representing the remote distributed system- Returns:
- instance of SerialGatewaySender
- Throws:
java.lang.IllegalStateException- If the GatewaySender creation fails during validation due to mismatch of attributes of GatewaySender created on other nodes with same id
-
-