public class Constraints extends Object
Modifier and Type | Method and Description |
---|---|
static Constraint |
autoGeohash(String geohashField,
String longitudeField,
String latitudeField,
boolean createIndex)
Creates a constraint that autofills a given field with the geohash of latitude and longitude fields
before insert the tuples.
|
static Constraint |
autoIncrement(String autoincrementField,
String sequenceName) |
static Constraint |
autoSplit(String autosplitField,
String sequenceName,
List<String> bloomFilterFields)
Returns a constraint that adds a new autoincremental field as a suffix of the PK, and uses it
to do the bidimensional partitioning.
|
static Constraint |
autoSplit(String autosplitField,
String sequenceName,
List<String> bloomFilterFields,
boolean withHash)
Returns a constraint that adds a new autoincremental field as a suffix of the PK, and uses it
to do the bidimensional partitioning.
|
static Constraint |
hashPartition(String hashIdField,
List<String> hashKeys)
Returns a constraint to partition the table using a hash.
|
static Constraint |
onlineAggregate(String aggregateTable,
List<String> groupBy,
AggregateField... aggregates)
Creates a constraint that creates an online aggregates table, and updates it whenever a tuple
is inserted in the parent table.
|
public static Constraint autoGeohash(String geohashField, String longitudeField, String latitudeField, boolean createIndex)
geohashField
- Name of the geohash field. It mus be of String type.longitudeField
- Name of the longitude field. It must be of Double type.latitudeField
- Name of the latitude field. It must be of Double type.createIndex
- True if an index must be created over the geohash field, false in another case.public static Constraint onlineAggregate(String aggregateTable, List<String> groupBy, AggregateField... aggregates)
aggregateTable
- Name of the aggregated table.groupBy
- List of field names that will be used as PK in the aggregated table, that is,
the group by fields. Cannot be null or empty;aggregates
- List of aggregations that will be calculated online. Each aggregation consists
of a field an aggregation type (MIN, MAX, SUM or COUNT).public static Constraint autoIncrement(String autoincrementField, String sequenceName)
public static Constraint autoSplit(String autosplitField, String sequenceName, List<String> bloomFilterFields)
autosplitField
- Name of the new field.sequenceName
- Name of the sequence to be used for auto increment (will be created)bloomFilterFields
- Fields of the original PK that will be used to build a bloom filter.public static Constraint autoSplit(String autosplitField, String sequenceName, List<String> bloomFilterFields, boolean withHash)
autosplitField
- Name of the new field.sequenceName
- Name of the sequence to be used for auto increment (will be created)bloomFilterFields
- Fields of the original PK that will be used to build a bloom filter.withHash
- Include hash partitioning over the bloom filters fields.public static Constraint hashPartition(String hashIdField, List<String> hashKeys)
hashIdField
- field which contains the result of the hash. This field will be created
automatically, at the end of the PK with Type.SHORT.hashKeys
- Fields to calculate the hash. Must be part of the PK.Copyright © 2020. All rights reserved.