public class Indexes
extends Object
Helper methods to create index to pass into Apache Gravitino.
-
Nested Class Summary
Nested Classes
static final class
The user side implementation of the index.
-
Field Summary
Fields
MySQL does not support setting the name of the primary key, so the default name is used.
An empty array of indexes.
-
Method Summary
To create a MySQL primary key, you need to use the default primary key name.
Create a primary index on columns.
Create a unique index on columns.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
EMPTY_INDEXES
public static final Index[] EMPTY_INDEXES
An empty array of indexes.
-
DEFAULT_MYSQL_PRIMARY_KEY_NAME
public static final String DEFAULT_MYSQL_PRIMARY_KEY_NAME
MySQL does not support setting the name of the primary key, so the default name is used.
- See Also:
-
-
Method Details
-
unique
Create a unique index on columns. Like unique (a) or unique (a, b), for complex like unique
- Parameters:
name
- The name of the index
fieldNames
- The field names under the table contained in the index.
- Returns:
- The unique index
-
createMysqlPrimaryKey
public static Index createMysqlPrimaryKey(String[][] fieldNames)
To create a MySQL primary key, you need to use the default primary key name.
- Parameters:
fieldNames
- The field names under the table contained in the index.
- Returns:
- The primary key index
-
primary
Create a primary index on columns. Like primary (a), for complex like primary
- Parameters:
name
- The name of the index
fieldNames
- The field names under the table contained in the index.
- Returns:
- The primary index
-
of
- Parameters:
indexType
- The type of the index
name
- The name of the index
fieldNames
- The field names under the table contained in the index.
- Returns:
- The index