I can't get NodeDiscoveryType.RING_DESCRIBE to work

26 views
Skip to first unread message

Kevin Esler

unread,
Nov 11, 2015, 3:48:50 PM11/11/15
to Astyanax Cassandra Client
I am trying to get NodeDiscoveryType.RING_DESCRIBE to work in some unit test code, prior to making a similar change to our production code.

It doesn't seem to work as advertised.

Here is how I construct my AstyanaxContext[Keyspace]:

  def newKeyspaceContext(seeds: String, keyspaceName: String): AstyanaxContext[Keyspace] = {
    val result
= new AstyanaxContext.Builder()
     
.forCluster(CLUSTER_NAME)
     
.forKeyspace(keyspaceName)
     
.withConnectionPoolConfiguration(new ConnectionPoolConfigurationImpl("poolname")
       
.setPort(9160)
       
.setMaxConnsPerHost(MAX_CONNS_PER_HOST)
       
.setInitConnsPerHost(10)
       
.setSeeds(seeds)
       
.setMaxTimeoutWhenExhausted(11000) // Default : 2000
       
.setConnectTimeout(10000) // Default : 2000
     
)
     
.withConnectionPoolMonitor(new Slf4jConnectionPoolMonitorImpl())
     
.withAstyanaxConfiguration(new AstyanaxConfigurationImpl()
       
.setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE)
       
.setConnectionPoolType(ConnectionPoolType.ROUND_ROBIN)
     
)
     
.buildKeyspace(ThriftFamilyFactory.getInstance)
    result
.start

    result
 
}


When I attempt to use this in a unit test the following error occurs.   Any advice appreciated.

If I switch back to NodeDiscoveryType.NONE things work fine.

com.netflix.astyanax.connectionpool.exceptions.NoAvailableHostsException: NoAvailableHostsException: [host=None(0.0.0.0):0, latency=0(0), attempts=0]No hosts to borrow from
    at com
.netflix.astyanax.connectionpool.impl.RoundRobinExecuteWithFailover.<init>(RoundRobinExecuteWithFailover.java:48)
    at com
.netflix.astyanax.connectionpool.impl.RoundRobinConnectionPoolImpl.newExecuteWithFailover(RoundRobinConnectionPoolImpl.java:66)
    at com
.netflix.astyanax.connectionpool.impl.AbstractHostPartitionConnectionPool.executeWithFailover(AbstractHostPartitionConnectionPool.java:338)
    at com
.netflix.astyanax.thrift.ThriftKeyspaceImpl.executeOperation(ThriftKeyspaceImpl.java:517)
    at com
.netflix.astyanax.thrift.ThriftKeyspaceImpl.internalDescribeKeyspace(ThriftKeyspaceImpl.java:268)
    at com
.netflix.astyanax.thrift.ThriftKeyspaceImpl.describeKeyspace(ThriftKeyspaceImpl.java:264)
    at com
.timetrade.ewsconnector.persistence.Datastore$$anonfun$describeColumnFamily$1.apply(Datastore.scala:131)
    at com
.timetrade.ewsconnector.persistence.Datastore$$anonfun$describeColumnFamily$1.apply(Datastore.scala:132)
    at scala
.util.control.Exception$Catch.apply(Exception.scala:103)
    at com
.timetrade.ewsconnector.persistence.ExceptionLogging$class.withExceptionsLogged(ExceptionLogging.scala:18)
    at com
.timetrade.ewsconnector.persistence.Datastore.withExceptionsLogged(Datastore.scala:43)
    at com
.timetrade.ewsconnector.persistence.Datastore.describeColumnFamily(Datastore.scala:130)
    at com
.timetrade.ewsconnector.persistence.Datastore.columnFamilyExists(Datastore.scala:140)
    at com
.timetrade.ewsconnector.persistence.Datastore$$anonfun$1.apply(Datastore.scala:103)
    at com
.timetrade.ewsconnector.persistence.Datastore$$anonfun$1.apply(Datastore.scala:103)
    at scala
.collection.TraversableLike$$anonfun$filterImpl$1.apply(TraversableLike.scala:259)
    at scala
.collection.immutable.List.foreach(List.scala:381)
    at scala
.collection.TraversableLike$class.filterImpl(TraversableLike.scala:258)
    at scala
.collection.TraversableLike$class.filter(TraversableLike.scala:270)
    at scala
.collection.AbstractTraversable.filter(Traversable.scala:104)
    at com
.timetrade.ewsconnector.persistence.Datastore.ensureColumnFamiliesExist(Datastore.scala:103)
    at com
.timetrade.ewsconnector.persistence.MapInARowJsonDAO.<init>(MapInARowJsonDAO.scala:44)
    at com
.timetrade.ewsconnector.persistence.MapInARowJsonDAOSpec.withFixture(MapInARowJsonDAOSpec.scala:36)
    at org
.scalatest.fixture.FunSpecLike$class.invokeWithFixture$1(FunSpecLike.scala:428)
    at org
.scalatest.fixture.FunSpecLike$$anonfun$runTest$1.apply(FunSpecLike.scala:439)
    at org
.scalatest.fixture.FunSpecLike$$anonfun$runTest$1.apply(FunSpecLike.scala:439)
    at org
.scalatest.SuperEngine.runTestImpl(Engine.scala:306)
    at org
.scalatest.fixture.FunSpecLike$class.runTest(FunSpecLike.scala:439)
    at com
