java.lang.Object
org.pgcodekeeper.core.database.ch.schema.ChEngine
All Implemented Interfaces:
Serializable, IHashable

public final class ChEngine extends Object implements Serializable, IHashable
Represents a ClickHouse table engine configuration. Contains engine name, parameters, and various engine-specific settings like partition keys, order by clauses, TTL expressions, and engine options.
See Also:
  • Constructor Details

    • ChEngine

      public ChEngine(String name)
      Creates a new ClickHouse engine with the specified name.
      Parameters:
      name - the name of the engine (e.g., MergeTree, ReplacingMergeTree)
  • Method Details

    • getName

      public String getName()
    • setBody

      public void setBody(String body)
    • setPartitionBy

      public void setPartitionBy(String partitionBy)
    • setPrimaryKey

      public void setPrimaryKey(String primaryKey)
    • setOrderBy

      public void setOrderBy(String orderBy)
    • setSampleBy

      public void setSampleBy(String sampleBy)
    • setTtl

      public void setTtl(String ttl)
    • addOption

      public void addOption(String option, String value)
      Adds an engine option with the specified key and value.
      Parameters:
      option - the option name
      value - the option value
    • containsOption

      public boolean containsOption(String key)
      Checks if this engine contains the specified option.
      Parameters:
      key - the option key to check
      Returns:
      true if the option exists, false otherwise
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • computeHash

      public void computeHash(Hasher hasher)
      Description copied from interface: IHashable
      Computes the hash of the implementing object using the provided hasher. The implementation should call appropriate put methods on the hasher for all fields that should contribute to the hash value.
      Specified by:
      computeHash in interface IHashable
      Parameters:
      hasher - the hasher instance to use for hash computation
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object