Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

rahul avatar image
rahul asked ·

Traversal source 'g' for graph 'myGraph' is invalid. OLAP is not available when Spark is not running or cannot be detected.

I am trying to run multiple OLAP queries using script API and my first query runs very well , but as my testclass calls second method to execute 2nd query I got this error

com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: Traversal source 'g' for graph 'MyGraph' is invalid. OLAP is not available when Spark is not running or cannot be detected.

I am initializing cqlsession through bean file and if I initialize bean before every query execution then each query works,

I am using these 2 statements from script api

statement = ScriptGraphStatement.builder(script).setQueryParams(queryParam).build();
result = session.execute(statement);

[UPDATE] my application.conf file is :-

datastax-java-driver {
basic {
contact-points=["10.1.27.44:9042"]
load-balancing-policy.local-datacenter = SearchGraph
session-name = cfx-iap
request.page-size = 50000
config-reload-interval = 0
session-keyspace = "\"MyGraph\""
config-reload-interval = 0
}

basic.request.timeout = 600000 ms

basic.graph{
traversal-source= "a"
timeout = 600 seconds
name =MyGraph
}
advanced {
protocol.compression = lz4
connection {
max-requests-per-connection = 1024
timeout = 600 seconds
pool {
local.size = 1
remote.size = 1
}
}
throttler {
class = ConcurrencyLimitingRequestThrottler
max-concurrent-requests = 1000
max-queue-size = 100000
}
#ssl-engine-factory {
#class = CustomSSLEngineFactory
# cipher-suites = [ "TLS_RSA_WITH_AES_128_CBC_SHA", "TLS_RSA_WITH_AES_256_CBC_SHA" ]
# hostname-validation = true
# truststore-path = /path/to/client.truststore
# keystore-path = /path/to/client.keystore
#}
}#end of advanced

}
graph
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

Cause

The error indicates that you are running queries against a DC whose nodes don't have Analytics enabled.

Solution

You will need to run the OLAP queries against nodes running with DSE Analytics workload enabled.

For reference, see DataStax Graph Analysis with DSE Analytics.

Package installations

For YUM or APT package installations, you need to set the following in /etc/default/dse and restart DSE:

SPARK_ENABLED=1

For details, see Starting DataStax Enterprise as a service.

Tarball installations

For tarball installations, you need to start DSE in Analytics mode with the -k flag:

$ bin/dse cassandra -k

For details, see Starting DataStax Enterprise as a stand-alone process. Cheers!

8 comments Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

I checkout my configuration on server side and spark is enable there and as I said earlier that first query is running but when I try to run second query then I guess sprak is disabled and as execution comes on 3rd query then it works and as it comes to 4th it fails and then works for 5th..

0 Likes 0 · ·

Could you please run this command on any node in the cluster and post the output? Cheers!

$ dsetool status
0 Likes 0 · ·
rahul avatar image rahul Erick Ramirez ♦♦ ·

$ ./dsetool status

DC: SearchGraph Workload: Mixed Graph: yes Analytics Master: 10.1.27.44

=======================================================================================

Status=Up/Down

|/ State=Normal/Leaving/Joining/Moving

-- Address Load Owns Token Rack Health [0,1]

1739876844206789806

UN 10.1.27.26 1.2 GiB ? 0 rack1 1.00

UN 10.1.27.44 132.9 MiB ? 1739876844206789806 rack1 1.00


Note: you must specify a keyspace to get ownership information.

Warning: datacenter 'SearchGraph' has heterogeneous workloads [Search, SearchAnalytics], which may lead to degradation of workload specific features.


0 Likes 0 · ·
Show more comments
Show more comments