Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cassandra 映射类型读取延迟_Cassandra_Cassandra 2.0_Cassandra 2.1 - Fatal编程技术网

Cassandra 映射类型读取延迟

Cassandra 映射类型读取延迟,cassandra,cassandra-2.0,cassandra-2.1,Cassandra,Cassandra 2.0,Cassandra 2.1,首先,感谢所有回答我们所有问题的人 我希望人们能帮我摆脱困境,但我在其中一点上被绊住了 我有6个节点的Apache2.1集群,我创建了一个有3列的表。第一列是文本类型,另外两列是映射类型。当我将数据插入表中并读取数据时..获取一行大约需要20毫秒,但如果我为所有3列创建一个文本类型的表,则只需要5毫秒。请告诉我我是否丢失了..如果是映射类型,为什么需要时间?? 我对启动映射类型读取延迟感到困惑 以下是cfstats和查询: 表: PRODUCT_TYPE SSTable count: 1 SST

首先,感谢所有回答我们所有问题的人

我希望人们能帮我摆脱困境,但我在其中一点上被绊住了

我有6个节点的Apache2.1集群,我创建了一个有3列的表。第一列是文本类型,另外两列是映射类型。当我将数据插入表中并读取数据时..获取一行大约需要20毫秒,但如果我为所有3列创建一个文本类型的表,则只需要5毫秒。请告诉我我是否丢失了..如果是映射类型,为什么需要时间?? 我对启动映射类型读取延迟感到困惑

以下是cfstats和查询:

表:

PRODUCT_TYPE
SSTable count: 1
SSTables in each level: [1, 0, 0, 0, 0, 0, 0, 0, 0]
Space used (live): 81458
Space used (total): 81458
Space used by snapshots (total): 0
Off heap memory used (total): 87
SSTable Compression Ratio: 0.15090414689301526
Number of keys (estimate): 6
Memtable cell count: 0
Memtable data size: 0
Memtable off heap memory used: 0
Memtable switch count: 0
Local read count: 5
Local read latency: 22.494 ms
Local write count: 0
Local write latency: NaN ms
Pending flushes: 0
Bloom filter false positives: 0
Bloom filter false ratio: 0.00000
Bloom filter space used: 16
Bloom filter off heap memory used: 8
Index summary off heap memory used: 15
Compression metadata off heap memory used: 64
Compacted partition minimum bytes: 73458
Compacted partition maximum bytes: 105778
Compacted partition mean bytes: 91087
Average live cells per slice (last five minutes): 1.0
Maximum live cells per slice (last five minutes): 1.0
Average tombstones per slice (last five minutes): 0.0
Maximum tombstones per slice (last five minutes): 0.0

CREATE TABLE TEST.PRODUCT_TYPE (
type text PRIMARY KEY,
col1 map<int, boolean>,
timestamp_map map<int, timestamp>
) WITH bloom_filter_fp_chance = 0.1
AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}'
AND comment = ''
AND compaction = {'min_threshold': '4', 'class':                       'org.apache.cassandra.db.compaction.LeveledCompactionStrategy', 'max_threshold': '32'}
AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99.0PERCENTILE';


 activity                                                                                                              | timestamp                  | source        | source_elapsed
 -----------------------------------------------------------------------------------------------------------------------+----------------------------+---------------+----------------
                                                                                                    Execute CQL3 query | 2015-06-03 21:57:36.841000 | 10.65.133.202 |              0
                                            Parsing SELECT * from location_eligibility_by_type5; [SharedPool-Worker-1] | 2015-06-03 21:57:36.842000 | 10.65.133.202 |             54
                                                                             Preparing statement [SharedPool-Worker-1] | 2015-06-03 21:57:36.842000 | 10.65.133.202 |             86
                                                                       Computing ranges to query [SharedPool-Worker-1] | 2015-06-03 21:57:36.842000 | 10.65.133.202 |            165
  Submitting range requests on 1537 ranges with a concurrency of 1 (0.0 rows per range expected) [SharedPool-Worker-1] | 2015-06-03 21:57:36.842000 | 10.65.133.202 |            410
                                                             Enqueuing request to /10.65.137.191 [SharedPool-Worker-1] | 2015-06-03 21:57:36.849000 | 10.65.133.202 |           7448
                                                                      Message received from /10.65.133.202 [Thread-15] | 2015-06-03 21:57:36.849000 | 10.65.137.191 |             15
                                      Submitted 1 concurrent range requests covering 1537 ranges [SharedPool-Worker-1] | 2015-06-03 21:57:36.849000 | 10.65.133.202 |           7488
                                                              Sending message to /10.65.137.191 [WRITE-/10.65.137.191] | 2015-06-03 21:57:36.849000 | 10.65.133.202 |           7515
 Executing seq scan across 0 sstables for [min(-9223372036854775808), min(-9223372036854775808)] [SharedPool-Worker-1] | 2015-06-03 21:57:36.850000 | 10.65.137.191 |            105
                                                              Read 1 live and 0 tombstoned cells [SharedPool-Worker-1] | 2015-06-03 21:57:36.866000 | 10.65.137.191 |          16851
                                                              Read 1 live and 0 tombstoned cells [SharedPool-Worker-1] | 2015-06-03 21:57:36.882000 | 10.65.137.191 |          33542
                                                              Read 1 live and 0 tombstoned cells [SharedPool-Worker-1] | 2015-06-03 21:57:36.899000 | 10.65.137.191 |          50206
                                                              Read 1 live and 0 tombstoned cells [SharedPool-Worker-1] | 2015-06-03 21:57:36.915000 | 10.65.137.191 |          66556
                                                              Read 1 live and 0 tombstoned cells [SharedPool-Worker-1] | 2015-06-03 21:57:36.932000 | 10.65.137.191 |          82814
                                                                    Scanned 5 rows and matched 5 [SharedPool-Worker-1] | 2015-06-03 21:57:36.932000 | 10.65.137.191 |          82839
                                                            Enqueuing response to /10.65.133.202 [SharedPool-Worker-1] | 2015-06-03 21:57:36.933000 | 10.65.137.191 |          82878
                                                              Sending message to /10.65.133.202 [WRITE-/10.65.133.202] | 2015-06-03 21:57:36.933000 | 10.65.137.191 |          83054
                                                                     Message received from /10.65.137.191 [Thread-151] | 2015-06-03 21:57:36.944000 | 10.65.133.202 |         102134
                                                         Processing response from /10.65.137.191 [SharedPool-Worker-2] | 2015-06-03 21:57:36.944000 | 10.65.133.202 |         102191
                                                                                                      Request complete | 2015-06-03 21:57:36.948916 | 10.65.133.202 |         107916
产品类型
表计数:1
每个级别中的SSTables:[1,0,0,0,0,0,0,0]
使用空间(现场):81458
使用空间(总计):81458
快照使用的空间(总计):0
使用的堆外内存(总数):87
SSTable压缩比:0.15090414689301526
钥匙数量(估计):6个
Memtable单元格计数:0
Memtable数据大小:0
已使用Memtable堆外内存:0
Memtable开关计数:0
本地读取计数:5
本地读取延迟:22.494毫秒
本地写入计数:0
本地写入延迟:毫秒
挂起的刷新:0
Bloom筛选器误报:0
布卢姆过滤器错误率:0.00000
使用的布卢姆过滤器空间:16
使用的Bloom筛选器堆外内存:8
使用的索引摘要堆外内存:15
使用的压缩元数据堆外内存:64
压缩分区最小字节数:73458
压缩分区最大字节数:105778
压缩分区平均字节数:91087
平均每片活细胞数(过去五分钟):1.0
每片最大活细胞数(过去五分钟):1.0
每片平均墓碑数(过去五分钟):0.0
每片最大墓碑数(过去五分钟):0.0
创建表TEST.PRODUCT\u TYPE(
键入文本主键,
col1地图,
时间戳映射
)使用bloom_过滤器时,fp_概率=0.1
和缓存=“{”键“:“所有”,“每个分区的行“:“无”}”
和注释=“”
压缩={'min_threshold':'4','class':'org.apache.cassandra.db.compression.LeveledCompactionStrategy','max_threshold':'32'}
压缩={'sstable_compression':'org.apache.cassandra.io.compress.LZ4Compressor'}
和dclocal\u read\u repair\u chance=0.1
并且默认的\u time\u to\u live=0
gc_grace_秒=864000
最大指数间隔=2048
和memtable_flush_period_in_ms=0
最小索引间隔=128
并读取_repair_chance=0.0
推测性_重试='99.0百分位';
活动|时间戳|源|源|已过
-----------------------------------------------------------------------------------------------------------------------+----------------------------+---------------+----------------
执行CQL3查询| 2015-06-03 21:57:36.841000 | 10.65.133.202 | 0
按类型5分析从位置选择*;[SharedPool-Worker-1]| 2015-06-03 21:57:36.842000 | 10.65.133.202 | 54
编制报表[SharedPool-Worker-1]| 2015-06-03 21:57:36.842000 | 10.65.133.202 | 86
要查询的计算范围[SharedPool-Worker-1]| 2015-06-03 21:57:36.842000 | 10.65.133.202 | 165
提交1537个范围上的范围请求,并发性为1(预期每个范围0.0行)[SharedPool-Worker-1]| 2015-06-03 21:57:36.842000 | 10.65.133.202 | 410
排队请求至/10.65.137.191[共享工具-工人-1]| 2015-06-03 21:57:36.849000 | 10.65.133.202 | 7448
从/10.65.133.202[线程-15]收到的消息| 2015-06-03 21:57:36.849000 | 10.65.137.191 | 15
提交了1份涉及1537个范围的并发范围请求[SharedPool-Worker-1]| 2015-06-03 21:57:36.849000 | 10.65.133.202 | 7488
将消息发送到/10.65.137.191[写入-/10.65.137.191]| 2015-06-03 21:57:36.849000 | 10.65.133.202 | 7515
针对[min(-9223372036854775808)、min(-9223372036854775808)][SharedPool-Worker-1]| 2015-06-03 21:57:36.850000 | 10.65.137.191 | 105跨0个sstables执行序列扫描
阅读1个活细胞和0个墓碑细胞[SharedPool-Worker-1]| 2015-06-03 21:57:36.866000 | 10.65.137.191 | 16851
阅读1个活细胞和0个墓碑细胞[SharedPool-Worker-1]| 2015-06-03 21:57:36.882000 | 10.65.137.191 | 33542
阅读1个活细胞和0个墓碑细胞[SharedPool-Worker-1]| 2015-06-03 21:57:36.899000 | 10.65.137.191 | 50206
阅读1个活细胞和0个墓碑细胞[SharedPool-Worker-1]| 2015-06-03 21:57:36.915000 | 10.65.137.191 | 66556
阅读1个活细胞和0个墓碑细胞[SharedPool-Worker-1]| 2015-06-03 21:57:36.932000 | 10.65.137.191 | 82814
扫描了5行并匹配了5[SharedPool-Worker-1]| 2015-06-03 21:57:36.932000 | 10.65.137.191 | 82839
排队响应/10.65.133.202[SharedPool-Worker-1]| 2015-06-03 21:57:36.933000 | 10.65.137.191 | 82878
正在向/10.65.133发送消息。
create table no_collections(id int, value text, primary key (id));
create table with_collections(id int, value set<text>, primary key (id));

cqlsh:stackoverflow> select * from no_collections ;

 id | value
----+-------------
  1 | foo,bar,baz
  2 | xxx,yyy,zzz
  3 | aaa,bbb,ccc

(3 rows)
cqlsh:stackoverflow> select * from with_collections ;

 id | value
