public class DatabaseImpl extends Object implements Database, Deployment, NamesProvider
Constructor and Description |
---|
DatabaseImpl(TransactionProvider transactionProvider,
Credentials credentials,
TableFormatConverter tableFormatConverter,
TableMetadataSerializer tableMetadataSerializer) |
Modifier and Type | Method and Description |
---|---|
Index |
createIndex(String tableName,
String indexName,
List<Field> fields,
boolean isUnique)
Creates a new index on the table.
|
Sequence |
createSequence(String name,
int cacheSize)
Creates a new sequence in the database.
|
Table |
createTable(String name,
List<Field> keyFields,
List<Field> fields)
Creates a new table in the database.
|
Table |
createTable(String name,
List<Field> keyFields,
List<Field> fields,
int flags)
Creates a new table in the database.
|
Table |
createTable(String name,
List<Field> keys,
List<Field> fields,
List<Constraint> constraints)
Creates a new table in the database.
|
Table |
createTable(String name,
List<Field> keys,
List<Field> fields,
List<Constraint> constraints,
int flags)
Creates a new table in the database.
|
Table |
createTable(String name,
List<Field> keys,
List<Field> fields,
List<Constraint> constraints,
String splitKey)
Creates a new table in the database using a field as a splitPoint for bidimensional partitioning.
|
Table |
createTable(String name,
List<Field> keys,
List<Field> fields,
List<Constraint> constraints,
String splitKey,
int flags)
Creates a new table in the database using a field as a splitPoint for bidimensional partitioning.
|
Table |
createTable(String name,
List<Field> keys,
List<Field> fields,
List<Constraint> constraints,
String splitKey,
Set<String> bloomFilterFields,
Set<String> hashKeys,
int hashIdPosition) |
Table |
createTable(String name,
List<Field> keys,
List<Field> fields,
List<Constraint> constraints,
String splitKey,
Set<String> bloomFilterFields,
Set<String> hashKeys,
int hashIdPosition,
int flags) |
Table |
createTable(String name,
List<Field> keyFields,
List<Field> fields,
String splitKey)
Creates a new table in the database using a field as a splitPoint for bidimensional partitioning.
|
Table |
createTable(String name,
List<Field> keyFields,
List<Field> fields,
String splitKey,
int flags)
Creates a new table in the database using a field as a splitPoint for bidimensional partitioning.
|
void |
dropIndex(String tableName,
String indexName)
Drops an index from a table.
|
void |
dropSequence(String name)
Drops a sequence from the database.
|
void |
dropTable(String name)
Drops a table, including the data inside the table.
|
Index |
getIndex(String tableName,
String name)
Returns an index given its name.
|
Collection<Index> |
getIndexes(String tableName)
Returns the table index list.
|
String |
getInnerName(String entityName)
Retrieves the Kivi name (database-SCHEMA-ENTITY) for a given entity
|
String |
getName(String innerName)
Retrieves the local name (ENTITY) for a given absolute name.
|
List<Region> |
getRegions(Table table)
Returns the regions of a given table.
|
Sequence |
getSequence(String name)
Retrieves an existing sequence given its name.
|
Collection<Sequence> |
getSequences()
Retrieves the full list of database sequences.
|
List<String> |
getServers() |
Table |
getTable(String name)
Retrieves an existing table given its name.
|
Collection<Table> |
getTables()
Retrieves the full list of database tables.
|
boolean |
tableExists(String tableName)
Return if a table exixts or not.
|
public DatabaseImpl(TransactionProvider transactionProvider, Credentials credentials, TableFormatConverter tableFormatConverter, TableMetadataSerializer tableMetadataSerializer)
public Table createTable(String name, List<Field> keyFields, List<Field> fields)
Database
createTable
in interface Database
name
- Name of the table. Must be unique inside the database.keyFields
- List of Field objects which represents th PK of the tablefields
- List of Field objects which represent the fields which are not in the PKpublic Table createTable(String name, List<Field> keyFields, List<Field> fields, int flags)
Database
createTable
in interface Database
name
- Name of the table. Must be unique inside the database.keyFields
- List of Field objects which represents th PK of the tablefields
- List of Field objects which represent the fields which are not in the PKflags
- Special data-store flags for table creationpublic Table createTable(String name, List<Field> keyFields, List<Field> fields, String splitKey)
Database
createTable
in interface Database
name
- Name of the table. Must be unique inside the database.keyFields
- List of Field objects which represents th PK of the tablefields
- List of Field objects which represent the fields which are not in the PKsplitKey
- Name of the key field which will be used to do bidimensional partitioningpublic Table createTable(String name, List<Field> keyFields, List<Field> fields, String splitKey, int flags)
Database
createTable
in interface Database
name
- Name of the table. Must be unique inside the database.keyFields
- List of Field objects which represents th PK of the tablefields
- List of Field objects which represent the fields which are not in the PKsplitKey
- Name of the key field which will be used to do bidimensional partitioningflags
- Special data-store flags for table creationpublic Table createTable(String name, List<Field> keys, List<Field> fields, List<Constraint> constraints)
Database
createTable
in interface Database
name
- Name of the table. Must be unique inside the database.keys
- List of Field objects which represents th PK of the tablefields
- List of Field objects which represent the fields which are not in the PKconstraints
- List of constraints to be included on the table.public Table createTable(String name, List<Field> keys, List<Field> fields, List<Constraint> constraints, int flags)
Database
createTable
in interface Database
name
- Name of the table. Must be unique inside the database.keys
- List of Field objects which represents th PK of the tablefields
- List of Field objects which represent the fields which are not in the PKconstraints
- List of constraints to be included on the table.flags
- Special data-store flags for table creationpublic Table createTable(String name, List<Field> keys, List<Field> fields, List<Constraint> constraints, String splitKey)
Database
createTable
in interface Database
name
- Name of the table. Must be unique inside the database.keys
- List of Field objects which represents th PK of the tablefields
- List of Field objects which represent the fields which are not in the PKconstraints
- List of constraints to be included on the table.splitKey
- Name of the key field which will be used to do bidimensional partitioningpublic Table createTable(String name, List<Field> keys, List<Field> fields, List<Constraint> constraints, String splitKey, int flags)
Database
createTable
in interface Database
name
- Name of the table. Must be unique inside the database.keys
- List of Field objects which represents th PK of the tablefields
- List of Field objects which represent the fields which are not in the PKconstraints
- List of constraints to be included on the table.splitKey
- Name of the key field which will be used to do bidimensional partitioningflags
- Special data-store flags for table creationpublic Table createTable(String name, List<Field> keys, List<Field> fields, List<Constraint> constraints, String splitKey, Set<String> bloomFilterFields, Set<String> hashKeys, int hashIdPosition)
public Table createTable(String name, List<Field> keys, List<Field> fields, List<Constraint> constraints, String splitKey, Set<String> bloomFilterFields, Set<String> hashKeys, int hashIdPosition, int flags)
public void dropTable(String name)
Database
public Sequence createSequence(String name, int cacheSize)
Database
createSequence
in interface Database
name
- Name of the sequence. Must be unique.cacheSize
- Size of the precached values blockpublic void dropSequence(String name)
Database
dropSequence
in interface Database
name
- name of the sequence to be dropped.public Table getTable(String name)
Database
public Collection<Table> getTables()
Database
public boolean tableExists(String tableName)
Database
tableExists
in interface Database
tableName
- Name of the table.public Sequence getSequence(String name)
Database
getSequence
in interface Database
name
- Name of the sequence.public Collection<Sequence> getSequences()
Database
getSequences
in interface Database
public Index createIndex(String tableName, String indexName, List<Field> fields, boolean isUnique)
Database
createIndex
in interface Database
tableName
- the name of the table to create the indexindexName
- Name of the new indexfields
- Field list of the indexisUnique
- Indicates if the index is uniquepublic void dropIndex(String tableName, String indexName)
Database
public Collection<Index> getIndexes(String tableName)
Database
getIndexes
in interface Database
tableName
- Name of the table to get the indexespublic Index getIndex(String tableName, String name)
Database
public String getInnerName(String entityName)
NamesProvider
getInnerName
in interface NamesProvider
entityName
- Entity namepublic String getName(String innerName)
NamesProvider
getName
in interface NamesProvider
innerName
- absolute namepublic List<Region> getRegions(Table table)
Deployment
getRegions
in interface Deployment
table
- Table object to recover the regions.public List<String> getServers()
getServers
in interface Deployment
Copyright © 2020. All rights reserved.