0
我試圖轉儲Cassandra密鑰空間的模式,該模式可用於將其導入另一個密鑰空間,例如備份cassandra密鑰空間並將其還原到具有相同模式的不同密鑰空間中。Cassandra CQL克隆密鑰空間模式
我使用cqlsh:
DROP KEYSPACE mailbox;
CREATE KEYSPACE mailbox
WITH REPLICATION = { 'class': 'SimpleStrategy', 'replication_factor': '1' };
USE mailbox;
CREATE TABLE messages (
id uuid,
user_id uuid,
contents varchar,
created timestamp,
PRIMARY KEY (id, created)
)
WITH CLUSTERING ORDER BY (created DESC);
然後我用CQL功能傾倒什麼,我認爲將是:
[cqlsh 2.3.0 | Cassandra 1.2.2 | CQL spec 3.0.1 | Thrift protocol 19.35.0]
我初步形成了具有聚簇順序時間戳降序排列創建模式有效的CQL3:
cqlsh:mailbox> describe keyspace mailbox;
CREATE KEYSPACE mailbox WITH replication = {
'class': 'SimpleStrategy',
'replication_factor': '1'
};
USE mailbox;
CREATE TABLE messages (
id uuid,
created 'org.apache.cassandra.db.marshal.ReversedType'<timestamp>,
contents text,
user_id uuid,
PRIMARY KEY (id, created)
) WITH
bloom_filter_fp_chance=0.010000 AND
caching='KEYS_ONLY' AND
comment='' AND
dclocal_read_repair_chance=0.000000 AND
gc_grace_seconds=864000 AND
read_repair_chance=0.100000 AND
replicate_on_write='true' AND
populate_io_cache_on_flush='false' AND
compaction={'class': 'SizeTieredCompactionStrategy'} AND
compression={'sstable_compression': 'SnappyCompressor'};
當我嘗試將其導入到cqlsh中時,我得到以下結果翼錯誤:
Bad Request: line 3:56 mismatched input '<' expecting ')'
text could not be lexed at line 16, char 14
我相信它的失敗來解析創建的列定義(最初是用聚簇順序創建者):
created 'org.apache.cassandra.db.marshal.ReversedType'<timestamp>
是否有傾銷的模式其他一些方法給定的密鑰空間?