Class CreateSchema
- java.lang.Object
-
- com.ibm.fhir.persistence.cassandra.cql.CreateSchema
-
public class CreateSchema extends java.lang.ObjectCreate the Cassandra schema. The partition_id is application-defined and will be different depending on the type of resource (although it is always deterministic). For resources associated with a patient (e.g. observations), the partition_id will be the patient logical id. If there is no obvious partition key, the key will simply be the logical id for the resource.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.StringkeySpace
-
Constructor Summary
Constructors Constructor Description CreateSchema(java.lang.String keySpace)Public constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateKeyspace(com.datastax.oss.driver.api.core.CqlSession session, java.lang.String replicationClass, int replicationFactor)Each tenant gets its own keyspaceprotected voidcreateLogicalResourcesTable(com.datastax.oss.driver.api.core.CqlSession session)protected voidcreatePayloadChunksTable(com.datastax.oss.driver.api.core.CqlSession session)In Cassandra, blobs are limited to 2GB, but the document states that the practical limit is less than 1MB.protected voidcreateResourceVersionsTable(com.datastax.oss.driver.api.core.CqlSession session)Create a table to identify the versions associated with each logical resource.voidrun(com.datastax.oss.driver.api.core.CqlSession session)Create the tables used to support payload persistence for this keyspace (each tenant gets its own keyspace)protected voiduseKeyspace(com.datastax.oss.driver.api.core.CqlSession session)
-
-
-
Method Detail
-
run
public void run(com.datastax.oss.driver.api.core.CqlSession session)
Create the tables used to support payload persistence for this keyspace (each tenant gets its own keyspace)- Parameters:
session-
-
createKeyspace
public void createKeyspace(com.datastax.oss.driver.api.core.CqlSession session, java.lang.String replicationClass, int replicationFactor)Each tenant gets its own keyspace- Parameters:
session-replicationClass-replicationFactor-
-
useKeyspace
protected void useKeyspace(com.datastax.oss.driver.api.core.CqlSession session)
-
createLogicalResourcesTable
protected void createLogicalResourcesTable(com.datastax.oss.driver.api.core.CqlSession session)
-
createResourceVersionsTable
protected void createResourceVersionsTable(com.datastax.oss.driver.api.core.CqlSession session)
Create a table to identify the versions associated with each logical resource. The partition id for this table is based on only {resource_type_id, logical_id} allowing the application to select the list of versions. The versions are also clustered with descending order, making it trivial to identify the latest version- Parameters:
session-
-
createPayloadChunksTable
protected void createPayloadChunksTable(com.datastax.oss.driver.api.core.CqlSession session)
In Cassandra, blobs are limited to 2GB, but the document states that the practical limit is less than 1MB. To avoid issues when storing arbitrarily large FHIR resources, the payload is compressed and stored as a series of chunks each <= 1MB. Chunk order is maintained by the ordinal field.- Parameters:
session-
-
-