All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.scalar.db.sql.metadata.TableMetadata Maven / Gradle / Ivy

There is a newer version: 3.14.0
Show newest version
package com.scalar.db.sql.metadata;

import com.scalar.db.sql.ClusteringOrder;
import java.util.List;
import java.util.Map;
import java.util.Optional;

/** Metadata for a table. */
public interface TableMetadata {

  /**
   * Returns the namespace name of the table.
   *
   * @return the namespace name of the table
   */
  String getNamespaceName();

  /**
   * Returns the name of the table.
   *
   * @return the name of the table
   */
  String getName();

  /**
   * Returns {@link ColumnMetadata} objects for the primary key columns.
   *
   * @return {@link ColumnMetadata} objects for the primary key columns
   */
  List getPrimaryKey();

  /**
   * Returns whether specified column is in part of the primary key.
   *
   * @param columnName the name of the target column
   * @return whether specified column is in part of the primary key
   */
  boolean isPrimaryKeyColumn(String columnName);

  /**
   * Returns {@link ColumnMetadata} objects for the partition key columns.
   *
   * @return {@link ColumnMetadata} objects for the partition key columns
   */
  List getPartitionKey();

  /**
   * Returns whether specified column is in part of the partition key.
   *
   * @param columnName the name of the target column
   * @return whether specified column is in part of the partition key
   */
  boolean isPartitionKeyColumn(String columnName);

  /**
   * Returns a map of {@link ColumnMetadata} objects and clustering orders for the clustering key
   * columns.
   *
   * @return a map of {@link ColumnMetadata} objects and clustering orders for the clustering key
   *     columns
   */
  Map getClusteringKey();

  /**
   * Returns whether specified column is in part of the clustering key.
   *
   * @param columnName the name of the target column
   * @return whether specified column is in part of the clustering key
   */
  boolean isClusteringKeyColumn(String columnName);

  /**
   * Returns a map of column names and {@link ColumnMetadata} objects for all the columns in the
   * table.
   *
   * @return a map of column names and {@link ColumnMetadata} objects for all the columns in the
   *     table
   */
  Map getColumns();

  /**
   * Returns a {@link ColumnMetadata} object for the specified column.
   *
   * @param columnName the name of the target column
   * @return a {@link ColumnMetadata} object for the specified column
   */
  Optional getColumn(String columnName);

  /**
   * Returns a map of column names and {@link IndexMetadata} objects for all the indexes in the
   * table.
   *
   * @return a map of column names and {@link IndexMetadata} objects for all the indexes in the
   *     table
   */
  Map getIndexes();

  /**
   * Returns a {@link IndexMetadata} objects for the specified index.
   *
   * @param columnName the name of the column that the index is on
   * @return a {@link IndexMetadata} objects for the specified index
   */
  Optional getIndex(String columnName);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy