Hector querySuperColumn 与 countSubColumns 不匹配
我有一个超级列族:
Logger {
superKey : {
nameKey : {name1:val1, name2:val2, ..., name8945:val8945}
}
}
这是一个代码:
ThriftSuperCfTemplate<String, String, String> stringKeyTemplate =
new ThriftSuperCfTemplate<String, String, String>
(keyspace, LOGGER_COLUMN_FAMILY,
StringSerializer.get(), StringSerializer.get(),
StringSerializer.get());
int count = stringKeyTemplate.countSubColumns(NAME_KEY, SUPER_KEY); //1
SuperCfResult<String, String, String> nameRow =
stringKeyTemplate.querySuperColumn(NAME_KEY, SUPER_KEY);
Collection<String> names = nameRow.getColumnNames(); //2
Assert.assertTrue(names.size()==count); //3
我想做的是从 nameKey 列族中获取所有列名,但它只返回前 7 个名称 {name1, name2,..., name7}
(第 2 行),但 count 返回 8945
(第 1 行)。并且断言在第 3 行失败......
I got a super column family:
Logger {
superKey : {
nameKey : {name1:val1, name2:val2, ..., name8945:val8945}
}
}
Here is a code:
ThriftSuperCfTemplate<String, String, String> stringKeyTemplate =
new ThriftSuperCfTemplate<String, String, String>
(keyspace, LOGGER_COLUMN_FAMILY,
StringSerializer.get(), StringSerializer.get(),
StringSerializer.get());
int count = stringKeyTemplate.countSubColumns(NAME_KEY, SUPER_KEY); //1
SuperCfResult<String, String, String> nameRow =
stringKeyTemplate.querySuperColumn(NAME_KEY, SUPER_KEY);
Collection<String> names = nameRow.getColumnNames(); //2
Assert.assertTrue(names.size()==count); //3
What I am trying to do is to fetch all column names from nameKey column family, but it returns only first 7 names {name1, name2,..., name7}
(line 2) but count returns 8945
(line 1). And the assertion fails on line 3...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我无法在 GH 中的当前提示上重现此内容:
https://github.com/rantav/hector/commit/1aa93e78257e86dfc73390cb9c4db52d8ed29a69
我认为 1.0.1 版本和 master 版本之间没有太多变化。如果您可以尝试从主干更新到最新版本并查看问题是否“消失”,我将进一步调查。另外,您运行的 Cassandra 版本是什么?这只是周末出现的,但这可能不是原因:https://issues .apache.org/jira/browse/CASSANDRA-3446
服务器上是否有错误日志?设置 StorageProxy 的日志记录级别以进行调试,并确保通过网络传输的所有内容看起来都正确(调整日志记录级别的详细信息:http://www.datastax.com/docs/1.0/configuration/logging_options)。
I cannot reproduce this on the current tip in GH:
https://github.com/rantav/hector/commit/1aa93e78257e86dfc73390cb9c4db52d8ed29a69
I don't think too much changed here between version 1.0.1 and master. If you could try updating to the latest from trunk and seeing if the problem 'goes away' i'll investigate further. Also, what version of Cassandra are you running? This just came up over the weekend, but it may not be the cause: https://issues.apache.org/jira/browse/CASSANDRA-3446
Are there any error logs on the server? Set the logging level for StorageProxy to debug and make sure everything coming over the wire seems right (details for tweaking logging levels: http://www.datastax.com/docs/1.0/configuration/logging_options).
我发现这只能在我无法手动生成的特定数据上重现。不过我找到了适合我的情况的解决方法:
I have found this is reproducible only on particular data that I could not manually generate. However I found a workaround for my case: