DataStax Academy FAQ

DataStax Academy migrated to a new learning management system (LMS) in July 2020. We are also moving to a new Cassandra Certification process so there are changes to exam bookings, voucher system and issuing of certificates.

Check out the Academy FAQ pages for answers to your questions:


question

subhodip55@gmail.com avatar image
subhodip55@gmail.com asked ·

Getting "IllegalArgumentException: No query defined with name user_by_email" while running cassandra-stress in DS210

Hello

I am getting below error while running cassandra Stress Test. Please help.


ERROR

======

ubuntu@ds210-node2:/var/log/cassandra$ cassandra-stress user profile=/home/ubuntu/labwork/TestProfile.yaml ops\(insert=4,user_by_email=4\) -node ds210-node1
******************** Stress Settings ********************
Command:
Type: user
Count: -1
No Warmup: false
Consistency Level: LOCAL_ONE
Target Uncertainty: 0.020
Minimum Uncertainty Measurements: 30
Maximum Uncertainty Measurements: 200
Command Ratios: {insert=4.0, user_by_email=4.0}
Command Clustering Distribution: clustering=gaussian(1..10)
Profile File(s): /home/ubuntu/labwork/TestProfile.yaml
Rate:
Auto: true
Min Threads: 4
Max Threads: 1000
Population:
Distribution: Gaussian: min=1,max=1000000,mean=500000.500000,stdev=166666.500000
Order: ARBITRARY
Wrap: false
Insert:
Revisits: Uniform: min=1,max=1000000
Visits: Fixed: key=1
Row Population Ratio: Ratio: divisor=1.000000;delegate=Fixed: key=1
Batch Type: not batching
Errors:
Ignore: false
Tries: 10
Log:
No Summary: false
No Settings: false
No Progress: false
Show Queries: false
Query Log File: null
File: null
Interval Millis: 1000
Level: NORMAL
Mode:
API: JAVA_DRIVER_NATIVE
Connection Style: CQL_PREPARED
CQL Version: CQL3
Protocol Version: DSE_V2
Username: null
Password: null
Auth Provide Class: null
Max Pending Per Connection: 128
Connections Per Host: 8
Compression: NONE
Node:
Nodes: [ds210-node1]
Is White List: false
Datacenter: null
Schema:
Keyspace: null
Replication Strategy: org.apache.cassandra.locator.SimpleStrategy
Replication Strategy Options: {replication_factor=1}
Table Compression: null
Table Compaction Strategy: null
Table Compaction Strategy Options: {}
Transport:
truststore=null; truststore-type=null; truststore-password=null; keystore=null; keystore-type=null; keystore-password=null; ssl-protocol=TLS; ssl-alg=SunX509; ssl-ciphers=TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA;
Port:
Native Port: 9042
JMX Port: 7199
Send To Daemon:
*not set*
Graph:
File: null
Revision: unknown
Title: null
Operation: USER
TokenRange:
Wrap: true
Split Factor: 1

******************** Profile(s) ********************
Keyspace Name: killr_video
Keyspace CQL:
***
CREATE KEYSPACE killr_video WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'};
***

Table Name: user_by_email
Table CQL:
***
CREATE TABLE user_by_email (
email TEXT,
password TEXT,
user_id UUID,
PRIMARY KEY ((email))
)
***

Extra Schema Definitions: null
Generator Configs:
password: Size: Exponential: min=8,max=30,mean=14.234680;Identity: Uniform: min=1,max=1000000;
user_id: Size: Fixed: key=4;Identity: Uniform: min=1,max=1000000;
email: Size: Gaussian: min=8,max=30,mean=19.000000,stdev=3.666667;Identity: Exponential: min=1,max=1000000,mean=144764.693015;
Query Definitions:
get_user: CQL:select * from user_by_email where email = ?;Fields:null;
Token Range Queries:
Insert Settings:
partitions: fixed(1)
batchtype: UNLOGGED
select: fixed(1)/1
Connected to cluster: KillrVideoCluster, max pending requests per connection 128, max connections per host 8
Datacenter: dc1; Host: ds210-node1/172.18.0.2; Rack: rack1
Created schema. Sleeping 1s for propagation.
Insert Statement:
UPDATE user_by_email SET password = ?,user_id = ? WHERE email = ?
Generating batches with [1..1] partitions and [1..100] rows (of [1..1] total rows in the partitions)

Sleeping 2s...
Warming up insert with 0 iterations...
Failed to connect over JMX; not collecting these stats

Warming up user_by_email with 0 iterations...
Failed to connect over JMX; not collecting these stats
java.lang.IllegalArgumentException: No query defined with name user_by_email
at org.apache.cassandra.stress.StressProfile.getQuery(StressProfile.java:390)
at org.apache.cassandra.stress.settings.SettingsCommandUser$1.get(SettingsCommandUser.java:142)
at org.apache.cassandra.stress.settings.SettingsCommandUser$1.get(SettingsCommandUser.java:110)
at org.apache.cassandra.stress.operations.SampledOpDistributionFactory$1.get(SampledOpDistributionFactory.java:81)
at org.apache.cassandra.stress.StressAction$Consumer.<init>(StressAction.java:409)
at org.apache.cassandra.stress.StressAction.run(StressAction.java:233)
at org.apache.cassandra.stress.StressAction.warmup(StressAction.java:121)
at org.apache.cassandra.stress.StressAction.run(StressAction.java:70)
at org.apache.cassandra.stress.Stress.run(Stress.java:143)
at org.apache.cassandra.stress.Stress.main(Stress.java:62)

ds210
1 comment
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.

Please advice.....

0 Likes 0 ·

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

As this error states, there is no query in your profile YAML called user_by_email:

java.lang.IllegalArgumentException: No query defined with name user_by_email

In step 11 of exercise 01.02 for DS210, you needed to create query called user_by_email:

queries:
  user_by_email:
    cql: select * from user_by_email where email = ?
    fields: samerow

But in the output you posted above, you created a query called get_user:

  Query Definitions:
    get_user: CQL:select * from user_by_email where email = ?;Fields:null;

You have 2 options:

  1. You can fix your profile YAML and re-run the stress test.
  2. Re-run the stress test with get_user=N:
$ cassandra-stress user \
    profile=/home/ubuntu/labwork/TestProfile.yaml \
    ops(insert=4,get_user=4) \
    -node ds210-node1

Cheers!

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.