K - the concrete class for keyspace metadata in the persistence layer.T - the concrete class for table metadata in the persistence layer.C - the concrete class for column metadata in the persistence layer.U - the concrete class for user types in the persistence layer.I - the concrete class for secondary indexes metadata in the persistence layer.V - the concrete class for materialized views metadata in the persistence layer.public abstract class AbstractCassandraSchemaConverter<K,T,C,U,I,V> extends Object
Note that this class has no interesting logic, as it cannot make much assumption on the concrete classes of the schema entities in the persistence layer. Its only goal is to save some boilerplate code when writing such converter.
| Modifier and Type | Field and Description |
|---|---|
protected static Set<String> |
EXCLUDED_INDEX_OPTIONS |
| Constructor and Description |
|---|
AbstractCassandraSchemaConverter() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract T |
asTable(V view)
The internal "table" metadata class of the provided internal materialized view.
|
protected abstract Column.Order |
columnClusteringOrder(C column)
The clustering order of the provided internal column;
|
protected abstract Column.Kind |
columnKind(C column)
The kind of the provided internal column.
|
protected abstract String |
columnName(C column)
The (unquoted) name of the provided internal column.
|
protected abstract Iterable<C> |
columns(T table)
The internal columns of the internal table.
|
protected abstract Column.ColumnType |
columnType(C column)
The type of the provided internal column.
|
protected abstract String |
comment(T table)
The comment on the provided internal table.
|
Schema |
convertCassandraSchema(Iterable<K> cassandraKeyspaces) |
protected abstract String |
indexClass(I index)
The index class of the given custom index
|
protected abstract String |
indexName(I index)
The (unquoted) name of the provided internal index.
|
protected abstract Map<String,String> |
indexOptions(I index)
The index options of the given custom index
|
protected abstract String |
indexTarget(I index)
The target of the provided internal index, that is the content of it's "target" option.
|
protected abstract boolean |
isBaseTableOf(T table,
V view)
Whether the provided table is the base table of the provided view.
|
protected abstract boolean |
isCustom(I index)
Whether the given index is of the "CUSTOM" kind.
|
protected abstract String |
keyspaceName(K keyspace)
The (unquoted) name of the provided internal keyspace.
|
protected abstract Map<String,String> |
replicationOptions(K keyspace)
The replication options of the provided internal keyspace.
|
protected abstract Iterable<I> |
secondaryIndexes(T table)
The (internal) 2ndary indexes of provided internal table.
|
protected abstract String |
tableName(T table)
The (unquoted) name of the provided internal table.
|
protected abstract Iterable<T> |
tables(K keyspace)
The internal tables of the provided internal keyspace.
|
protected abstract List<Column> |
userTypeFields(U userType)
Returns the fields of the provided internal user type as columns (of kind
Column.Kind#Regular). |
protected abstract String |
userTypeName(U userType)
The name of the provided internal user type.
|
protected abstract Iterable<U> |
userTypes(K keyspace)
The internal user types of the provided internal keyspace.
|
protected abstract boolean |
usesDurableWrites(K keyspace)
Whether the provided internal keyspace uses durable writes.
|
protected abstract Iterable<V> |
views(K keyspace)
The internal materialized views of the provided internal keyspace.
|
protected abstract String keyspaceName(K keyspace)
protected abstract Map<String,String> replicationOptions(K keyspace)
protected abstract boolean usesDurableWrites(K keyspace)
protected abstract Iterable<T> tables(K keyspace)
protected abstract Iterable<U> userTypes(K keyspace)
protected abstract Iterable<V> views(K keyspace)
protected abstract String tableName(T table)
protected abstract String columnName(C column)
protected abstract Column.ColumnType columnType(C column)
protected abstract Column.Order columnClusteringOrder(C column)
protected abstract Column.Kind columnKind(C column)
protected abstract Iterable<I> secondaryIndexes(T table)
protected abstract String indexName(I index)
protected abstract String indexTarget(I index)
protected abstract boolean isCustom(I index)
protected abstract Map<String,String> indexOptions(I index)
protected abstract List<Column> userTypeFields(U userType)
Column.Kind#Regular).protected abstract String userTypeName(U userType)
protected abstract T asTable(V view)
protected abstract boolean isBaseTableOf(T table, V view)
Copyright © 2021. All rights reserved.