Class CitusAdapter
- java.lang.Object
-
- org.linuxforhealth.fhir.database.utils.common.CommonDatabaseAdapter
-
- org.linuxforhealth.fhir.database.utils.postgres.PostgresAdapter
-
- org.linuxforhealth.fhir.database.utils.citus.CitusAdapter
-
- All Implemented Interfaces:
IDatabaseAdapter
,IDatabaseTypeAdapter
public class CitusAdapter extends PostgresAdapter
A database adapter implementation for Citus (distributed PostgreSQL)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.linuxforhealth.fhir.database.utils.postgres.PostgresAdapter
PostgresAdapter.MessageKey
-
-
Field Summary
-
Fields inherited from class org.linuxforhealth.fhir.database.utils.postgres.PostgresAdapter
USE_SCHEMA_PREFIX
-
Fields inherited from class org.linuxforhealth.fhir.database.utils.common.CommonDatabaseAdapter
connectionProvider, target
-
-
Constructor Summary
Constructors Constructor Description CitusAdapter(IConnectionProvider cp)
Public constructorCitusAdapter(IDatabaseTarget target)
Public constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyDistributionRules(java.lang.String schemaName, java.lang.String tableName, DistributionContext distributionContext)
Apply any distribution rules configured for the named tablevoid
createTable(java.lang.String schemaName, java.lang.String name, java.util.List<ColumnBase> columns, PrimaryKeyDef primaryKey, IdentityDef identity, java.lang.String tablespaceName, java.util.List<With> withs, java.util.List<CheckConstraint> checkConstraints, DistributionContext distributionContext)
Build the create table DDLvoid
createUniqueIndex(java.lang.String schemaName, java.lang.String tableName, java.lang.String indexName, java.util.List<OrderedColumnDef> indexColumns, DistributionContext distributionContext)
Create a unique indexvoid
distributeFunction(java.lang.String schemaName, java.lang.String functionName, int distributeByParamNumber)
For Citus, functions can be distributed by one of their parameters (typically the first)boolean
includesDistributionColumn(java.lang.String distributionColumnName, java.util.Collection<java.lang.String> columns)
Asks if the distributionColumnName is contained in the given collection of column names-
Methods inherited from class org.linuxforhealth.fhir.database.utils.postgres.PostgresAdapter
alterTableColumnIdentityCache, blobClause, checkCompatibility, clobClause, createArrType, createForeignKeyConstraint, createIndex, createOrReplaceFunction, createOrReplaceProcedure, createRowType, createSchema, createSequence, createTablespace, createTablespace, createUniqueIndex, disableForeignKey, doesForeignKeyConstraintExist, doesTableExist, doubleClause, dropForeignKey, dropIndex, dropPermission, dropProcedure, dropSequence, dropTable, dropTablespace, dropType, dropVariable, dropView, enableForeignKey, grantAllSequenceUsage, grantProcedurePrivileges, grantSchemaUsage, listSchemaObjects, prefixTenantColumn, runStatement, setIntegrityOff, setIntegrityUnchecked, timestampClause, varbinaryClause, varcharClause, warnOnce
-
Methods inherited from class org.linuxforhealth.fhir.database.utils.common.CommonDatabaseAdapter
alterSequenceRestartWith, alterTableAddColumn, buildColumns, buildCreateTableStatement, createOrReplaceView, createUniqueConstraint, createView, dropFunction, getQualifiedName, getTranslator, grantFunctionPrivileges, grantObjectPrivileges, grantSequencePrivileges, grantVariablePrivileges, runStatement, runStatement
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.linuxforhealth.fhir.database.utils.api.IDatabaseAdapter
useSessionVariable
-
Methods inherited from interface org.linuxforhealth.fhir.database.utils.api.IDatabaseTypeAdapter
smallintClause
-
-
-
-
Constructor Detail
-
CitusAdapter
public CitusAdapter(IDatabaseTarget target)
Public constructor- Parameters:
target
-
-
CitusAdapter
public CitusAdapter(IConnectionProvider cp)
Public constructor- Parameters:
cp
-
-
-
Method Detail
-
createTable
public void createTable(java.lang.String schemaName, java.lang.String name, java.util.List<ColumnBase> columns, PrimaryKeyDef primaryKey, IdentityDef identity, java.lang.String tablespaceName, java.util.List<With> withs, java.util.List<CheckConstraint> checkConstraints, DistributionContext distributionContext)
Description copied from interface:IDatabaseAdapter
Build the create table DDL- Specified by:
createTable
in interfaceIDatabaseAdapter
- Overrides:
createTable
in classPostgresAdapter
-
createUniqueIndex
public void createUniqueIndex(java.lang.String schemaName, java.lang.String tableName, java.lang.String indexName, java.util.List<OrderedColumnDef> indexColumns, DistributionContext distributionContext)
Description copied from interface:IDatabaseAdapter
Create a unique index- Specified by:
createUniqueIndex
in interfaceIDatabaseAdapter
- Overrides:
createUniqueIndex
in classPostgresAdapter
-
applyDistributionRules
public void applyDistributionRules(java.lang.String schemaName, java.lang.String tableName, DistributionContext distributionContext)
Description copied from interface:IDatabaseAdapter
Apply any distribution rules configured for the named table- Specified by:
applyDistributionRules
in interfaceIDatabaseAdapter
- Overrides:
applyDistributionRules
in classCommonDatabaseAdapter
-
distributeFunction
public void distributeFunction(java.lang.String schemaName, java.lang.String functionName, int distributeByParamNumber)
Description copied from interface:IDatabaseAdapter
For Citus, functions can be distributed by one of their parameters (typically the first)- Specified by:
distributeFunction
in interfaceIDatabaseAdapter
- Overrides:
distributeFunction
in classCommonDatabaseAdapter
-
includesDistributionColumn
public boolean includesDistributionColumn(java.lang.String distributionColumnName, java.util.Collection<java.lang.String> columns)
Asks if the distributionColumnName is contained in the given collection of column names- Parameters:
distributionColumnName
-columns
-- Returns:
-
-