Class RntbdTransportClient.Options.Builder

  • Enclosing class:
    RntbdTransportClient.Options

    public static class RntbdTransportClient.Options.Builder
    extends Object
    A builder for constructing RntbdTransportClient.Options instances.

    Using system properties to set the default RntbdTransportClient.Options used by an RntbdTransportClient.Options.Builder

    A default options instance is created when the RntbdTransportClient.Options.Builder class is initialized. This instance specifies the default options used by every RntbdTransportClient.Options.Builder instance. In priority order the default options instance is created from:

    1. The JSON value of system property azure.cosmos.directTcp.defaultOptions.

      Example:

      -Dazure.cosmos.directTcp.defaultOptions={\"maxChannelsPerEndpoint\":5,\"maxRequestsPerChannel\":30}
    2. The contents of the JSON file located by system property azure.cosmos.directTcp .defaultOptionsFile.

      Example:

      -Dazure.cosmos.directTcp.defaultOptionsFile=/path/to/default/options/file
    3. The contents of JSON resource file azure.cosmos.directTcp.defaultOptions.json.

      Specifically, the resource file is read from this stream:

      RntbdTransportClient.class.getClassLoader().getResourceAsStream("azure.cosmos.directTcp.defaultOptions.json")

      Example:

      {
         "bufferPageSize": 8192,
         "connectionTimeout": "PT1M",
         "idleChannelTimeout": "PT0S",
         "idleEndpointTimeout": "PT1M10S",
         "maxBufferCapacity": 8388608,
         "maxChannelsPerEndpoint": 10,
         "maxRequestsPerChannel": 30,
         "receiveHangDetectionTime": "PT1M5S",
         "requestExpiryInterval": "PT5S",
         "requestTimeout": "PT1M",
         "requestTimerResolution": "PT0.5S",
         "sendHangDetectionTime": "PT10S",
         "shutdownTimeout": "PT15S"
       }

    JSON value errors are logged and then ignored. If none of the above values are available or all available values are in error, the default options instance is created from the private parameterless constructor for RntbdTransportClient.Options.