【发布时间】:2017-08-13 06:50:41
【问题描述】:
我有一个测试用例,我每秒收到来自客户端的 150k 个请求。
我的测试用例需要将UNLOGGED batch 插入到多个表中并具有不同的分区键
BEGIN UNLOGGED BATCH
update kspace.count_table set counter=counter+1 where source_id= 1 and name='source_name' and pname='Country' and ptype='text' and date='2017-03-20' and pvalue=textAsBlob('US')
update kspace.count_table set counter=counter+1 where source_id= 1 and name='source_name' and pname='City' and ptype='text' and date='2017-03-20' and pvalue=textAsBlob('Dallas')
update kspace.count_table set counter=counter+1 where source_id= 1 and name='source_name' and pname='State' and ptype='text' and date='2017-03-20' and pvalue=textAsBlob('Texas')
update kspace.count_table set counter=counter+1 where source_id= 1 and name='source_name' and pname='SSN' and ptype='text' and date='2017-03-20' and pvalue=decimalAsBlob(000000000);
update kspace.count_table set counter=counter+1 where source_id= 1 and name='source_name' and pname='Gender' and ptype='text' and date='2017-03-20' and pvalue=textAsBlob('Female')
APPLY BATCH
有没有比我目前遵循的更好的方法?
因为目前,我正在批量插入可能存在于不同集群中的多个表,因为它们具有不同的分区键,并且据我所知,将批量查询插入到具有不同分区键的不同表中需要额外的权衡。
【问题讨论】:
标签: java database cassandra datastax