Class CacheDefinition.Builder

java.lang.Object
org.apache.ignite.catalog.definitions.CacheDefinition.Builder
Enclosing class:
CacheDefinition

public static class CacheDefinition.Builder extends Object
Builder for the cache definition.
  • Method Details

    • schema

      public CacheDefinition.Builder schema(String schemaName)
      Sets schema name.
      Parameters:
      schemaName - Schema name.
      Returns:
      This builder instance.
    • ifNotExists

      public CacheDefinition.Builder ifNotExists()
      Sets not exists flag.
      Returns:
      This builder instance.
    • columns

      public CacheDefinition.Builder columns(ColumnDefinition... columns)
      Sets definitions of the columns.
      Parameters:
      columns - An array of column definitions.
      Returns:
      This builder instance.
    • columns

      public CacheDefinition.Builder columns(List<ColumnDefinition> columns)
      Sets definitions of the columns.
      Parameters:
      columns - A list of column definitions.
      Returns:
      This builder instance.
    • colocateBy

      public CacheDefinition.Builder colocateBy(String... colocationColumns)
      Sets colocation columns.
      Parameters:
      colocationColumns - An array of colocation column names.
      Returns:
      This builder instance.
    • colocateBy

      public CacheDefinition.Builder colocateBy(List<String> colocationColumns)
      Sets colocation columns.
      Parameters:
      colocationColumns - An array of colocation column names.
      Returns:
      This builder instance.
    • zone

      public CacheDefinition.Builder zone(String zoneName)
      Sets primary zone name.
      Parameters:
      zoneName - Primary zone name.
      Returns:
      This builder instance.
    • primaryKey

      public CacheDefinition.Builder primaryKey(String... columnNames)
      Sets primary key columns using default index type.
      Parameters:
      columnNames - Column names to use in the primary key.
      Returns:
      This builder instance.
    • primaryKey

      public CacheDefinition.Builder primaryKey(IndexType type, ColumnSorted... columns)
      Sets primary key columns.
      Parameters:
      type - Type of the index.
      columns - An array of columns to use in the primary key.
      Returns:
      This builder instance.
    • primaryKey

      public CacheDefinition.Builder primaryKey(IndexType type, List<ColumnSorted> columns)
      Sets primary key columns.
      Parameters:
      type - Type of the index.
      columns - A list of columns to use in the primary key.
      Returns:
      This builder instance.
    • index

      public CacheDefinition.Builder index(String... columnNames)
      Adds an index on this cache using specified columns and default index type and sort order. The name of the index will be autogenerated from the column names.
      Parameters:
      columnNames - An array of column names to use to create index.
      Returns:
      This builder instance.
    • index

      public CacheDefinition.Builder index(@Nullable @Nullable String indexName, IndexType type, ColumnSorted... columns)
      Adds an index on this cache using specified columns with sort order and index type.
      Parameters:
      indexName - Name of the index or null to autogenerate the name.
      type - Index type.
      columns - An array of columns to use to create index.
      Returns:
      This builder instance.
    • index

      public CacheDefinition.Builder index(@Nullable @Nullable String indexName, IndexType type, List<ColumnSorted> columns)
      Adds an index on this cache using specified columns with sort order and index type.
      Parameters:
      indexName - Name of the index or null to autogenerate the name.
      type - Index type.
      columns - A list of columns to use to create index.
      Returns:
      This builder instance.
    • build

      public CacheDefinition build()
      Builds the cache definition.
      Returns:
      Cache definition.