Class InsertSettings

java.lang.Object
com.clickhouse.client.api.insert.InsertSettings

public class InsertSettings extends Object
  • Constructor Details

    • InsertSettings

      public InsertSettings()
    • InsertSettings

      public InsertSettings(Map<String,Object> settings)
  • Method Details

    • getOption

      public Object getOption(String option)
      Gets a configuration option.
      Parameters:
      option - - configuration option name
      Returns:
      configuration option value
    • setOption

      public InsertSettings setOption(String option, Object value)
      Sets a configuration option. This method can be used to set any configuration option. There is no specific validation is done on the key or value.
      Parameters:
      option - - configuration option name
      value - - configuration option value
    • getAllSettings

      public Map<String,Object> getAllSettings()
      Get all settings as an unmodifiable map.
      Returns:
      all settings
    • setDeduplicationToken

      public InsertSettings setDeduplicationToken(String token)
      Sets the deduplication token. This token will be sent to the server and can be used to identify the query.
      Parameters:
      token - - deduplication token
      Returns:
    • getQueryId

      public String getQueryId()
    • setQueryId

      public InsertSettings setQueryId(String queryId)
      Sets the query id. This id will be sent to the server and can be used to identify the query.
    • getInputStreamCopyBufferSize

      public int getInputStreamCopyBufferSize()
    • setInputStreamCopyBufferSize

      public InsertSettings setInputStreamCopyBufferSize(int size)
      Copy buffer size. The buffer is used while write operation to copy data from user provided input stream to an output stream.
    • getOperationId

      public String getOperationId()
      Operation id. Used internally to register new operation. Should not be called directly.
    • setOperationId

      public InsertSettings setOperationId(String operationId)
      Operation id. Used internally to register new operation. Should not be called directly.
      Parameters:
      operationId - - operation id
    • setDatabase

      public InsertSettings setDatabase(String database)
      Sets database to be used for a request.
    • getDatabase

      public String getDatabase()
    • compressClientRequest

      public InsertSettings compressClientRequest(boolean enabled)
      Client request compression. If set to true client will compress the request.
      Parameters:
      enabled - - indicates if client request compression is enabled
    • useHttpCompression

      public InsertSettings useHttpCompression(boolean enabled)
    • appCompressedData

      public InsertSettings appCompressedData(boolean enabled, String compressionMethod)
      Sets flag that indicates if application provides already compressed data
      Parameters:
      enabled - - if application provides compressed data
    • isClientRequestEnabled

      public boolean isClientRequestEnabled()
    • httpHeader

      public InsertSettings httpHeader(String key, String value)
      Defines list of headers that should be sent with current request. The Client will use a header value defined in headers instead of any other.
      Parameters:
      key - - header name.
      value - - header value.
      Returns:
      same instance of the builder
      See Also:
    • httpHeader

      public InsertSettings httpHeader(String key, Collection<String> values)
      but for multiple values.
      Parameters:
      key - - name of the header
      values - - collection of values
      Returns:
      same instance of the builder
    • httpHeaders

      public InsertSettings httpHeaders(Map<String,String> headers)
      but for multiple headers.
      Parameters:
      headers - - map of headers
      Returns:
      same instance of the builder
    • serverSetting

      public InsertSettings serverSetting(String name, String value)
      Defines list of server settings that should be sent with each request. The Client will use a setting value defined in settings instead of any other. Operation settings may override these values.
      Parameters:
      name - - name of the setting
      value - - value of the setting
      Returns:
      same instance of the builder
      See Also:
    • serverSetting

      public InsertSettings serverSetting(String name, Collection<String> values)
      but for multiple values.
      Parameters:
      name - - name of the setting without special prefix
      values - - collection of values
      Returns:
      same instance of the builder
    • setDBRoles

      public InsertSettings setDBRoles(Collection<String> dbRoles)
      Sets DB roles for an operation. Roles that were set by Client.setDBRoles(Collection) will be overridden.
      Parameters:
      dbRoles -
    • getDBRoles

      public Collection<String> getDBRoles()
      Gets DB roles for an operation.
      Returns:
      list of DB roles
    • logComment

      public InsertSettings logComment(String logComment)
      Sets the comment that will be added to the query log record associated with the query.
      Parameters:
      logComment - - comment to be added to the log
      Returns:
      same instance of the builder
    • getLogComment

      public String getLogComment()