|
| 1 | +/* Creates the cassandra 0.7.x schema necessary for biocache-store |
| 2 | + Run this file using: |
| 3 | + ./cassandra-cli --host localhost --batch < create_cass_schema.txt |
| 4 | +*/ |
| 5 | + |
| 6 | +/* all keyspaces are created using the ByteOrderPreservingPartitioner see the cassandra.yaml file */ |
| 7 | +create keyspace occ; |
| 8 | + |
| 9 | +use occ; |
| 10 | + |
| 11 | +create column family occ with comparator=UTF8Type and default_validation_class=UTF8Type |
| 12 | +and comment='The column family for occurrence records' |
| 13 | +and key_validation_class = 'UTF8Type' |
| 14 | +and compaction_strategy=LeveledCompactionStrategy |
| 15 | +and compaction_strategy_options = {'sstable_size_in_mb' : '200'} |
| 16 | +and column_metadata=[{column_name: portalId, validation_class: UTF8Type, index_type: KEYS}, |
| 17 | +{column_name: uuid, validation_class: UTF8Type, index_type: KEYS}]; |
| 18 | + |
| 19 | +create column family loc with comparator=UTF8Type |
| 20 | +and default_validation_class=UTF8Type |
| 21 | +and key_validation_class = 'UTF8Type' |
| 22 | +and comment ='The column family for locations' |
| 23 | +and compaction_strategy=LeveledCompactionStrategy |
| 24 | +and compaction_strategy_options = {'sstable_size_in_mb' : '200'}; |
| 25 | + |
| 26 | +create column family attr with comparator=UTF8Type |
| 27 | +and default_validation_class=UTF8Type |
| 28 | +and key_validation_class = 'UTF8Type' |
| 29 | +and comment='The column family for attribution tracking' |
| 30 | +and compaction_strategy=LeveledCompactionStrategy; |
| 31 | + |
| 32 | +create column family taxon with comparator=UTF8Type |
| 33 | +and default_validation_class=UTF8Type |
| 34 | +and key_validation_class = 'UTF8Type' |
| 35 | +and comment='The column family for taxon profile information' |
| 36 | +and compaction_strategy=LeveledCompactionStrategy |
| 37 | +and compaction_strategy_options = {'sstable_size_in_mb' : '200'}; |
| 38 | + |
| 39 | + |
| 40 | +/* update column family loc with comparator=UTF8Type and keys_cached=1.0 */ |
| 41 | + |
| 42 | +create column family qa with comparator=UTF8Type |
| 43 | +and default_validation_class=UTF8Type |
| 44 | +and key_validation_class = 'UTF8Type' |
| 45 | +and comment='The column family for quality assertions' |
| 46 | +and column_metadata=[{column_name: userId, validation_class: UTF8Type, index_type: KEYS}, |
| 47 | +{column_name:code, validation_class: UTF8Type, index_type: KEYS}] |
| 48 | +and compaction_strategy=LeveledCompactionStrategy |
| 49 | +and compaction_strategy_options = {'sstable_size_in_mb' : '200'}; |
| 50 | + |
| 51 | +create column family dellog |
| 52 | + with comparator = 'UTF8Type' |
| 53 | + and default_validation_class = 'UTF8Type' |
| 54 | + and key_validation_class = 'UTF8Type' |
| 55 | + and compaction_strategy = 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy' |
| 56 | + and compaction_strategy_options = {'sstable_size_in_mb' : '200'} |
| 57 | + and comment = 'The column family to log deleted information'; |
| 58 | + |
| 59 | +create column family duplicates |
| 60 | + with comparator = 'UTF8Type' |
| 61 | + and default_validation_class = 'UTF8Type' |
| 62 | + and key_validation_class = 'UTF8Type' |
| 63 | + and compaction_strategy = 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy' |
| 64 | + and compaction_strategy_options = {'sstable_size_in_mb' : '200'} |
| 65 | + and comment = 'The column family to store information about duplicates'; |
| 66 | + |
| 67 | +create column family occ_duplicates |
| 68 | + with comparator = 'UTF8Type' |
| 69 | + and default_validation_class = 'UTF8Type' |
| 70 | + and key_validation_class = 'UTF8Type' |
| 71 | + and compaction_strategy = 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy' |
| 72 | + and compaction_strategy_options = {'sstable_size_in_mb' : '200'} |
| 73 | + and comment = 'The column family to store information about duplicates'; |
| 74 | + |
| 75 | +create column family upload |
| 76 | + with comparator = 'UTF8Type' |
| 77 | + and default_validation_class = 'UTF8Type' |
| 78 | + and key_validation_class = 'UTF8Type' |
| 79 | + and compaction_strategy = 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy' |
| 80 | + and compaction_strategy_options = {'sstable_size_in_mb' : '200'} |
| 81 | + and comment = 'The column family to store information about dynamically uploaded datasets'; |
| 82 | + |
| 83 | +create column family outliers with comparator = 'UTF8Type' and default_validation_class = 'UTF8Type' |
| 84 | +and comment='The column family for occurrence records' and gc_grace=2000; |
| 85 | + |
| 86 | +create column family occ_outliers with comparator = 'UTF8Type' and default_validation_class = 'UTF8Type' |
| 87 | +and comment='The column family for occurrence records' and gc_grace=2000; |
| 88 | + |
| 89 | +update column family outliers with comparator = 'UTF8Type' and default_validation_class = 'UTF8Type' |
| 90 | +and column_metadata=[{column_name: portalId, validation_class: UTF8Type, index_type: KEYS}, |
| 91 | +{column_name: uuid, validation_class: UTF8Type, index_type: KEYS}]; |
| 92 | + |
| 93 | +update column family occ_outliers with comparator = 'UTF8Type' and default_validation_class = 'UTF8Type' |
| 94 | +and column_metadata=[{column_name: portalId, validation_class: UTF8Type, index_type: KEYS}, |
| 95 | +{column_name: uuid, validation_class: UTF8Type, index_type: KEYS}]; |
| 96 | + |
| 97 | + |
| 98 | +create column family queryassert |
| 99 | + with comparator = 'UTF8Type' |
| 100 | + and default_validation_class = 'UTF8Type' |
| 101 | + and key_validation_class = 'UTF8Type' |
| 102 | + and compaction_strategy = 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy' |
| 103 | + and compaction_strategy_options = {'sstable_size_in_mb' : '200'} |
| 104 | + and comment = 'The column family to store information about query based assertions'; |
| 105 | + |
| 106 | +update column family queryassert with column_metadata=[{column_name: uuid, validation_class: UTF8Type, index_type: KEYS}]; |
| 107 | + |
| 108 | +create column family distribution_outliers |
| 109 | + with comparator = 'UTF8Type' |
| 110 | + and default_validation_class = 'UTF8Type' |
| 111 | + and key_validation_class = 'UTF8Type' |
| 112 | + and compaction_strategy = 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy' |
| 113 | + and compaction_strategy_options = {'sstable_size_in_mb' : '200'} |
| 114 | + and comment = 'The column family to store information about expert distribution outlier records'; |
| 115 | + |
| 116 | +create column family qid |
| 117 | + with comparator = 'UTF8Type' |
| 118 | + and default_validation_class = 'UTF8Type' |
| 119 | + and key_validation_class = 'UTF8Type' |
| 120 | + and compaction_strategy = 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy' |
| 121 | + and compaction_strategy_options = {'sstable_size_in_mb' : '200'} |
| 122 | + and comment = 'The column family to store information about stored query requests (qid)'; |
0 commit comments