.timetrade.ewsconnector.persistence.MapInARowJsonDAOSpec.org$scalatest$BeforeAndAfterEachTestData$$super$runTest(MapInARowJsonDAOSpec.scala:15)
    at org
.scalatest.BeforeAndAfterEachTestData$class.runTest(BeforeAndAfterEachTestData.scala:193)
    at com
.timetrade.ewsconnector.persistence.MapInARowJsonDAOSpec.runTest(MapInARowJsonDAOSpec.scala:15)
    at org
.scalatest.fixture.FunSpecLike$$anonfun$runTests$1.apply(FunSpecLike.scala:483)
    at org
.scalatest.fixture.FunSpecLike$$anonfun$runTests$1.apply(FunSpecLike.scala:483)
    at org
.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:413)
    at org
.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:401)
    at scala
.collection.immutable.List.foreach(List.scala:381)
    at org
.scalatest.SuperEngine.traverseSubNodes$1(Engine.scala:401)
    at org
.scalatest.SuperEngine.org$scalatest$SuperEngine$$runTestsInBranch(Engine.scala:390)
    at org
.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:427)
    at org
.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:401)
    at scala
.collection.immutable.List.foreach(List.scala:381)
    at org
.scalatest.SuperEngine.traverseSubNodes$1(Engine.scala:401)
    at org
.scalatest.SuperEngine.org$scalatest$SuperEngine$$runTestsInBranch(Engine.scala:396)
    at org
.scalatest.SuperEngine.runTestsImpl(Engine.scala:483)
    at org
.scalatest.fixture.FunSpecLike$class.runTests(FunSpecLike.scala:483)
    at org
.scalatest.fixture.FunSpec.runTests(FunSpec.scala:242)
    at org
.scalatest.Suite$class.run(Suite.scala:1424)
    at org
.scalatest.fixture.FunSpec.org$scalatest$fixture$FunSpecLike$$super$run(FunSpec.scala:242)
    at org
.scalatest.fixture.FunSpecLike$$anonfun$run$1.apply(FunSpecLike.scala:505)
    at org
.scalatest.fixture.FunSpecLike$$anonfun$run$1.apply(FunSpecLike.scala:505)
    at org
.scalatest.SuperEngine.runImpl(Engine.scala:545)
    at org
.scalatest.fixture.FunSpecLike$class.run(FunSpecLike.scala:505)
    at com
.timetrade.ewsconnector.persistence.MapInARowJsonDAOSpec.org$scalatest$BeforeAndAfterAll$$super$run(MapInARowJsonDAOSpec.scala:15)
    at org
.scalatest.BeforeAndAfterAll$class.liftedTree1$1(BeforeAndAfterAll.scala:257)
    at org
.scalatest.BeforeAndAfterAll$class.run(BeforeAndAfterAll.scala:256)
    at com
.timetrade.ewsconnector.persistence.MapInARowJsonDAOSpec.run(MapInARowJsonDAOSpec.scala:15)
    at org
.scalatest.Suite$class.callExecuteOnSuite$1(Suite.scala:1492)
    at org
.scalatest.Suite$$anonfun$runNestedSuites$1.apply(Suite.scala:1528)
    at org
.scalatest.Suite$$anonfun$runNestedSuites$1.apply(Suite.scala:1526)
    at scala
.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
    at scala
.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)
    at org
.scalatest.Suite$class.runNestedSuites(Suite.scala:1526)
    at org
.scalatest.tools.DiscoverySuite.runNestedSuites(DiscoverySuite.scala:29)
    at org
.scalatest.Suite$class.run(Suite.scala:1421)
    at org
.scalatest.tools.DiscoverySuite.run(DiscoverySuite.scala:29)
    at org
.scalatest.tools.SuiteRunner.run(SuiteRunner.scala:55)
    at org
.scalatest.tools.Runner$$anonfun$doRunRunRunDaDoRunRun$3.apply(Runner.scala:2563)
    at org
.scalatest.tools.Runner$$anonfun$doRunRunRunDaDoRunRun$3.apply(Runner.scala:2557)
    at scala
.collection.immutable.List.foreach(List.scala:381)
    at org
.scalatest.tools.Runner$.doRunRunRunDaDoRunRun(Runner.scala:2557)
    at org
.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(Runner.scala:1044)
    at org
.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(Runner.scala:1043)
    at org
.scalatest.tools.Runner$.withClassLoaderAndDispatchReporter(Runner.scala:2722)
    at org
.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:1043)
    at org
.scalatest.tools.Runner$.main(Runner.scala:860)
    at org
.scalatest.tools.Runner.main(Runner.scala)
    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 scala
.tools.eclipse.scalatest.launching.ScalaTestLauncher$.main(ScalaTestLauncher.scala:20)
    at scala
.tools.eclipse.scalatest.launching.ScalaTestLauncher.main(ScalaTestLauncher.scala)
Enter code here...


Kevin Esler

unread,
Nov 11, 2015, 4:11:39 PM11/11/15
to Astyanax Cassandra Client
Astyanax version above is 3.1.0
...

Daniel

unread,
Feb 25, 2016, 7:32:26 AM2/25/16
to Astyanax Cassandra Client
Make sure Cassandra connecting from instance.

If you re using linux machine please run this command and check telnet <cassandra ip> <port>

eg : telnet 127.0.0.1 9160.
...
Reply all
Reply to author
Forward
0 new messages