cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Ellis (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CASSANDRA-4700) cql 2 counter validations need to use default consistencylevel if none is explicitly given
Date Mon, 24 Sep 2012 17:49:07 GMT

     [ https://issues.apache.org/jira/browse/CASSANDRA-4700?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jonathan Ellis resolved CASSANDRA-4700.
---------------------------------------

    Resolution: Fixed
    
> cql 2 counter validations need to use default consistencylevel if none is explicitly
given
> ------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-4700
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4700
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.8.0
>         Environment: java
>            Reporter: Nitesh Kumar
>            Assignee: Nitesh Kumar
>            Priority: Minor
>              Labels: patch
>             Fix For: 1.1.6
>
>         Attachments: CQL2fix.patch
>
>
> i was trying to run cql 2 query
> cqlsh:stats> UPDATE Minutewise_Product_Stats SET '2LX:OQ:XYZ.com:664230591:1:totalView'='2LX:SOQ:XYZ.com:664230591:1:totalView'+1,
'2LX:OQ:XYZ.com:664230591:1:keywordClick'='2LX:SOQ:xyz.com:664230591:1:keywordClick'+1 WHERE
KEY='2017:4' ;
> WHEN I GOT  this error
> ERROR 20:38:46,220 Error occurred during processing of message.
> java.lang.NullPointerException
>     at org.apache.cassandra.cql.UpdateStatement.prepareRowMutations(UpdateStatement.java:151)
>     at org.apache.cassandra.cql.UpdateStatement.prepareRowMutations(UpdateStatement.java:128)
>     at org.apache.cassandra.cql.QueryProcessor.batchUpdate(QueryProcessor.java:245)
>     at org.apache.cassandra.cql.QueryProcessor.processStatement(QueryProcessor.java:563)
>     at org.apache.cassandra.cql.QueryProcessor.process(QueryProcessor.java:817)
>     at org.apache.cassandra.thrift.CassandraServer.execute_cql_query(CassandraServer.java:1675)
>     at org.apache.cassandra.thrift.Cassandra$Processor$execute_cql_query.getResult(Cassandra.java:3721)
>     at org.apache.cassandra.thrift.Cassandra$Processor$execute_cql_query.getResult(Cassandra.java:1)
>     at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:32)
>     at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:34)
>     at org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:184)
>     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>     at java.lang.Thread.run(Thread.java:722)
> attached is the patch file  to fix this bug
> CQL2fix.patch
> diff --git a/src/java/org/apache/cassandra/cql/UpdateStatement.java b/src/java/org/apache/cassandra/cql/UpdateStatement.java
> index 3a47712..0caa61b 100644
> --- a/src/java/org/apache/cassandra/cql/UpdateStatement.java
> +++ b/src/java/org/apache/cassandra/cql/UpdateStatement.java
> @@ -146,8 +146,11 @@ public class UpdateStatement extends AbstractModification
>          }
>  
>          CFMetaData metadata = validateColumnFamily(keyspace, columnFamily, hasCommutativeOperation);
> -        if (hasCommutativeOperation)
> -            cLevel.validateCounterForWrite(metadata);
> +        
> +        if (hasCommutativeOperation){
> +        	ConsistencyLevel currentCLevel = getConsistencyLevel();
> +        	currentCLevel.validateCounterForWrite(metadata);
> +        }
>  
>          QueryProcessor.validateKeyAlias(metadata, keyName);
>  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message