我遇到与mutagen / astyanax连接cassandra的问题。
awk
当我尝试连接时,我得到例外:
CassandraMutagen mutagen = new CassandraMutagenImpl();
mutagen.initialize("/mutations");
AstyanaxContext<Keyspace> ctx = new AstyanaxContext.Builder()
.forKeyspace("anser")
.withConnectionPoolConfiguration(new ConnectionPoolConfigurationImpl("aConfig")
.setSeeds("localhost")
.setPort(9160))
.withAstyanaxConfiguration(
new AstyanaxConfigurationImpl()
.setConnectionPoolType(ConnectionPoolType.TOKEN_AWARE)
.setDiscoveryType(NodeDiscoveryType.NONE))
.buildKeyspace(ThriftFamilyFactory.getInstance());
ctx.start();
Keyspace keyspace = ctx.getClient();
Plan.Result<Integer> result = mutagen.mutate(keyspace);
我尝试将cassandra.yaml中的帧大小设置更改为
com.toddfast.mutagen.MutagenException: Could not create column family "schema_version"
at com.toddfast.mutagen.cassandra.CassandraSubject.getCurrentState(CassandraSubject.java:79)
at com.toddfast.mutagen.cassandra.CassandraCoordinator.accept(CassandraCoordinator.java:48)
at com.toddfast.mutagen.basic.BasicPlanner.getPlan(BasicPlanner.java:66)
at com.toddfast.mutagen.cassandra.impl.CassandraPlanner.getPlan(CassandraPlanner.java:153)
at com.toddfast.mutagen.cassandra.impl.CassandraMutagenImpl.mutate(CassandraMutagenImpl.java:100)
at com.salesforce.analytics.cc.CassandraChangeControlTests2.test_mutagen(CassandraChangeControlTests2.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:44)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: com.netflix.astyanax.connectionpool.exceptions.TransportException: TransportException: [host=localhost(127.0.0.1):9160, latency=2(2), attempts=1]org.apache.thrift.transport.TTransportException: Frame size (352518912) larger than max length (16384000)!
at com.netflix.astyanax.thrift.ThriftConverter.ToConnectionPoolException(ThriftConverter.java:197)
at com.netflix.astyanax.thrift.ThriftSyncConnectionFactoryImpl$ThriftConnection.execute(ThriftSyncConnectionFactoryImpl.java:137)
at com.netflix.astyanax.connectionpool.impl.AbstractExecuteWithFailoverImpl.tryOperation(AbstractExecuteWithFailoverImpl.java:119)
at com.netflix.astyanax.connectionpool.impl.AbstractHostPartitionConnectionPool.executeWithFailover(AbstractHostPartitionConnectionPool.java:338)
at com.netflix.astyanax.thrift.ThriftKeyspaceImpl.executeDdlOperation(ThriftKeyspaceImpl.java:511)
at com.netflix.astyanax.thrift.ThriftKeyspaceImpl.internalCreateColumnFamily(ThriftKeyspaceImpl.java:790)
at com.netflix.astyanax.thrift.ThriftKeyspaceImpl.createColumnFamily(ThriftKeyspaceImpl.java:580)
at com.toddfast.mutagen.cassandra.CassandraSubject.createSchemaVersionTable(CassandraSubject.java:53)
at com.toddfast.mutagen.cassandra.CassandraSubject.getCurrentState(CassandraSubject.java:76)
... 29 more
Caused by: org.apache.thrift.transport.TTransportException: Frame size (352518912) larger than max length (16384000)!
at org.apache.thrift.transport.TFramedTransport.readFrame(TFramedTransport.java:137)
at org.apache.thrift.transport.TFramedTransport.read(TFramedTransport.java:101)
at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86)
at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:429)
at org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:318)
at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:219)
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:69)
at org.apache.cassandra.thrift.Cassandra$Client.recv_set_keyspace(Cassandra.java:608)
at org.apache.cassandra.thrift.Cassandra$Client.set_keyspace(Cassandra.java:595)
at com.netflix.astyanax.thrift.ThriftSyncConnectionFactoryImpl$ThriftConnection.execute(ThriftSyncConnectionFactoryImpl.java:125)
... 36 more
可以看到这反映在启动日志中。但是,我仍然得到相同的frameize异常。
我的cassandra是2.1.12,我的deps是
thrift_framed_transport_size_in_mb: 360
thrift_max_message_length_in_mb: 361
有什么建议吗?
答案 0 :(得分:0)
啊我看到你也必须设置它的客户端,而mutagen-cassandra用(1.56.44)构建的astyanax版本太旧了,不允许配置从源代码重建!