Cassandra 冻结的关键字含义 [英] Cassandra frozen keyword meaning

查看:18
本文介绍了Cassandra 冻结的关键字含义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Cassandra中frozen关键字是什么意思?

What's the meaning of the frozen keyword in Cassandra?

我正在尝试阅读此文档页面:使用用户定义的类型,但他们对 frozen 关键字(他们在示例中使用)的解释对我来说不够清楚:

I'm trying to read this documentation page: Using a user-defined type, but their explanation for the frozen keyword (which they use in their examples) is not clear enough for me:

为了支持未来的功能,用户定义的列定义或元组类型需要 freeze 关键字.Cassandra 序列化一个将具有多个组件的冻结值转换为单个值.为了示例和使用信息,请参阅使用用户定义的类型",元组类型"和集合类型.

To support future capabilities, a column definition of a user-defined or tuple type requires the frozen keyword. Cassandra serializes a frozen value having multiple components into a single value. For examples and usage information, see "Using a user-defined type", "Tuple type", and Collection type.

我在网上没有找到任何其他定义或明确的解释.

I haven't found any other definition or a clear explanation for that in the net.

推荐答案

在 Cassandra 中,如果您将 UDT 或 Collection 定义为冻结,则无法更新 UDT 或集合的单个项目,您必须重新插入完整值.

冻结值将多个组件序列化为单个值.非冻结类型允许更新单个字段.Cassandra 将冻结类型的值视为 blob.必须覆盖整个值.

A frozen value serializes multiple components into a single value. Non-frozen types allow updates to individual fields. Cassandra treats the value of a frozen type as a blob. The entire value must be overwritten.

来源:https://docs.datastax.com/en/cql/3.1/cql/cql_reference/collection_type_r.html

@Alon : 长话短说:frozen = immutable"

这篇关于Cassandra 冻结的关键字含义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