{
  "$schema" : "https://json-schema.org/draft/2020-12/schema",
  "$id" : "https://voltdb.com/voltsp/schemas/resource/voltdb-client",
  "title" : "Voltdb-client Resource Configuration",
  "description" : "The `voltdb-client` resource configures and exposes org.voltdb.Client instance.\nThe resource has to be added do pipeline builder when defining pipeline in java, but can be fully configured in yaml properties, see example.\n```java\npublic void define(VoltStreamBuilder sb) {\n    // resources\n    sb.configureResource(voltClientReferenceName, VoltDBResourceConfigBuilder.class);\n}\n```\n\nAdvanced users that need direct access to a VoltDB cluster do not need to configure and\ninstantiate it manually. VoltSP uses built in mechanisms to provide a production quality setup.\n\nUser can relay on VoltSP standard configuration options to customise this resource.\n\nAs with the VoltDB flavored emitters and sinks this resource works with arrays of `Object`-s that correspond to stored procedure arguments.\n E.g. to invoke a stored procedure that has `public long run(long id, int anotherId, String someString)` method\n the `Object[]` should contain `Long`, `Integer` and `String` or compatible types as defined in the VoltDB\n  [documentation](https://docs.voltactivedata.com/UsingVoltDB/AppxDatatype.php).\n\nIn case of the downstream system error this resource will retry procedure execution with exponential backoff.\nThe details of this behaviour are configurable using retry configuration that is nested within client\nconfiguration.\n\nNote that there are guarantees about at-lest-once delivery other than what VoltDB provides natively.\n\nWhen configuring servers to connect to it is enough to provide just one server and VoltDB client will\ndiscover the whole cluster topology, including partition assignment.\nIn yaml configuration the `servers` field can be provided as a comma separated string or a list of individual host:port entries.\n",
  "type" : "object",
  "properties" : {
    "voltdb-client" : {
      "type" : "object",
      "properties" : {
        "servers" : {
          "description" : "A set of host and port addresses for connecting to the VoltDB cluster. Only one address is sufficient for cluster topology discovery.",
          "anyOf" : [ {
            "type" : "array",
            "uniqueItems" : true,
            "items" : {
              "type" : "string",
              "anyOf" : [ {
                "type" : "string",
                "format" : "hostname"
              }, {
                "type" : "string",
                "format" : "ipv4"
              }, {
                "type" : "string",
                "format" : "ipv6"
              } ]
            }
          }, {
            "type" : "string"
          } ]
        },
        "client" : {
          "type" : "object",
          "description" : "Configuration settings for the VoltDB client, including retry policies, transaction limits, and authentication credentials.",
          "properties" : {
            "retry" : {
              "type" : "object",
              "description" : "Configuration for retrying failed operations, including the number of retries and backoff delays.",
              "properties" : {
                "retries" : {
                  "type" : "integer",
                  "description" : "Number of retry attempts after a request failure.",
                  "default" : "3",
                  "minimum" : -2147483648,
                  "maximum" : 2147483647
                },
                "backoffDelay" : {
                  "type" : "string",
                  "pattern" : "^(\\d+[smhd]|P(T|\\d+[YMD]).*)",
                  "description" : "Initial delay before the first retry attempt.",
                  "default" : "PT0.2S"
                },
                "maxBackoffDelay" : {
                  "type" : "string",
                  "pattern" : "^(\\d+[smhd]|P(T|\\d+[YMD]).*)",
                  "description" : "Maximum delay between consecutive retry attempts.",
                  "default" : "PT3S"
                }
              },
              "additionalProperties" : false
            },
            "maxTransactionsPerSecond" : {
              "type" : "integer",
              "description" : "The maximum number of transactions allowed per second to control the rate of operations.",
              "minimum" : -2147483648,
              "maximum" : 2147483647
            },
            "maxOutstandingTransactions" : {
              "type" : "integer",
              "description" : "The maximum number of outstanding transactions allowed, limiting concurrent operations.",
              "minimum" : -2147483648,
              "maximum" : 2147483647
            },
            "requestTimeout" : {
              "type" : "string",
              "pattern" : "^(\\d+[smhd]|P(T|\\d+[YMD]).*)",
              "description" : "The timeout duration for client requests to VoltDB, after which a request is considered failed."
            },
            "responseThreadCount" : {
              "type" : "integer",
              "description" : "Size of the thread pool that dispatches procedure-call responses.\n",
              "default" : "4",
              "minimum" : -2147483648,
              "maximum" : 2147483647
            },
            "auth" : {
              "type" : "object",
              "description" : "Client credentials for authenticating to the VoltDB cluster.",
              "properties" : {
                "username" : {
                  "type" : "string",
                  "description" : "Username used for authentication."
                },
                "password" : {
                  "type" : "string",
                  "description" : "Password used for authentication."
                }
              },
              "additionalProperties" : false
            },
            "ssl" : {
              "type" : "object",
              "description" : "Client configuration for secure transport to the VoltDB cluster.",
              "properties" : {
                "trustStoreFile" : {
                  "type" : "string",
                  "description" : "Truststore file or trusted CA certificate; supported formats include JKS, PKCS#12, or PEM."
                },
                "trustStorePassword" : {
                  "type" : "string",
                  "description" : "Truststore password."
                },
                "keyStoreFile" : {
                  "type" : "string",
                  "description" : "Keystore file; supported formats include JKS, PKCS#12, or PEM"
                },
                "keyStorePassword" : {
                  "type" : "string",
                  "description" : "Keystore password."
                },
                "keyPassword" : {
                  "type" : "string",
                  "description" : "Private key password. Optional — if not set, the key store password will be used."
                },
                "insecure" : {
                  "type" : "boolean",
                  "description" : "If set to true, disables SSL certificate and hostname validation.\nIntended for debugging purposes only. Doesn't work with mTLS.\n"
                },
                "hostnameVerifier" : {
                  "type" : "string",
                  "description" : "Custom hostname verifier for SSL connections.\nIf not specified and 'insecure' is true, hostname verification will be disabled.\n"
                }
              },
              "additionalProperties" : false
            }
          },
          "additionalProperties" : false
        }
      },
      "required" : [ "servers" ],
      "additionalProperties" : false
    }
  },
  "required" : [ "voltdb-client" ],
  "additionalProperties" : false
}
