Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法为 cassandra cfs 定义默认 ttl,如果列没有 ttl,则使用该默认 ttl?我不小心错过了为很多列定义 ttl,现在我必须重新定义它。替代方案:是否有一种简单的方法可以批量更新所有列并手动设置 ttl?
无法设置默认 TTL 或进行大规模 TTL 更新。您将需要扫描您的数据并使用 TTL 版本覆盖每一列。
为了在旧数据上设置较低的 TTL,您可能会发现在扫描数据时获取列时间戳很有用。如何指定取决于您使用的客户端;例如,在 pycassa 中,您可能会执行类似cf.get_range('', '', ..., include_timestamp=True).
cf.get_range('', '', ..., include_timestamp=True)