oracle.kv

## Class RequestLimitConfig

- java.lang.Object
- - oracle.kv.RequestLimitConfig

-     public class RequestLimitConfig
      extends Object

  Describes how requests may be limited so that one or more nodes with long service times don't end up consuming all available threads in the KVS client.
  See Also:
    `KVStoreConfig.setRequestLimit(oracle.kv.RequestLimitConfig)`, `RequestLimitException`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_MAX_ACTIVE_REQUESTS` The default values for limiting requests to a particular node.
    `static int` | `DEFAULT_NODE_LIMIT_PERCENT`
    `static int` | `DEFAULT_REQUEST_THRESHOLD_PERCENT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RequestLimitConfig(int maxActiveRequests, int requestThresholdPercent, int nodeLimitPercent)` Creates a request limiting configuration.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static RequestLimitConfig` | `getDefault()`
    `int` | `getMaxActiveRequests()` Returns the maximum number of active requests permitted by the KVS client.
    `int` | `getNodeLimit()` Returns the maximum number of requests that may be active at a node.
    `int` | `getNodeLimitPercent()` Returns the percentage used to compute the maximum number of requests that may be active at a node.
    `int` | `getRequestThreshold()` Returns the threshold number of requests above which the request limiting mechanism is activated.
    `int` | `getRequestThresholdPercent()` Returns the percentage used to compute the active request threshold above which the request limiting mechanism is activated.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_MAX_ACTIVE_REQUESTS

          public static final int DEFAULT_MAX_ACTIVE_REQUESTS

      The default values for limiting requests to a particular node.
      See Also:
        Constant Field Values

    - #### DEFAULT_REQUEST_THRESHOLD_PERCENT

          public static final int DEFAULT_REQUEST_THRESHOLD_PERCENT

      See Also:
        Constant Field Values

    - #### DEFAULT_NODE_LIMIT_PERCENT

          public static final int DEFAULT_NODE_LIMIT_PERCENT

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### RequestLimitConfig

          public RequestLimitConfig(int maxActiveRequests,
                            int requestThresholdPercent,
                            int nodeLimitPercent)

      Creates a request limiting configuration. The request limiting mechanism is only activated when the number of active requests exceeds the threshold specified by the parameter `requestThresholdPercent`. Both the threshold and limit parameters below are expressed as a percentage of `maxActiveRequests`.

      When the mechanism is active the number of active requests to a node is not allowed to exceed `nodeRequestLimitPercent`. Any new requests that would exceed this limit are rejected and a `RequestLimitException` is thrown.

      For example, consider a configuration with maxActiveRequests=10, requestThresholdPercent=80 and nodeLimitPercent=50. If 8 requests are already active at the client, and a 9th request is received that would be directed at a node which already has 5 active requests, it would result in a `RequestLimitException` being thrown. If only 7 requests were active at the client, the 8th request would be directed at the node with 5 active requests and the request would be processed normally.

      Parameters:
        `maxActiveRequests` - the maximum number of active requests permitted by the KV client. This number is typically derived from the maximum number of threads that the client has set aside for processing requests. The default is 100. Note that the KVStore does not actually enforce this maximum directly. It only uses this parameter as the basis for calculating the requests limits to be enforced at a node.
        `requestThresholdPercent` - the threshold computed as a percentage of `maxActiveRequests` at which requests are limited. The default is 90.
        `nodeLimitPercent` - determines the maximum number of active requests that can be associated with a node when the request limiting mechanism is active. The default is 80.

  - ### Method Detail

    - #### getMaxActiveRequests

          public int getMaxActiveRequests()

      Returns the maximum number of active requests permitted by the KVS client.

      The default value is 100.

    - #### getRequestThresholdPercent

          public int getRequestThresholdPercent()

      Returns the percentage used to compute the active request threshold above which the request limiting mechanism is activated.

      The default value is 90.

    - #### getRequestThreshold

          public int getRequestThreshold()

      Returns the threshold number of requests above which the request limiting mechanism is activated.

    - #### getNodeLimitPercent

          public int getNodeLimitPercent()

      Returns the percentage used to compute the maximum number of requests that may be active at a node.

      The default value is 80.

    - #### getNodeLimit

          public int getNodeLimit()

      Returns the maximum number of requests that may be active at a node.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getDefault

          public static RequestLimitConfig getDefault()

Copyright (c) 2011, 2014 Oracle and/or its affiliates. All rights reserved.