我的實習需要我熟悉cassandra。我下載了astyanax卡桑德拉: 混帳克隆[email protected]: https://github.com/Netflix/astyanax
通過命令從源代碼構建astyanax後的Netflix/astyanax.git CD astyanax ./gradlew建立
我創建了一個新的Java項目和複製+粘貼示例代碼從這裏: https://github.com/Netflix/astyanax/blob/master/astyanax-examples/src/main/java/com/netflix/astyanax/examples/AstCQLClient.java
現在出現問題。我確實修復了路徑配置,該配置導入了從gradlew構建生成的所有.jar文件。但是,一個代碼(長)線由紅色虛線強調:
context = new AstyanaxContext.Builder()
.forCluster("Test Cluster")
.forKeyspace("test1")
.withAstyanaxConfiguration(new AstyanaxConfigurationImpl()
.setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE)
)
.withConnectionPoolConfiguration(new ConnectionPoolConfigurationImpl("MyConnectionPool")
.setPort(9160)
.setMaxConnsPerHost(1)
.setSeeds("127.0.0.1:9160")
)
.withAstyanaxConfiguration(new AstyanaxConfigurationImpl()
.setCqlVersion("3.0.0")
.setTargetCassandraVersion("1.2"))
.withConnectionPoolMonitor(new CountingConnectionPoolMonitor())
.buildKeyspace(ThriftFamilyFactory.getInstance());
警告消息是: 類型org.apache.cassandra.thrift.Cassandra $客戶端無法解析。它是從所需的.class文件間接引用的
我需要專家的幫助。非常感謝!!!
我想試試。 Thx男人! – user2612604