Cassandra on the service side like LEVELDB. Success

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.