After study, decided to cql3/queryprocessor.java inside.
Here are two functions, the first of which is
Public Resultmessage process (String queryString, Querystate querystate, queryoptions options, long Querystartnanotime)
The function takes a SQL statement of type String, normalizes it (judging whether it is legitimate), and then calls the function
Processstatement (prepared, querystate, Options, querystartnanotime);
For the specific treatment.
We build bench functions in the same class
public void Bench (String queryString, Querystate querystate, queryoptions options, long Querystartnanotime)
Call the bench function at the beginning of the process function.
However, note: If not processed, Cassandra will fall into an infinite loop after booting, causing it to fail to enter the service state (the client cannot manipulate the database)
Therefore, before calling bench, add the IF statement to determine if QueryString contains a character (bench) and then calls the bench function.
Note that you need to put the judgment statement at the beginning so that you can trigger the bench function with any query statement. Otherwise, if the query statement is illegal, the normalization process will return directly if it is left behind.
After the bench function is called, you can change the SQL statement passed in and then call
Processstatement
Complete the processing.
Test: The INSERT statement is used in the bench function and the result is inserted successfully.
------------------------------Issues
You can only insert one, and if you insert multiple bars, an error occurs.
Writetimeout:error from SERVER:CODE=1100 [Coordinator node timed out waiting for replica nodes ' responses] message= "Oper ation timed out-received only 0 responses. "Info={' received_responses ': 0, ' required_responses ': 1, ' consistency ': ' One ' }
 Cassandra is inserted on the server like LEVELDB for the initial success