org.apache.geode.cache.wan.GatewaySenderFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of geode-core Show documentation
Show all versions of geode-core Show documentation
Apache Geode provides a database-like consistency model, reliable transaction processing and a shared-nothing architecture to maintain very low latency performance with high concurrency processing
/*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
* copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package org.apache.geode.cache.wan;
import org.apache.geode.cache.wan.GatewaySender.OrderPolicy;
/**
* Factory to create SerialGatewaySender
*
*
* @since GemFire 7.0
* @see GatewaySender
*
*/
public interface GatewaySenderFactory {
/**
* Indicates whether all VMs need to distribute events to remote site. In this case only the
* events originating in a particular VM will be in dispatched in order.
*
* @param isParallel boolean to indicate whether distribution policy is parallel
*/
public GatewaySenderFactory setParallel(boolean isParallel);
/**
* Adds a GatewayEventFilter
*
* @param filter GatewayEventFilter
*/
public GatewaySenderFactory addGatewayEventFilter(GatewayEventFilter filter);
/**
* Adds a GatewayTransportFilter
*
* @param filter GatewayTransportFilter
*/
public GatewaySenderFactory addGatewayTransportFilter(GatewayTransportFilter filter);
/**
* Sets the buffer size in bytes of the socket connection for this GatewaySender
. The
* default is 32768 bytes.
*
* @param size The size in bytes of the socket buffer
*/
public GatewaySenderFactory setSocketBufferSize(int size);
/**
* Sets the number of milliseconds to wait for a response from a GatewayReceiver
* before timing out the operation and trying another GatewayReceiver
(if any are
* available). Default is 0 which means infinite timeout.
*
* @param timeout number of milliseconds to wait for a response from a GatewayReceiver
* @throws IllegalArgumentException if timeout
is less than 0
.
*/
public GatewaySenderFactory setSocketReadTimeout(int timeout);
/**
* Sets the disk store name for overflow or persistence
*
* @param name
*/
public GatewaySenderFactory setDiskStoreName(String name);
/**
* Sets the number of dispatcher thread. Default number of dispatcher threads is 5.
*
* @param numThreads
*/
public GatewaySenderFactory setDispatcherThreads(int numThreads);
/**
* Sets OrderPolicy
for this GatewaySender. Default order policy is KEY.
*
* @param policy
*/
public GatewaySenderFactory setOrderPolicy(OrderPolicy policy);
/**
* Sets the maximum amount of memory (in MB) for a GatewaySender
's queue. Default is
* 100.
*
* @param maxQueueMemory The maximum amount of memory (in MB) for a GatewaySender
's
* queue.
*/
public GatewaySenderFactory setMaximumQueueMemory(int maxQueueMemory);
/**
* Sets the batch size to be picked at the time of dispatching from a GatewaySender
's
* queue. Default batchSize is 100.
*
* @param size The size of batches sent from a GatewaySender
to its corresponding
* GatewayReceiver
.
*/
public GatewaySenderFactory setBatchSize(int size);
/**
* Sets a time interval in milliseconds to wait to form a batch to be dispatched from a
* GatewaySender
's queue. Default is 1000.
*
* @param interval The maximum time interval (in milliseconds) that can elapse before a partial
* batch is sent from a GatewaySender
to its corresponding
* GatewayReceiver
.
*/
public GatewaySenderFactory setBatchTimeInterval(int interval);
/**
* Sets whether to enable batch conflation for a GatewaySender
's queue. Default is
* false.
*
* @param isConflation Whether or not to enable batch conflation for batches sent from a
* GatewaySender
to its corresponding GatewayReceiver
.
*/
public GatewaySenderFactory setBatchConflationEnabled(boolean isConflation);
/**
* Sets whether to enable persistence for a GatewaySender
's queue. Default is false.
*
* @param isPersistence Whether to enable persistence for a GatewaySender
's queue
*/
public GatewaySenderFactory setPersistenceEnabled(boolean isPersistence);
/**
* Sets the alert threshold in milliseconds for entries in a GatewaySender
's queue.
* Default value is 0.
*
* @param threshold the alert threshold for entries in a GatewaySender
's queue
*/
public GatewaySenderFactory setAlertThreshold(int threshold);
/**
* Sets the manual start boolean property for this GatewaySender
. Default is false
* i.e. the GatewaySender
will automatically start once created.
*
* @param start the manual start boolean property for this GatewaySender
*/
public GatewaySenderFactory setManualStart(boolean start);
/**
* Sets whether or not the writing to the disk is synchronous. Default is true.
*
* @param isSynchronous boolean if true indicates synchronous writes
*
*/
public GatewaySenderFactory setDiskSynchronous(boolean isSynchronous);
/**
* Removes the provided GatewayEventFilter
from this GatewaySender.
*
* @param filter
*/
public GatewaySenderFactory removeGatewayEventFilter(GatewayEventFilter filter);
/**
* Removes the provided GatewayTransportFilter
from this GatewaySender.
*
* @param filter
*/
public GatewaySenderFactory removeGatewayTransportFilter(GatewayTransportFilter filter);
public GatewaySenderFactory setParallelFactorForReplicatedRegion(int parallel);
/**
* Sets the provided GatewayEventSubstitutionFilter
in this GatewaySenderFactory.
*
* @param filter The GatewayEventSubstitutionFilter
*/
public GatewaySenderFactory setGatewayEventSubstitutionFilter(
GatewayEventSubstitutionFilter filter);
/**
* Creates a GatewaySender
to communicate with remote distributed system
*
* @param id unique id for this SerialGatewaySender
* @param remoteDSId unique id representing the remote distributed system
* @return instance of SerialGatewaySender
* @throws IllegalStateException If the GatewaySender creation fails during validation due to
* mismatch of attributes of GatewaySender created on other nodes with same id
*/
public GatewaySender create(String id, int remoteDSId);
}