即使我的查询中没有选项,您能否提出建议 如果存在和不存在。 仍在查询跟踪中,结果显示了我们想要的一致性级别“ QUORUM”
但它也显示'serial_consistency_level':'SERIAL',这是什么行为
session_id | client | command | coordinator | duration | parameters | request | started_at
--------------------------------------+-------------+---------+-------------+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------+---------------------------------
278a2000-3dfb-11e9-b459-9775e6c46fc6 | 10.244.*.* | QUERY | 10.244.*.* | 3338 |
`
`{'bound_var_0_stream_id': '''3c17230d-ea24-4ff7-9599-352fef883b31''',
'bound_var_1_property_name': '''Location:rxRSSI''',
'bound_var_2_shard_date': '2019-03-03T00:00:00.000Z',
'bound_var_3_time': '2019-03-03T21:27:30.749Z',
'bound_var_4_source_id': '''fe30653c-467f-401a-9646-67b10378e1c9''',
'bound_var_5_time_lag': '1328',
'bound_var_6_property_class': '''java.lang.Integer''',
'bound_var_7_property_type': '''ByteType''',
'bound_var_8_property_value': '''-44''',
'consistency_level': 'LOCAL_QUORUM',
'page_size': '5000',
'query': 'INSERT INTO "cloudleaf"."stream_48" ("stream_id", "property_name", "shard_date", "time", "source_id", "time_lag", "property_class", "property_type", "property_value")
VALUES (:"stream_id", :"property_name", :"shard_date", :"time", :"source_id", :"time_lag", :"property_class", :"property_type", :"property_value")
USING TTL 432000',
'serial_consistency_level': 'SERIAL'}
答案 0 :(得分:2)
array:1 [▼
1 => array:6 [▼
"name" => "Carocroc Lam"
"image" => "carocroc_lam_15kg.jpg"
"price" => 45.95
"unit" => 15
"name_unit" => "kg"
"amount" => "2"
]
]
和IF EXISTS
触发轻量级事务,该事务可以具有两个一致性级别IF NOT EXISTS
或SERIAL
之一。定义如下:
LOCAL_SERIAL
:
通过防止无条件更新来实现轻量级事务的线性化一致性。此一致性级别仅适用于轻量级事务。相当于QUORUM。
SERIAL
:
与SERIAL相同,但仅限于数据中心。必须将条件写入写入提交日志,并且必须将其写入同一数据中心内一定数量的副本节点上。与SERIAL相同,但用于在本地(在单个数据中心内)保持一致性。等同于LOCAL_QUORUM。
请参阅:https://docs.datastax.com/en/cassandra/3.0/cassandra/dml/dmlConfigSerialConsistency.html