----+-----------------------
  1 | {'bar', 'baz', 'foo'}
  2 | {'xxx', 'yyy', 'zzz'}
  3 | {'aaa', 'bbb', 'ccc'}

(3 rows)
cqlsh:stackoverflow> TRACING ON ;
Now Tracing is enabled
cqlsh:stackoverflow> select * from with_collections where id=3;

 id | value
----+-----------------------
  3 | {'aaa', 'bbb', 'ccc'}

(1 rows)

Tracing session: 7c3d4ed0-09c8-11e5-b4cd-2988e70b20cb

activity                                                                                            | timestamp                  | source    | source_elapsed
-------------------------------------------------------------------------------------------------+----------------------------+-----------+----------------
                                                                              Execute CQL3 query | 2015-06-03 11:13:58.717000 | 127.0.0.1 |              0
                        Parsing select * from with_collections where id=3; [SharedPool-Worker-1] | 2015-06-03 11:13:58.718000 | 127.0.0.1 |             72
                                                       Preparing statement [SharedPool-Worker-1] | 2015-06-03 11:13:58.718000 | 127.0.0.1 |            218
                      Executing single-partition query on with_collections [SharedPool-Worker-3] | 2015-06-03 11:13:58.718000 | 127.0.0.1 |            547
                                              Acquiring sstable references [SharedPool-Worker-3] | 2015-06-03 11:13:58.718000 | 127.0.0.1 |            556
                                               Merging memtable tombstones [SharedPool-Worker-3] | 2015-06-03 11:13:58.719000 | 127.0.0.1 |            574
 Skipped 0/0 non-slice-intersecting sstables, included 0 due to tombstones [SharedPool-Worker-3] | 2015-06-03 11:13:58.719000 | 127.0.0.1 |            636
                                Merging data from memtables and 0 sstables [SharedPool-Worker-3] | 2015-06-03 11:13:58.719000 | 127.0.0.1 |            644
                                        Read 1 live and 0 tombstoned cells [SharedPool-Worker-3] | 2015-06-03 11:13:58.719000 | 127.0.0.1 |            673
                                                                                Request complete | 2015-06-03 11:13:58.717847 | 127.0.0.1 |            847
cqlsh:stackoverflow> select * from no_collections where id=3;

 id | value
----+-------------
  3 | aaa,bbb,ccc

(1 rows)

Tracing session: 7e9ac6d0-09c8-11e5-b4cd-2988e70b20cb

 activity                                                                                        | timestamp                  | source    | source_elapsed
-------------------------------------------------------------------------------------------------+----------------------------+-----------+----------------
                                                                              Execute CQL3 query | 2015-06-03 11:14:02.685000 | 127.0.0.1 |              0
                          Parsing select * from no_collections where id=3; [SharedPool-Worker-1] | 2015-06-03 11:14:02.686000 | 127.0.0.1 |             77
                                                       Preparing statement [SharedPool-Worker-1] | 2015-06-03 11:14:02.686000 | 127.0.0.1 |            209
                        Executing single-partition query on no_collections [SharedPool-Worker-3] | 2015-06-03 11:14:02.686000 | 127.0.0.1 |            525
                                              Acquiring sstable references [SharedPool-Worker-3] | 2015-06-03 11:14:02.686000 | 127.0.0.1 |            534
                                               Merging memtable tombstones [SharedPool-Worker-3] | 2015-06-03 11:14:02.687000 | 127.0.0.1 |            553
 Skipped 0/0 non-slice-intersecting sstables, included 0 due to tombstones [SharedPool-Worker-3] | 2015-06-03 11:14:02.687000 | 127.0.0.1 |            598
                                Merging data from memtables and 0 sstables [SharedPool-Worker-3] | 2015-06-03 11:14:02.688000 | 127.0.0.1 |            606
                                        Read 1 live and 0 tombstoned cells [SharedPool-Worker-3] | 2015-06-03 11:14:02.688000 | 127.0.0.1 |            630
                                                                                Request complete | 2015-06-03 11:14:02.685789 | 127.0.0.1 |            789