{
  "$schema" : "https://json-schema.org/draft/2020-12/schema",
  "$id" : "https://voltdb.com/voltsp/schemas/sink/voltdb-bulk-insert",
  "title" : "Voltdb-bulk-insert Sink Configuration",
  "description" : "This sink is suitable for efficiently inserting large volumes of data into VoltDB.\n\nThe `voltdb-bulk-insert` sink is used to insert data into a VoltDB table in batches. It supports configurations such\nas batch size, flush interval, table name, and the type of bulk operation (`INSERT` or `UPSERT`).\n\nThe `voltdb-bulk-insert` operator requires VoltDBResource to be configured either in yaml or in java, see examples.\n",
  "type" : "object",
  "properties" : {
    "voltdb-bulk-insert" : {
      "type" : "object",
      "properties" : {
        "voltClientResource" : {
          "description" : "Client resource reference to be used when connecting to VoltDb cluster",
          "anyOf" : [ {
            "type" : "string"
          }, {
            "$ref" : "resource-voltdb-client.schema.json#/properties/voltdb-client"
          } ]
        },
        "operationType" : {
          "type" : "string",
          "description" : "The type of bulk operation to perform, either INSERT or UPSERT. INSERT adds new records, while UPSERT updates existing records or inserts new ones.",
          "default" : "INSERT",
          "enum" : [ "insert", "upsert", "INSERT", "UPSERT" ]
        },
        "batchSize" : {
          "type" : "integer",
          "description" : "The maximum number of records to include in a single batch for insertion. Larger batches can improve performance but require more memory.",
          "default" : "100000",
          "minimum" : -2147483648,
          "maximum" : 2147483647
        },
        "flushInterval" : {
          "type" : "string",
          "pattern" : "^(\\d+[smhd]|P(T|\\d+[YMD]).*)",
          "description" : "The maximum time to wait for the desired batch size before forcing a data flush to VoltDB.",
          "default" : "1s"
        },
        "exceptionHandler" : {
          "type" : "string",
          "description" : "A custom exception handler to manage errors encountered during data insertion."
        }
      },
      "required" : [ "voltClientResource" ],
      "additionalProperties" : false
    }
  },
  "required" : [ "voltdb-bulk-insert" ],
  "additionalProperties" : false
}
