Class ServiceClientTuning
- Direct Known Subclasses:
StatefulServiceClientTuning
Connect timeoutNumber of period that iden Heartbeat Activation Period CountHeartbeat Dead Connection Period CountHeartbeat Polling PeriodSearch Instance Map timeout
Notice modified these properties can prevent the client to start or make the High Availability process unstable. Ensure that you understand the consequences of your modification, contact your SAP Support Team for further information.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intConstant describing the default value for the connect timeout; Default is 10,000 ms.static final intConstant describing the default value of the heartbeat activation period count; Default is 1.static final intConstant describing the default value of the heartbeat dead connection period count; Default is 2.static final intConstant describing the default polling period of the heartbeat; Default is 2,000 milliseconds.static final intConstant describing the default maximum duration of the search instance map operation; Default is 30 seconds. -
Constructor Summary
ConstructorsConstructorDescriptionInitializes a ServiceClientTuning with the default options:SEARCH_INSTANCE_MAP_DEFAULT_TIMEOUT,HEARTBEAT_DEFAULT_POLLING_PERIOD,HEARTBEAT_DEFAULT_ACTIVATION_PERIOD_COUNT, andHEARTBEAT_DEFAULT_DEAD_CONNECTION_PERIOD_COUNT.ServiceClientTuning(int searchInstanceMapDurationInSecond, int heartBeatPollingPeriodInMilliSecond, int heartBeatActivationPeriodCount, int heartBeatDeadConnectionPeriodCount) Initializes a ServiceClientTuning with the specified options; Refer to the related methods detailled in the See Also section. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the max duration in millisecond to wait before to declared that a connecting operation has failed.intReturns the number of polling period of the heartbeat service before to declare a connection not used.intReturns the number of heartbeat service polling period before to declare a server instance is down.intReturns the polling period of the heartbeat service.intReturns the maximum duration of the searching instance map operation.booleanReturns if the debug mode is enable or not; This mode sets all the timeout to NO_TIMEOUT.voidsetConnectTimeout(int timeoutInMillisecond) Sets the maximum duration (in millisecond) to wait before to declared that a connecting operation has failed.voidsetHeartBeatActivationPeriodCount(int periodCount) Sets the number of polling periods (of the heartbeat service) that describes the inactivity duration of a connection after which the heartbeat will be activated on this connection.voidsetHeartBeatDeadConnectionPeriodCount(int periodCount) Sets the number of polling periods (of the heartbeat service) that describes the timeout after which an instance of the SAP CC system which has not replied to a heartbeat ping message, will be considered as down.voidsetHeartBeatPollingPeriod(int periodInMilliSecond) Sets the polling period of the heartbeat service.voidsetSearchInstanceMapTimeout(int durationInSecond) Sets the max duration of the searching instance map operation including the connection opening with the remote instance.
-
Field Details
-
SEARCH_INSTANCE_MAP_DEFAULT_TIMEOUT
public static final int SEARCH_INSTANCE_MAP_DEFAULT_TIMEOUTConstant describing the default maximum duration of the search instance map operation; Default is 30 seconds.- See Also:
-
HEARTBEAT_DEFAULT_POLLING_PERIOD
public static final int HEARTBEAT_DEFAULT_POLLING_PERIODConstant describing the default polling period of the heartbeat; Default is 2,000 milliseconds.- See Also:
-
HEARTBEAT_DEFAULT_ACTIVATION_PERIOD_COUNT
public static final int HEARTBEAT_DEFAULT_ACTIVATION_PERIOD_COUNTConstant describing the default value of the heartbeat activation period count; Default is 1.- See Also:
-
HEARTBEAT_DEFAULT_DEAD_CONNECTION_PERIOD_COUNT
public static final int HEARTBEAT_DEFAULT_DEAD_CONNECTION_PERIOD_COUNTConstant describing the default value of the heartbeat dead connection period count; Default is 2.- See Also:
-
CONNECT_TIMEOUT
public static final int CONNECT_TIMEOUTConstant describing the default value for the connect timeout; Default is 10,000 ms.- See Also:
-
-
Constructor Details
-
ServiceClientTuning
public ServiceClientTuning()Initializes a ServiceClientTuning with the default options:SEARCH_INSTANCE_MAP_DEFAULT_TIMEOUT,HEARTBEAT_DEFAULT_POLLING_PERIOD,HEARTBEAT_DEFAULT_ACTIVATION_PERIOD_COUNT, andHEARTBEAT_DEFAULT_DEAD_CONNECTION_PERIOD_COUNT.Refer to these constant values.
-
ServiceClientTuning
public ServiceClientTuning(int searchInstanceMapDurationInSecond, int heartBeatPollingPeriodInMilliSecond, int heartBeatActivationPeriodCount, int heartBeatDeadConnectionPeriodCount) Initializes a ServiceClientTuning with the specified options; Refer to the related methods detailled in the See Also section.Note
If the system property
transactive.debug.modeexists, the client is initialized in modedebug. The modedebugdisables the Heartbeat service and sets the timeouts toNO_TIMEOUT. The specified timeouts are ignored.- Parameters:
searchInstanceMapDurationInSecond- The timeout of the search instance mapheartBeatPollingPeriodInMilliSecond- The heart beat polling periodheartBeatActivationPeriodCount- The heat beat activation polling period countheartBeatDeadConnectionPeriodCount- The heart beat dead connection polling period count- See Also:
-
-
Method Details
-
setSearchInstanceMapTimeout
public void setSearchInstanceMapTimeout(int durationInSecond) Sets the max duration of the searching instance map operation including the connection opening with the remote instance.When the service client is connecting to the service server, it asks the boot server for the instance map. This operation can fail because the boot server is down or does not replied. This timeout is the max duration the client has to expect a reply from the server system. If this timeout is expired without replied, the client stops. Its default value is
SEARCH_INSTANCE_MAP_DEFAULT_TIMEOUT.
If the server is down, the client may not wait this duration but stop immediatly. This timeout is useful when the server is running but cannot be reached by the client (ip interface down, firewall issues, etc...). In this case the client will take a long time before to stop. This timeout limit this duration. Of course, a too small timeout can prevent client for starting.- Parameters:
durationInSecond- A duration in second orConstants.NO_TIMEOUTif the timeout is not useful.- Throws:
IllegalArgumentException- if durationInSecond is not equalsConstants.NO_TIMEOUTand is negative.
-
getSearchInstanceMapTimeout
public int getSearchInstanceMapTimeout()Returns the maximum duration of the searching instance map operation.- Returns:
- The duration in second or
Constants.NO_TIMEOUTif no timeout is needed - See Also:
-
setHeartBeatPollingPeriod
public void setHeartBeatPollingPeriod(int periodInMilliSecond) Sets the polling period of the heartbeat service.Useful only if the High Availability service is enabled (At least one rating instance backup is defined in the instance map), it is the duration between two heartbeat service activations. This service detects down or new restarted instances sending at each activation ping messages to the instances and makes the switches to or from the backups when useful.
Smaller is this value, faster is the detection of down or restarted instances and smaller is the service interruption, but more the network resources will be used. A too high value will make the service interruption longer but the network resources will be less used when all goes well.Its default value is
HEARTBEAT_DEFAULT_POLLING_PERIOD.- Parameters:
periodInMilliSecond- The period in millisecond- Throws:
IllegalArgumentException- if periodInMilliSecond is smaller than 1
-
getHeartBeatPollingPeriod
public int getHeartBeatPollingPeriod()Returns the polling period of the heartbeat service.- Returns:
- A period in millisecond
- See Also:
-
setHeartBeatActivationPeriodCount
public void setHeartBeatActivationPeriodCount(int periodCount) Sets the number of polling periods (of the heartbeat service) that describes the inactivity duration of a connection after which the heartbeat will be activated on this connection.The activation period is
periodCount*. If a connection has not been used during at least the activation period, the heartbeat will be activated and will start to detect if the connection is down or not (executing ping operation).getHeartBeatPollingPeriod()
This parameter is useful to prevent to use of network resource when the client is in full charge.
Its default value is:HEARTBEAT_DEFAULT_ACTIVATION_PERIOD_COUNT.- Parameters:
periodCount- A positive number- Throws:
IllegalArgumentException- ifperiodCountis negative- See Also:
-
getHeartBeatActivationPeriodCount
public int getHeartBeatActivationPeriodCount()Returns the number of polling period of the heartbeat service before to declare a connection not used.- Returns:
- A positive number
- See Also:
-
setHeartBeatDeadConnectionPeriodCount
public void setHeartBeatDeadConnectionPeriodCount(int periodCount) Sets the number of polling periods (of the heartbeat service) that describes the timeout after which an instance of the SAP CC system which has not replied to a heartbeat ping message, will be considered as down.The dead connection period is
periodCount*. If an instance has not replied to a heart beat ping message before this timeout has expired, it is considered as down. A too small value makes the heartbeat service detect down connection even if the instance is running. At the opposite a too high value will make service interruption with a really down instance very long.#getHeartBeatPollingPeriod()
Its default value is:HEARTBEAT_DEFAULT_DEAD_CONNECTION_PERIOD_COUNT.- Parameters:
periodCount- A positive number greather than 0- Throws:
IllegalArgumentException- ifperiodCountis out of range- See Also:
-
getHeartBeatDeadConnectionPeriodCount
public int getHeartBeatDeadConnectionPeriodCount()Returns the number of heartbeat service polling period before to declare a server instance is down.- Returns:
- A positive number greater than 0
- See Also:
-
setConnectTimeout
public void setConnectTimeout(int timeoutInMillisecond) Sets the maximum duration (in millisecond) to wait before to declared that a connecting operation has failed.This timeout is useful to detect the down instance faster.
- A too small value prevents the connection to be established.
- A too high value make the service interruption longer.
Its default value is
CONNECT_TIMEOUT.- Parameters:
timeoutInMillisecond- The timeout in millisecond positive, 0, orNO_TIMEOUT- Throws:
IllegalArgumentException- if connectTimeoutInMilliSecond is out of range
-
getConnectTimeout
public int getConnectTimeout()Returns the max duration in millisecond to wait before to declared that a connecting operation has failed.- Returns:
- A positive value or
NO_TIMEOUT
-
isDebugModeEnable
public boolean isDebugModeEnable()Returns if the debug mode is enable or not; This mode sets all the timeout to NO_TIMEOUT.- Returns:
trueif the debug mode is enabled,falseotherwise
-