Package ca.uhn.fhir.jpa.model.config
Class PartitionSettings
java.lang.Object
ca.uhn.fhir.jpa.model.config.PartitionSettings
- Since:
- 5.0.0
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionShould resources references be permitted to cross partition boundaries.If set, the given ID will be used for the default partition.boolean
If enabled the JPA server will allow unqualified cross partition referenceboolean
Should we always open a new database transaction if the partition context changesboolean
TheResourceSearchUrlEntity
table is used to prevent accidental concurrent conditional create/update operations from creating duplicate resources by inserting a row in that table as a part of the database transaction performing the write operation.boolean
This flag activates partition IDs in PKs mode, which is newly introduced in HAPI FHIR 8.0.0.boolean
If set totrue
(default isfalse
) thePARTITION_ID
value will be factored into the hash values used in theHFJ_SPIDX_xxx
tables, removing the need to explicitly add a selector on this column in queries.boolean
If enabled (default isfalse
) the JPA server will support data partitioningboolean
If set totrue
(default isfalse
), partitions will be unnamed and all IDs fromInteger.MIN_VALUE
throughInteger.MAX_VALUE
will be allowed without needing to be created ahead of time.void
setAllowReferencesAcrossPartitions
(PartitionSettings.CrossPartitionReferenceMode theAllowReferencesAcrossPartitions) Should resources references be permitted to cross partition boundaries.void
setAlwaysOpenNewTransactionForDifferentPartition
(boolean theAlwaysOpenNewTransactionForDifferentPartition) Should we always open a new database transaction if the partition context changesvoid
setConditionalCreateDuplicateIdentifiersEnabled
(boolean theConditionalCreateDuplicateIdentifiersEnabled) TheResourceSearchUrlEntity
table is used to prevent accidental concurrent conditional create/update operations from creating duplicate resources by inserting a row in that table as a part of the database transaction performing the write operation.void
setDatabasePartitionMode
(boolean theDatabasePartitionMode) This flag activates partition IDs in PKs mode, which is newly introduced in HAPI FHIR 8.0.0.void
setDefaultPartitionId
(Integer theDefaultPartitionId) If set, the given ID will be used for the default partition.setIncludePartitionInSearchHashes
(boolean theIncludePartitionInSearchHashes) If set totrue
(default isfalse
) thePARTITION_ID
value will be factored into the hash values used in theHFJ_SPIDX_xxx
tables, removing the need to explicitly add a selector on this column in queries.void
setPartitioningEnabled
(boolean theMultiTenancyEnabled) If enabled (default isfalse
) the JPA server will support data partitioningvoid
setUnnamedPartitionMode
(boolean theUnnamedPartitionMode) If set totrue
(default isfalse
), partitions will be unnamed and all IDs fromInteger.MIN_VALUE
throughInteger.MAX_VALUE
will be allowed without needing to be created ahead of time.
-
Constructor Details
-
PartitionSettings
public PartitionSettings()
-
-
Method Details
-
isDatabasePartitionMode
This flag activates partition IDs in PKs mode, which is newly introduced in HAPI FHIR 8.0.0. This mode causes partition IDs to be included in all primary keys, joins, and emitted SQL. It also affects the generated schema and migrations. This setting should not be changed after the database has been initialized, unless you have performed an appropriate migration.- Since:
- 8.0.0
-
setDatabasePartitionMode
This flag activates partition IDs in PKs mode, which is newly introduced in HAPI FHIR 8.0.0. This mode causes partition IDs to be included in all primary keys, joins, and emitted SQL. It also affects the generated schema and migrations. This setting should not be changed after the database has been initialized, unless you have performed an appropriate migration.- Since:
- 8.0.0
-
isAlwaysOpenNewTransactionForDifferentPartition
Should we always open a new database transaction if the partition context changes- Since:
- 6.6.0
-
setAlwaysOpenNewTransactionForDifferentPartition
public void setAlwaysOpenNewTransactionForDifferentPartition(boolean theAlwaysOpenNewTransactionForDifferentPartition) Should we always open a new database transaction if the partition context changes- Since:
- 6.6.0
-
isIncludePartitionInSearchHashes
If set totrue
(default isfalse
) thePARTITION_ID
value will be factored into the hash values used in theHFJ_SPIDX_xxx
tables, removing the need to explicitly add a selector on this column in queries. If set tofalse
, an additional selector is used instead, which may perform better when using native database partitioning features.This setting has no effect if partitioning is not enabled via
isPartitioningEnabled()
.If
StorageSettings.isIndexStorageOptimized()
is enabled this setting should be set tofalse
. -
setIncludePartitionInSearchHashes
public PartitionSettings setIncludePartitionInSearchHashes(boolean theIncludePartitionInSearchHashes) If set totrue
(default isfalse
) thePARTITION_ID
value will be factored into the hash values used in theHFJ_SPIDX_xxx
tables, removing the need to explicitly add a selector on this column in queries. If set tofalse
, an additional selector is used instead, which may perform better when using native database partitioning features.This setting has no effect if partitioning is not enabled via
isPartitioningEnabled()
.If
StorageSettings.isIndexStorageOptimized()
is enabled this setting should be set tofalse
. -
isPartitioningEnabled
If enabled (default isfalse
) the JPA server will support data partitioning- Since:
- 5.0.0
-
setPartitioningEnabled
If enabled (default isfalse
) the JPA server will support data partitioning- Since:
- 5.0.0
-
getAllowReferencesAcrossPartitions
Should resources references be permitted to cross partition boundaries. Default isPartitionSettings.CrossPartitionReferenceMode.NOT_ALLOWED
.- Since:
- 5.0.0
-
setAllowReferencesAcrossPartitions
public void setAllowReferencesAcrossPartitions(PartitionSettings.CrossPartitionReferenceMode theAllowReferencesAcrossPartitions) Should resources references be permitted to cross partition boundaries. Default isPartitionSettings.CrossPartitionReferenceMode.NOT_ALLOWED
.- Since:
- 5.0.0
-
isUnnamedPartitionMode
If set totrue
(default isfalse
), partitions will be unnamed and all IDs fromInteger.MIN_VALUE
throughInteger.MAX_VALUE
will be allowed without needing to be created ahead of time.- Since:
- 5.5.0
-
setUnnamedPartitionMode
If set totrue
(default isfalse
), partitions will be unnamed and all IDs fromInteger.MIN_VALUE
throughInteger.MAX_VALUE
will be allowed without needing to be created ahead of time.- Since:
- 5.5.0
-
getDefaultPartitionId
If set, the given ID will be used for the default partition. The default isnull
which will result in the use of a null value for default partition items.- Since:
- 5.5.0
-
setDefaultPartitionId
If set, the given ID will be used for the default partition. The default isnull
which will result in the use of a null value for default partition items.- Since:
- 5.5.0
-
isAllowUnqualifiedCrossPartitionReference
If enabled the JPA server will allow unqualified cross partition reference -
isConditionalCreateDuplicateIdentifiersEnabled
TheResourceSearchUrlEntity
table is used to prevent accidental concurrent conditional create/update operations from creating duplicate resources by inserting a row in that table as a part of the database transaction performing the write operation. If this setting is set to false (which is the default), the partition ID is not written to this table, meaning that duplicates are prevented across partitions. If this setting is true, duplicates will not be prevented if they appear on different partitions. -
setConditionalCreateDuplicateIdentifiersEnabled
public void setConditionalCreateDuplicateIdentifiersEnabled(boolean theConditionalCreateDuplicateIdentifiersEnabled) TheResourceSearchUrlEntity
table is used to prevent accidental concurrent conditional create/update operations from creating duplicate resources by inserting a row in that table as a part of the database transaction performing the write operation. If this setting is set to false (which is the default), the partition ID is not written to this table, meaning that duplicates are prevented across partitions. If this setting is true, duplicates will not be prevented if they appear on different partitions.
-