Why keyspace metadata is null only when connecting to datastax enterprise 6.8 with cassandra-driver?

218 Views Asked by At

We have a requirement to support Datastax Enterprise 6.8.Installed DSE6.8 on aws ec2 linux by referring https://docs.datastax.com/en/install/6.8/install/dseBasicInstall.html. Our code does support Apache cassandra,drivers we use are cassandra-driver-core-3.1.0.We use following code for the connection

Cluster.Builder builder = Cluster.builder();
String strMultipleNodes = connectionInfo.getNodes();    
        builder.addContactPointsWithPorts(getMultipleNodes(strMultipleNodes));
        Session session = builder.build().connect(connectionInfo.getKeySpace());

In the session,keyspace metadata is present when connecting to Apache cassandra,but when we connect to Datastax Enterprise 6.8,keyspace metadata is null.We are trying to get table metadata from the session value,but as keyspace metadata is null,not able to retreive table info.

poolObject.getSession().getCluster().getMetadata().getKeyspace(poolObject.getSession().getLoggedKeyspace()).getTable(activityConfig.getTableName());

Can anyone please let me know why this happens?

0

There are 0 best solutions below