无法从Cassandra检索数据 [英] Unable to retrieve data from Cassandra

查看:116
本文介绍了无法从Cassandra检索数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我退出cli后无法从Cassandra检索数据。当我回到另一个会话中获取数据时,我收到此错误:

I cannot retrieve data from Cassandra after I exit the cli. When I go back to get the data in another session, I get this error:

org.apache.cassandra.db.marshal.MarshalException:无法解析'jsmith'十六进制字节

org.apache.cassandra.db.marshal.MarshalException: cannot parse 'jsmith' as hex bytes

似乎列族一直保留在键空间。

It seems the column family stays and the keyspace too.

ascii(假设用户键为ascii;)...这也不会留下。

I also changed the keys format to ascii (assume Users keys as ascii;)... And that does not stay set either.

有理由吗?发生了什么?

Is there a reason why? What is going on?

推荐答案

所有的假设命令都是临时的,并且限于单个cli会话。对于那些不是坐在cli前面的人,我们指的是这些:

All of the "assume" commands are temporary and limited to a single cli session. For those not sitting in front of the cli right now, we're referring to these:

assume <cf> comparator as <type>;
assume <cf> sub_comparator as <type>;
assume <cf> validator as <type>;
assume <cf> keys as <type>;

Assume one of the attributes (comparator, sub_comparator, validator or keys)
of the given column family match specified type. The specified type will
be used when displaying data returned from the column family.

这些是纯粹的客户端。

These are purely client side.

您想要做的是将元数据永久记录在ColumnFamily定义中,例如从readme,

What you want to do instead is to record that metadata permanently in the ColumnFamily definition, e.g. from the readme,

create column family Users with comparator=UTF8Type and default_validation_class=UTF8Type and key_validation_class=UTF8Type;

这与假设有三种不同:


  1. 它永久记录在Cassandra中

  2. Cassandra将根据插入的数据强制执行指定的类型

  3. 全部客户端可以查询和使用这些元数据来做智能的事情,而不只是cli

假设主要是作为旧的解决方法无法更新以使用真实服务器端类型的数据集。

Assume is primarily there as a workaround for old data sets that cannot be updated to use a "real" server-side type.

这篇关于无法从Cassandra检索数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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