You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Moses Dinakaran <mo...@gmail.com> on 2010/05/27 10:45:29 UTC

Batch_Mutate throws Uncaught exception

Hi,



I am trying to use batch_mutate() with PHP Thrift. I was getting the
following error.





*Fatal error*:  Uncaught exception 'cassandra_InvalidRequestException'
in CORE/php/phpcassa/thrift/packages/cassandra/Cassandra.php:4869

Stack trace:

#0 CORE/php/phpcassa/thrift/packages/cassandra/Cassandra.php(777):
cassandra_Cassandra_batch_mutate_result->read(Object(TBinaryProtocolAccelerated))



The version is *Cassandra 0.6*

$client->batch_mutate($this->keyspace, $mutation_map, $this
->write_consistency_level);



Here is my mutation map, Any idea on what was going wrong.

------------------------------
array(1) {

  ["cache_pages"]=>

  array(1) {

    ["Page"]=>

    array(2) {

      [0]=>

      object(cassandra_Mutation)#32 (2) {

        ["column_or_supercolumn"]=>

        object(cassandra_ColumnOrSuperColumn)#31 (2) {

          ["column"]=>

          object(cassandra_Column)#30 (3) {

            ["name"]=>

            string(2) "id"

            ["value"]=>

            int(1)

            ["timestamp"]=>

            int(1274949222)

          }

          ["super_column"]=>

          NULL

        }

        ["deletion"]=>

        NULL

      }

      [1]=>

      object(cassandra_Mutation)#35 (2) {

        ["column_or_supercolumn"]=>

        object(cassandra_ColumnOrSuperColumn)#34 (2) {

          ["column"]=>

          object(cassandra_Column)#33 (3) {

            ["name"]=>

            string(4) "hash"

            ["value"]=>

            string(15) "d930517baf47237"

            ["timestamp"]=>

            int(1274949222)

          }

          ["super_column"]=>

          NULL

        }

        ["deletion"]=>

        NULL

      }

    }

  }

}


------------------------------





Thanks in Advance,

Moses.

Re: Batch_Mutate throws Uncaught exception

Posted by Moses Dinakaran <mo...@gmail.com>.
Hi sorry for the post I was wrong in understanding key and column family

I was in the thinking cache_pages is the column family and Page is the key
but its the other way right

I will update my code and check it again.

Thanks,
Moses

On Thu, May 27, 2010 at 3:46 PM, Mishail <mi...@gmail.com> wrote:

> Hi,
>
> Just to clarify. Are you trying to insert a couple of columns with key
> "cache_pages" in the ColumnFamily "Page"?
>
> Moses Dinakaran wrote:
> i,
> >
> >
> >
> > I am trying to use batch_mutate() with PHP Thrift. I was getting the
> > following error.
> >
>
>

Re: Batch_Mutate throws Uncaught exception

Posted by Mishail <mi...@gmail.com>.
Hi,

Just to clarify. Are you trying to insert a couple of columns with key
"cache_pages" in the ColumnFamily "Page"?

Moses Dinakaran wrote:
i,
> 
>  
> 
> I am trying to use batch_mutate() with PHP Thrift. I was getting the
> following error.
> 


Re: Batch_Mutate throws Uncaught exception

Posted by Jonathan Ellis <jb...@gmail.com>.
you need to pull out the exception "why" field, which explains what
was invalid about the request

On Thu, May 27, 2010 at 2:45 AM, Moses Dinakaran
<mo...@gmail.com> wrote:
> Hi,
>
>
>
> I am trying to use batch_mutate() with PHP Thrift. I was getting the
> following error.
>
>
>
>
>
> Fatal error:  Uncaught exception 'cassandra_InvalidRequestException' in
> CORE/php/phpcassa/thrift/packages/cassandra/Cassandra.php:4869
>
> Stack trace:
>
> #0 CORE/php/phpcassa/thrift/packages/cassandra/Cassandra.php(777):
> cassandra_Cassandra_batch_mutate_result->read(Object(TBinaryProtocolAccelerated))
>
>
>
> The version is Cassandra 0.6
>
> $client->batch_mutate($this->keyspace, $mutation_map,
> $this->write_consistency_level);
>
>
>
> Here is my mutation map, Any idea on what was going wrong.
>
> ------------------------------
> array(1) {
>
>   ["cache_pages"]=>
>
>   array(1) {
>
>     ["Page"]=>
>
>     array(2) {
>
>       [0]=>
>
>       object(cassandra_Mutation)#32 (2) {
>
>         ["column_or_supercolumn"]=>
>
>         object(cassandra_ColumnOrSuperColumn)#31 (2) {
>
>           ["column"]=>
>
>           object(cassandra_Column)#30 (3) {
>
>             ["name"]=>
>
>             string(2) "id"
>
>             ["value"]=>
>
>             int(1)
>
>             ["timestamp"]=>
>
>             int(1274949222)
>
>           }
>
>           ["super_column"]=>
>
>           NULL
>
>         }
>
>         ["deletion"]=>
>
>         NULL
>
>       }
>
>       [1]=>
>
>       object(cassandra_Mutation)#35 (2) {
>
>         ["column_or_supercolumn"]=>
>
>         object(cassandra_ColumnOrSuperColumn)#34 (2) {
>
>           ["column"]=>
>
>           object(cassandra_Column)#33 (3) {
>
>             ["name"]=>
>
>             string(4) "hash"
>
>             ["value"]=>
>
>             string(15) "d930517baf47237"
>
>             ["timestamp"]=>
>
>             int(1274949222)
>
>           }
>
>           ["super_column"]=>
>
>           NULL
>
>         }
>
>         ["deletion"]=>
>
>         NULL
>
>       }
>
>     }
>
>   }
>
> }
>
> ------------------------------
>
>
>
>
>
> Thanks in Advance,
>
> Moses.
>
>
>
>
>
>
>
>
>
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com