Class ClickHouseClientBuilder

java.lang.Object
com.clickhouse.client.ClickHouseClientBuilder

@Deprecated public class ClickHouseClientBuilder extends Object
Deprecated.
Builder class for creating ClickHouseClient. Please use ClickHouseClient.builder() for instantiation, and avoid multi-threading as it's NOT thread-safe.
  • Field Details

  • Constructor Details

    • ClickHouseClientBuilder

      protected ClickHouseClientBuilder()
      Deprecated.
      Default constructor.
  • Method Details

    • resetConfig

      protected void resetConfig()
      Deprecated.
      Resets client configuration to null.
    • getConfig

      public ClickHouseConfig getConfig()
      Deprecated.
      Gets client configuration.
      Returns:
      non-null client configuration
    • build

      public ClickHouseClient build()
      Deprecated.
      Builds an instance of ClickHouseClient. This method will use ServiceLoader to load a suitable implementation based on preferred protocol(s), or just the first one if no preference given. ClickHouseClient.accept(ClickHouseProtocol) will be invoked during the process to test if the implementation is compatible with the preferred protocol(s) or not. At the end of process, if a suitable implementation is found, ClickHouseClient.init(ClickHouseConfig) will be invoked for initialization.
      Returns:
      suitable client to handle preferred protocols
      Throws:
      IllegalStateException - when no suitable client found in classpath
    • agent

      public ClickHouseClientBuilder agent(boolean agent)
      Deprecated.
      Sets whether agent should be used for advanced feature like failover and retry.
      Parameters:
      agent - whether to use agent
      Returns:
      this builder
    • config

      public ClickHouseClientBuilder config(ClickHouseConfig config)
      Deprecated.
      Sets configuration.
      Parameters:
      config - non-null configuration
      Returns:
      this builder
    • option

      public ClickHouseClientBuilder option(ClickHouseOption option, Serializable value)
      Deprecated.
      Adds an option, which is usually an Enum type that implements ClickHouseOption.
      Parameters:
      option - non-null option
      value - value
      Returns:
      this builder
    • removeOption

      public ClickHouseClientBuilder removeOption(ClickHouseOption option)
      Deprecated.
      Removes an option.
      Parameters:
      option - non-null option
      Returns:
      this builder
    • clearOptions

      public ClickHouseClientBuilder clearOptions()
      Deprecated.
      Removes all options.
      Returns:
      this builder
    • options

      Deprecated.
      Sets options.
      Parameters:
      options - map containing all options
      Returns:
      this builder
    • defaultCredentials

      public ClickHouseClientBuilder defaultCredentials(ClickHouseCredentials credentials)
      Deprecated.
      Sets default credentials, which will be used to connect to a ClickHouseNode only when it has no credentials defined.
      Parameters:
      credentials - default credentials
      Returns:
      this builder
    • nodeSelector

      public ClickHouseClientBuilder nodeSelector(ClickHouseNodeSelector nodeSelector)
      Deprecated.
      Sets node selector.
      Parameters:
      nodeSelector - non-null node selector
      Returns:
      this builder
    • metricRegistry

      public ClickHouseClientBuilder metricRegistry(Object metricRegistry)
      Deprecated.
      Sets metric registry.
      Parameters:
      metricRegistry - metric registry, could be null
      Returns:
      this builder