Jump to: navigation, search

Initialization Cassandra scripts for Chat Server

Note: The content of this page is only applicable for version 8.5.104 of Chat Server. For later versions, starting with 8.5.105, initialization scripts are included in the installation package in the subfolder cassandra.

Create keyspace

CREATE KEYSPACE genesys_chat_server 
WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
 
USE genesys_chat_server;

Create tables without a cleanup procedure

CREATE TABLE transcripts (
   id text,
   creatorid text,
   transcript text,
   PRIMARY KEY (id, creatorid) ) 
WITH CLUSTERING ORDER BY (creatorid ASC);
 
Table owner
CREATE TABLE owner (
   id text,
   ownership_start_time timeuuid,
   creatorid text,
   PRIMARY KEY (id, ownership_start_time) )
WITH CLUSTERING ORDER BY (ownership_start_time DESC);

Create tables with a cleanup procedure

You can specify default_time_to_live and gc_grace_seconds, as shown in the following example, where 1209600 is the number of seconds in two weeks:

CREATE TABLE transcripts (
   id text,
   creatorid text,
   transcript text,
   PRIMARY KEY (id, creatorid) ) 
WITH CLUSTERING ORDER BY (creatorid ASC)
AND default_time_to_live = 1209600 AND gc_grace_seconds = 1209600;
 
Table owner
CREATE TABLE owner (
   id text,
   ownership_start_time timeuuid,
   creatorid text,
   PRIMARY KEY (id, ownership_start_time) )
WITH CLUSTERING ORDER BY (ownership_start_time DESC)
AND default_time_to_live = 1209600 AND gc_grace_seconds = 1209600;

For more information, see Deploying Chat Server with Cassandra.

Feedback

Comment on this article:

blog comments powered by Disqus
This page was last modified on October 12, 2018, at 11:52.