作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是astyanax的新手,尝试了一些示例程序并遇到此错误。这是一个简单的编写,看起来像是在做一些基本错误的事情。不使用复合键。
Caused by: InvalidRequestException(why:Not enough bytes to read value of component 0)
at org.apache.cassandra.thrift.Cassandra$batch_mutate_result.read(Cassandra.java:20833)
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
at org.apache.cassandra.thrift.Cassandra$Client.recv_batch_mutate(Cassandra.java:964)
at org.apache.cassandra.thrift.Cassandra$Client.batch_mutate(Cassandra.java:950)
at com.netflix.astyanax.thrift.ThriftKeyspaceImpl$1$1.internalExecute(ThriftKeyspaceImpl.java:120)
at com.netflix.astyanax.thrift.ThriftKeyspaceImpl$1$1.internalExecute(ThriftKeyspaceImpl.java:117)
at com.netflix.astyanax.thrift.AbstractOperationImpl.execute(AbstractOperationImpl.java:56)
AstyanaxContext<Keyspace> context = new AstyanaxContext.Builder()
.forCluster(CLUSTER_NAME)
.forKeyspace(keySpaceName)
.withAstyanaxConfiguration(new AstyanaxConfigurationImpl()
.setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE)
.setCqlVersion("3.0.0")
.setTargetCassandraVersion("1.2")
)
.withConnectionPoolConfiguration(new ConnectionPoolConfigurationImpl("MyConnectionPool")
.setPort(50825)
.setMaxConnsPerHost(10)
.setSeeds("nodename:50825")
.setConnectTimeout(20000)
)
.withConnectionPoolMonitor(new CountingConnectionPoolMonitor())
.buildKeyspace(ThriftFamilyFactory.getInstance());
context.start();
System.out.println("getting context.. done ");
Keyspace keyspace = context.getEntity();
MutationBatch m = keyspace.prepareMutationBatch();
ColumnFamily<String, String> colFam = new ColumnFamily<String, String>("test",
StringSerializer.get(), StringSerializer.get());
m.withRow(colFam, "abc")
.putColumn("col2", "test1", null);
m.execute();
CREATE TABLE test (
col1 text PRIMARY KEY,
col2 text,
col3 text
) WITH
bloom_filter_fp_chance=0.010000 AND
caching='KEYS_ONLY' AND
comment='' AND
dclocal_read_repair_chance=0.000000 AND
gc_grace_seconds=864000 AND
read_repair_chance=0.100000 AND
replicate_on_write='true' AND
populate_io_cache_on_flush='false' AND
compaction={'class': 'SizeTieredCompactionStrategy'} AND
compression={'sstable_compression': 'SnappyCompressor'};
最佳答案
我也是Astyanax的新手,遇到了相同的异常(exception)。异常(exception)是由于基于Astyanax Thrift的对象认为列定义应与使用CQL 3将其存储在1.2+中之间不匹配。我学会了指定COMPACT STORAGE,以便以1.2之前的格式创建表让我可以通过基于Thrift的对象与之交互。 FWIW:我正在从源代码构建Astyanax,但是我确实在Maven Central看到了1.56.34。我也会对此进行更新。
CREATE TABLE test (
col1 text PRIMARY KEY,
col2 text,
col3 text
) WITH COMPACT STORAGE AND
...
关于Astyanax:引发此异常的简单写入:没有足够的字节来读取组件的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15446187/
对于我的问题,我找不到更好的措辞。 在我的应用程序中的某个时刻,我设置了一些非常密集的动画。问题是,在高端设备上,动画运行流畅且赏心悦目。另一方面,我测试过的一台低端设备在制作动画时表现非常糟糕。 试
我正在修补 OTP 模块 ( yubico_pam ),并尝试访问管理员选择的控制标志(例如必需,足够, ETC)。 有什么想法吗?这是否可行(无需解析文件)? 最佳答案 无法在 API 中查询此信息
我有一些为 Linux 编写的 C 代码,依赖于套接字和 arpa/inet.h 以及 libusb.h,我想在 MinGW 下为 Windows 编译它。 (请注意,当前项目只有一个非常简单的 Ma
我是一名优秀的程序员,十分优秀!