Compund/Composite column names

2012-10-08 Thread Vivek Mishra
Hi All,

I am trying to use compound primary key column name and i am referring to:
http://www.datastax.com/dev/blog/whats-new-in-cql-3-0


As mentioned on this example, i tried to create a column family containing 
compound primary key (one or more) as:

 CREATE TABLE altercations (
       instigator text,
       started_at timestamp,
       ships_destroyed int,
       energy_used float,
       alliance_involvement boolean,
       PRIMARY KEY (instigator,started_at,ships_destroyed)
   );

And i am getting:


**
TSocket read 0 bytes
cqlsh:testcomp> 
**


Then followed by insert and select statements giving me following errors:



cqlsh:testcomp>    INSERT INTO altercations (instigator, started_at, 
ships_destroyed,
            ...                              energy_used, alliance_involvement)
            ...                      VALUES ('Jayne Cobb', '2012-07-23', 2, 
4.6, 'false');
TSocket read 0 bytes

cqlsh:testcomp> select * from altercations;
Traceback (most recent call last):
  File "bin/cqlsh", line 1008, in perform_statement
    self.cursor.execute(statement, decoder=decoder)
  File "bin/../lib/cql-internal-only-1.0.10.zip/cql-1.0.10/cql/cursor.py", line 
117, in execute
    response = self.handle_cql_execution_errors(doquery, prepared_q, compress)
  File "bin/../lib/cql-internal-only-1.0.10.zip/cql-1.0.10/cql/cursor.py", line 
132, in handle_cql_execution_errors
    return executor(*args, **kwargs)
  File 
"bin/../lib/cql-internal-only-1.0.10.zip/cql-1.0.10/cql/cassandra/Cassandra.py",
 line 1583, in execute_cql_query
    self.send_execute_cql_query(query, compression)
  File 
"bin/../lib/cql-internal-only-1.0.10.zip/cql-1.0.10/cql/cassandra/Cassandra.py",
 line 1593, in send_execute_cql_query
    self._oprot.trans.flush()
  File 
"bin/../lib/thrift-python-internal-only-0.7.0.zip/thrift/transport/TTransport.py",
 line 293, in flush
    self.__trans.write(buf)
  File 
"bin/../lib/thrift-python-internal-only-0.7.0.zip/thrift/transport/TSocket.py", 
line 117, in write
    plus = self.handle.send(buff)
error: [Errno 32] Broken pipe

cqlsh:testcomp> 





Any idea? 


-Vivek

Re: Compund/Composite column names

2012-10-08 Thread Vivek Mishra
Nothing on server log. Only difference is i tried to create a compound key 
using 3 composite columns, whereas example on website is with 2.

When i try to connect via cassandra-cli, i am able to connect but this column 
family is not available. 

So i guess, this might be an issue with CQL3, not with cassandra server?

-Vivek



 From: Brandon Williams 
To: dev@cassandra.apache.org; Vivek Mishra  
Sent: Tuesday, October 9, 2012 7:50 AM
Subject: Re: Compund/Composite column names
 
Check for a stacktrace in the server log.

On Mon, Oct 8, 2012 at 9:18 PM, Vivek Mishra  wrote:
> Hi All,
>
> I am trying to use compound primary key column name and i am referring to:
> http://www.datastax.com/dev/blog/whats-new-in-cql-3-0
>
>
> As mentioned on this example, i tried to create a column family containing 
> compound primary key (one or more) as:
>
>  CREATE TABLE altercations (
>        instigator text,
>        started_at timestamp,
>        ships_destroyed int,
>        energy_used float,
>        alliance_involvement boolean,
>        PRIMARY KEY (instigator,started_at,ships_destroyed)
>    );
>
> And i am getting:
>
>
> **
> TSocket read 0 bytes
> cqlsh:testcomp>
> **
>
>
> Then followed by insert and select statements giving me following errors:
>
> 
>
> cqlsh:testcomp>    INSERT INTO altercations (instigator, started_at, 
> ships_destroyed,
>             ...                              energy_used, 
>alliance_involvement)
>             ...                      VALUES ('Jayne Cobb', '2012-07-23', 2, 
>4.6, 'false');
> TSocket read 0 bytes
>
> cqlsh:testcomp> select * from altercations;
> Traceback (most recent call last):
>   File "bin/cqlsh", line 1008, in perform_statement
>     self.cursor.execute(statement, decoder=decoder)
>   File "bin/../lib/cql-internal-only-1.0.10.zip/cql-1.0.10/cql/cursor.py", 
>line 117, in execute
>     response = self.handle_cql_execution_errors(doquery, prepared_q, compress)
>   File "bin/../lib/cql-internal-only-1.0.10.zip/cql-1.0.10/cql/cursor.py", 
>line 132, in handle_cql_execution_errors
>     return executor(*args, **kwargs)
>   File 
>"bin/../lib/cql-internal-only-1.0.10.zip/cql-1.0.10/cql/cassandra/Cassandra.py",
> line 1583, in execute_cql_query
>     self.send_execute_cql_query(query, compression)
>   File 
>"bin/../lib/cql-internal-only-1.0.10.zip/cql-1.0.10/cql/cassandra/Cassandra.py",
> line 1593, in send_execute_cql_query
>     self._oprot.trans.flush()
>   File 
>"bin/../lib/thrift-python-internal-only-0.7.0.zip/thrift/transport/TTransport.py",
> line 293, in flush
>     self.__trans.write(buf)
>   File 
>"bin/../lib/thrift-python-internal-only-0.7.0.zip/thrift/transport/TSocket.py",
> line 117, in write
>     plus = self.handle.send(buff)
> error: [Errno 32] Broken pipe
>
> cqlsh:testcomp>
>
> 
>
>
>
> Any idea?
>
>
> -Vivek

Re: Compund/Composite column names

2012-10-08 Thread Vivek Mishra
Just verified, basically column family itself is not getting created on very 
first place, as reconnecting cql client again does not show it.

-Vivek



 From: Vivek Mishra 
To: "dev@cassandra.apache.org"  
Sent: Tuesday, October 9, 2012 7:59 AM
Subject: Re: Compund/Composite column names
 

Nothing on server log. Only difference is i tried to create a compound key 
using 3 composite columns, whereas example on website is with 2.

When i try to connect via cassandra-cli, i am able to connect but this column 
family is not available. 

So i guess, this might be an issue with CQL3, not with cassandra server?

-Vivek



 From: Brandon Williams 
To: dev@cassandra.apache.org; Vivek Mishra  
Sent: Tuesday, October 9, 2012 7:50 AM
Subject: Re: Compund/Composite column names
 
Check for a stacktrace in the server log.

On Mon, Oct 8, 2012 at 9:18 PM, Vivek Mishra  wrote:
> Hi All,
>
> I am trying to use compound primary key column name and i am referring to:
> http://www.datastax.com/dev/blog/whats-new-in-cql-3-0
>
>
> As mentioned on this example, i tried to create a column family containing 
> compound primary key (one or more) as:
>
>  CREATE TABLE altercations (
>        instigator text,
>        started_at timestamp,
>        ships_destroyed int,
>        energy_used float,
>        alliance_involvement boolean,
>        PRIMARY KEY (instigator,started_at,ships_destroyed)
>   
 );
>
> And i am getting:
>
>
> **
> TSocket read 0 bytes
> cqlsh:testcomp>
> **
>
>
> Then followed by insert and select statements giving me following errors:
>
> 
>
> cqlsh:testcomp>    INSERT INTO altercations (instigator, started_at, 
> ships_destroyed,
>             ...                              energy_used, 
>alliance_involvement)
>             ...                      VALUES
 ('Jayne Cobb', '2012-07-23', 2, 4.6, 'false');
> TSocket read 0 bytes
>
> cqlsh:testcomp> select * from altercations;
> Traceback (most recent call last):
>   File "bin/cqlsh", line 1008, in perform_statement
>     self.cursor.execute(statement, decoder=decoder)
>   File "bin/../lib/cql-internal-only-1.0.10.zip/cql-1.0.10/cql/cursor.py", 
>line 117, in execute
>     response = self.handle_cql_execution_errors(doquery, prepared_q, compress)
>   File "bin/../lib/cql-internal-only-1.0.10.zip/cql-1.0.10/cql/cursor.py", 
>line 132, in handle_cql_execution_errors
>     return executor(*args, **kwargs)
>   File 
>"bin/../lib/cql-internal-only-1.0.10.zip/cql-1.0.10/cql/cassandra/Cassandra.py",
> line 1583, in execute_cql_query
>     self.send_execute_cql_query(query, compression)
>   File
 
"bin/../lib/cql-internal-only-1.0.10.zip/cql-1.0.10/cql/cassandra/Cassandra.py",
 line 1593, in send_execute_cql_query
>     self._oprot.trans.flush()
>   File 
>"bin/../lib/thrift-python-internal-only-0.7.0.zip/thrift/transport/TTransport.py",
> line 293, in flush
>     self.__trans.write(buf)
>   File 
>"bin/../lib/thrift-python-internal-only-0.7.0.zip/thrift/transport/TSocket.py",
> line 117, in write
>     plus = self.handle.send(buff)
> error: [Errno 32] Broken pipe
>
> cqlsh:testcomp>
>
> 
>
>
>
> Any idea?
>
>
> -Vivek

Re: Compund/Composite column names

2012-10-08 Thread Vivek Mishra
i tried with 1.1.2



 From: Jonathan Ellis 
To: dev@cassandra.apache.org; Vivek Mishra  
Sent: Tuesday, October 9, 2012 9:08 AM
Subject: Re: Compund/Composite column names
 
Works for me on latest 1.1 in cql3 mode.  cql2 mode gives a parse error.

On Mon, Oct 8, 2012 at 9:18 PM, Vivek Mishra  wrote:
> Hi All,
>
> I am trying to use compound primary key column name and i am referring to:
> http://www.datastax.com/dev/blog/whats-new-in-cql-3-0
>
>
> As mentioned on this example, i tried to create a column family containing 
> compound primary key (one or more) as:
>
>  CREATE TABLE altercations (
>        instigator text,
>        started_at timestamp,
>        ships_destroyed int,
>        energy_used float,
>        alliance_involvement boolean,
>        PRIMARY KEY (instigator,started_at,ships_destroyed)
>    );
>
> And i am getting:
>
>
> **
> TSocket read 0 bytes
> cqlsh:testcomp>
> **
>
>
> Then followed by insert and select statements giving me following errors:
>
> 
>
> cqlsh:testcomp>    INSERT INTO altercations (instigator, started_at, 
> ships_destroyed,
>             ...                              energy_used, 
>alliance_involvement)
>             ...                      VALUES ('Jayne Cobb', '2012-07-23', 2, 
>4.6, 'false');
> TSocket read 0 bytes
>
> cqlsh:testcomp> select * from altercations;
> Traceback (most recent call last):
>   File "bin/cqlsh", line 1008, in perform_statement
>     self.cursor.execute(statement, decoder=decoder)
>   File "bin/../lib/cql-internal-only-1.0.10.zip/cql-1.0.10/cql/cursor.py", 
>line 117, in execute
>     response = self.handle_cql_execution_errors(doquery, prepared_q, compress)
>   File "bin/../lib/cql-internal-only-1.0.10.zip/cql-1.0.10/cql/cursor.py", 
>line 132, in handle_cql_execution_errors
>     return executor(*args, **kwargs)
>   File 
>"bin/../lib/cql-internal-only-1.0.10.zip/cql-1.0.10/cql/cassandra/Cassandra.py",
> line 1583, in execute_cql_query
>     self.send_execute_cql_query(query, compression)
>   File 
>"bin/../lib/cql-internal-only-1.0.10.zip/cql-1.0.10/cql/cassandra/Cassandra.py",
> line 1593, in send_execute_cql_query
>     self._oprot.trans.flush()
>   File 
>"bin/../lib/thrift-python-internal-only-0.7.0.zip/thrift/transport/TTransport.py",
> line 293, in flush
>     self.__trans.write(buf)
>   File 
>"bin/../lib/thrift-python-internal-only-0.7.0.zip/thrift/transport/TSocket.py",
> line 117, in write
>     plus = self.handle.send(buff)
> error: [Errno 32] Broken pipe
>
> cqlsh:testcomp>
>
> 
>
>
>
> Any idea?
>
>
> -Vivek



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

Re: Compund/Composite column names

2012-10-08 Thread Vivek Mishra


Ok. I am able to understand the problem now. Issue is:

If i create a column family altercations as:

**8
CREATE TABLE altercations (
       instigator text,
       started_at timestamp,
       ships_destroyed int,
       energy_used float,
       alliance_involvement boolean,
       PRIMARY KEY (instigator,started_at,ships_destroyed)
   );
/
   INSERT INTO altercations (instigator, started_at, ships_destroyed,
                             energy_used, alliance_involvement)
                     VALUES ('Jayne Cobb', '2012-07-23', 2, 4.6, 'false');
*

It works!

But if i create a column family with compound primary key with 2 composite 
column as:

*
CREATE TABLE altercations (
       instigator text,
       started_at timestamp,
       ships_destroyed int,
       energy_used float,
       alliance_involvement boolean,
       PRIMARY KEY (instigator,started_at)
   );

*
and Then drop this column family: 

*
drop columnfamily altercations;
*

and then try to create same one with primary compound key with 3 composite 
column:

*

CREATE TABLE altercations (
       instigator text,
       started_at timestamp,
       ships_destroyed int,
       energy_used float,
       alliance_involvement boolean,
       PRIMARY KEY (instigator,started_at,ships_destroyed)
   );
*

it gives me error: "TSocket read 0 bytes"

Rest, as no column family is created, so nothing onwards will work.

Is this an issue?

-Vivek



 From: Jonathan Ellis 
To: dev@cassandra.apache.org; Vivek Mishra  
Sent: Tuesday, October 9, 2012 9:08 AM
Subject: Re: Compund/Composite column names
 
Works for me on latest 1.1 in cql3 mode.  cql2 mode gives a parse error.

On Mon, Oct 8, 2012 at 9:18 PM, Vivek Mishra  wrote:
> Hi All,
>
> I am trying to use compound primary key column name and i am referring to:
> http://www.datastax.com/dev/blog/whats-new-in-cql-3-0
>
>
> As mentioned on this example, i tried to create a column family containing 
> compound primary key (one or more) as:
>
>  CREATE TABLE altercations (
>        instigator text,
>        started_at timestamp,
>        ships_destroyed int,
>        energy_used float,
>        alliance_involvement boolean,
>        PRIMARY KEY (instigator,started_at,ships_destroyed)
>    );
>
> And i am getting:
>
>
> **
> TSocket read 0 bytes
> cqlsh:testcomp>
> **
>
>
> Then followed by insert and select statements giving me following errors:
>
> 
>
> cqlsh:testcomp>    INSERT INTO altercations (instigator, started_at, 
> ships_destroyed,
>             ...                              energy_used, 
>alliance_involvement)
>             ...                      VALUES ('Jayne Cobb', '2012-07-23', 2, 
>4.6, 'false');
> TSocket read 0 bytes
>
> cqlsh:testcomp> select * from altercations;
> Traceback (most recent call last):
>   File "bin/cqlsh", line 1008, in perform_statement
>     self.cursor.execute(statement, decoder=decoder)
>   File "bin/../lib/cql-internal-only-1.0.10.zip/cql-1.0.10/cql/cursor.py", 
>line 117, in execute
>     response = self.handle_cql_execution_errors(doquery, prepared_q, compress)
>   File "bin/../lib/cql-internal-only-1.0.10.zip/cql-1.0.10/cql/cursor.py", 
>line 132, in handle_cql_execution_errors
>     return executor(*args, **kwargs)
>   File 
>"bin/../lib/cql-internal-only-1.0.10.zip/cql-1.0.10/cql/cassandra/Cassandra.py",
> line 1583, in execute_cql_query
>     self.send_execute_cql_query(query, compression)
>   File 
>"bin/../lib/cql-internal-only-1.0.10.zip/cql-1.0.10/cql/cassandra/Ca

Fw: Fwd: Compound primary key: Insert after delete

2012-10-22 Thread Vivek Mishra
Hi,

I am building support for Composite/Compund keys in Kundera and currently 
getting into number of problems for my POC to access it via Thrift.

I am planning to use thrift API for insert/update/delete and for query i will 
go by CQL way. 



Issues:
CompositeTypeRunner.java (see attached): Simple program to perform CRUD, it is 
not inserting against the deleted row key and also thrift API is returning 
column name as "Empty" string.

OtherCompositeTypeRunner.java (see attached): Program to demonstrate issue with 
compound primary key as boolean. Column family creation via CQL is working 
fine, But insert via thrift is giving issue with "Unconfigured column family" 
though it is there!

This is what i have tried with cassandra 1.1.6 as well.


Please have a look and share, if i am doing anything wrong?   i did ask same on 
user group but no luck.  



-Vivek




- Forwarded Message -
From: Vivek Mishra 
To: vivek.mis...@yahoo.com 
Sent: Monday, October 22, 2012 5:17 PM
Subject: Fwd: Compound primary key: Insert after delete
 




-- Forwarded message ------
From: Vivek Mishra 
Date: Mon, Oct 22, 2012 at 1:08 PM
Subject: Re: Compound primary key: Insert after delete
To: u...@cassandra.apache.org


Well. Last 2 lines of code are deleting 1 record and inserting 2 records, first 
one is "the deleted one" and  a new record. Output from command line:

[default@unknown] use bigdata;
Authenticated to keyspace: bigdata
[default@bigdata] list test1;
Using default limit of 100
Using default column limit of 100
---
RowKey: 2
=> (column=3:address, value=4, timestamp=1350884575938)
---
RowKey: 1

2 Rows Returned.


-Vivek


On Mon, Oct 22, 2012 at 1:01 PM, aaron morton  wrote:

How is it not working ?
>
>
>Can you replicate the problem withe the CLI ?
>Cheers
>
>
>-
>Aaron Morton
>Freelance Developer
>@aaronmorton
>http://www.thelastpickle.com 
>
>On 22/10/2012, at 7:17 PM, Vivek Mishra  wrote:
>
>code attached. Somehow it is not working with 1.1.5.
>>
>>
>>-Vivek
>>
>>
>>On Mon, Oct 22, 2012 at 5:20 AM, aaron morton  wrote:
>>
>>Yes AFAIK. 
>>>
>>>
>>>Cheers
>>>
>>>
>>>-
>>>Aaron Morton
>>>Freelance Developer
>>>@aaronmorton
>>>http://www.thelastpickle.com 
>>>
>>>
>>>On 20/10/2012, at 12:15 AM, Vivek Mishra  wrote:
>>>
>>>Hi,
>>>>Is it possible to reuse same compound primary key after delete? I guess it 
>>>>works fine for non composite keys.
>>>>
>>>>
>>>>-Vivek
>>>
>>
>/***
 * * Copyright 2012 Impetus Infotech.
 *  *
 *  * Licensed under the Apache License, Version 2.0 (the "License");
 *  * you may not use this file except in compliance with the License.
 *  * You may obtain a copy of the License at
 *  *
 *  *  http://www.apache.org/licenses/LICENSE-2.0
 *  *
 *  * Unless required by applicable law or agreed to in writing, software
 *  * distributed under the License is distributed on an "AS IS" BASIS,
 *  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  * See the License for the specific language governing permissions and
 *  * limitations under the License.
 **/
package com.impetus.client.cassandra.thrift;

import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;

import org.apache.cassandra.db.marshal.AbstractType;
import org.apache.cassandra.db.marshal.CompositeType;
import org.apache.cassandra.db.marshal.CompositeType.Builder;
import org.apache.cassandra.db.marshal.UTF8Type;
import org.apache.cassandra.locator.SimpleStrategy;
import org.apache.cassandra.thrift.Cassandra;
import org.apache.cassandra.thrift.CfDef;
import org.apache.cassandra.thrift.Column;
import org.apache.cassandra.thrift.ColumnOrSuperColumn;
import org.apache.cassandra.thrift.ColumnParent;
import org.apache.cassandra.thrift.ColumnPath;
import org.apache.cassandra.thrift.Compression;
import org.apache.cassandra.thrift.ConsistencyLevel;
import org.apache.cassandra.thrift.CqlResult;
import org.apache.cassandra.thrift.CqlRow;
import org.apache.cassandra.thrift.KsDef;
import org.apache.cassandra.thrift.SlicePredicate;
import org.apache.cassandra.thrift.SliceRange;
import org.apache.cassandra.thrift.TBinaryProtocol;
import org.apache.thrift.transport.TFramedTransport;
import org.apache.thrift.transport.TSocket;
import org.scale7.cassandra.pelops.Bytes;

/**
 * @author vivek.mishra
 *
 */
public class CompositeTypeRunner
{
public static void

Re: Fw: Fwd: Compound primary key: Insert after delete

2012-10-22 Thread Vivek Mishra
Thanks. But it means i may have re-write all the stuff in CQL way.
Considering CQL as a future interface for cassandra interface,AFN i will
implement it without mixing them.

-Vivek

On Mon, Oct 22, 2012 at 6:32 PM, Jonathan Ellis  wrote:

> Mixing the two isn't really recommended because of just this kind of
> difficulty, but if you must, I would develop against 1.2 since it will
> actually validate that the CT encoding you've done manually is valid.
> 1.1 will just fail silently.
>
> On Mon, Oct 22, 2012 at 6:57 AM, Vivek Mishra 
> wrote:
> > Hi,
> >
> > I am building support for Composite/Compund keys in Kundera and currently
> > getting into number of problems for my POC to access it via Thrift.
> >
> > I am planning to use thrift API for insert/update/delete and for query i
> > will go by CQL way.
> >
> >
> > Issues:
> > CompositeTypeRunner.java (see attached): Simple program to perform CRUD,
> it
> > is not inserting against the deleted row key and also thrift API is
> > returning column name as "Empty" string.
> >
> > OtherCompositeTypeRunner.java (see attached): Program to demonstrate
> issue
> > with compound primary key as boolean. Column family creation via CQL is
> > working fine, But insert via thrift is giving issue with "Unconfigured
> > column family" though it is there!
> >
> > This is what i have tried with cassandra 1.1.6 as well.
> >
> > Please have a look and share, if i am doing anything wrong?   i did ask
> same
> > on user group but no luck.
> >
> >
> > -Vivek
> >
> >
> >
> >
> > - Forwarded Message -
> > From: Vivek Mishra 
> > To: vivek.mis...@yahoo.com
> > Sent: Monday, October 22, 2012 5:17 PM
> > Subject: Fwd: Compound primary key: Insert after delete
> >
> >
> >
> > -- Forwarded message --
> > From: Vivek Mishra 
> > Date: Mon, Oct 22, 2012 at 1:08 PM
> > Subject: Re: Compound primary key: Insert after delete
> > To: u...@cassandra.apache.org
> >
> >
> > Well. Last 2 lines of code are deleting 1 record and inserting 2 records,
> > first one is "the deleted one" and  a new record. Output from command
> line:
> >
> > [default@unknown] use bigdata;
> > Authenticated to keyspace: bigdata
> > [default@bigdata] list test1;
> > Using default limit of 100
> > Using default column limit of 100
> > ---
> > RowKey: 2
> > => (column=3:address, value=4, timestamp=1350884575938)
> > ---
> > RowKey: 1
> >
> > 2 Rows Returned.
> >
> >
> > -Vivek
> >
> > On Mon, Oct 22, 2012 at 1:01 PM, aaron morton 
> > wrote:
> >
> > How is it not working ?
> >
> > Can you replicate the problem withe the CLI ?
> > Cheers
> >
> > -
> > Aaron Morton
> > Freelance Developer
> > @aaronmorton
> > http://www.thelastpickle.com
> >
> > On 22/10/2012, at 7:17 PM, Vivek Mishra  wrote:
> >
> > code attached. Somehow it is not working with 1.1.5.
> >
> > -Vivek
> >
> > On Mon, Oct 22, 2012 at 5:20 AM, aaron morton 
> > wrote:
> >
> > Yes AFAIK.
> >
> > Cheers
> >
> > -
> > Aaron Morton
> > Freelance Developer
> > @aaronmorton
> > http://www.thelastpickle.com
> >
> > On 20/10/2012, at 12:15 AM, Vivek Mishra  wrote:
> >
> > Hi,
> > Is it possible to reuse same compound primary key after delete? I guess
> it
> > works fine for non composite keys.
> >
> > -Vivek
> >
> >
> >
> > 
> >
> >
> >
> >
> >
> >
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of DataStax, the source for professional Cassandra support
> http://www.datastax.com
>


Re: Compund/Composite column names

2012-12-17 Thread Vivek Mishra
Looks like Thrift API is not working as expected?

-Vivek





 From: Brian O'Neill 
To: dev@cassandra.apache.org 
Cc: Vivek Mishra  
Sent: Monday, December 17, 2012 8:12 PM
Subject: Re: Compund/Composite column names
 
FYI -- I'm still seeing this on 1.2-beta1.

If you create a table via CQL, then insert into it (via Java API) with
an incorrect number of components.  The insert works, but select *
from CQL results in a TSocket read error.

I showed this in the webinar last week, just in case people ran into
it.  It would be great to translate the ArrayIndexOutofBoundsException
from the server side into something meaningful in cqlsh to help people
diagnose the problem.  (a regular user probably doesn't have access to
the server-side logs)

You can see it at minute 41 in the video from the webinar:
http://www.youtube.com/watch?v=AdfugJxfd0o&feature=youtu.be

-brian


On Tue, Oct 9, 2012 at 9:39 AM, Jonathan Ellis  wrote:
> Sounds like you're running into the keyspace drop bug.  It's "mostly" fixed
> in 1.1.5 but you might need the latest from 1.1 branch.  1.1.6 will be
> released soon with the final fix.
> On Oct 9, 2012 1:58 AM, "Vivek Mishra"  wrote:
>
>>
>>
>> Ok. I am able to understand the problem now. Issue is:
>>
>> If i create a column family altercations as:
>>
>>
>> **8
>> CREATE TABLE altercations (
>>        instigator text,
>>        started_at timestamp,
>>        ships_destroyed int,
>>        energy_used float,
>>        alliance_involvement boolean,
>>        PRIMARY KEY (instigator,started_at,ships_destroyed)
>>    );
>> /
>>    INSERT INTO altercations (instigator, started_at, ships_destroyed,
>>                              energy_used, alliance_involvement)
>>                      VALUES ('Jayne Cobb', '2012-07-23', 2, 4.6, 'false');
>>
>> *
>>
>> It works!
>>
>> But if i create a column family with compound primary key with 2 composite
>> column as:
>>
>>
>> *
>> CREATE TABLE altercations (
>>        instigator text,
>>        started_at timestamp,
>>        ships_destroyed int,
>>        energy_used float,
>>        alliance_involvement boolean,
>>        PRIMARY KEY (instigator,started_at)
>>    );
>>
>>
>> *
>> and Then drop this column family:
>>
>>
>> *
>> drop columnfamily altercations;
>>
>> *
>>
>> and then try to create same one with primary compound key with 3 composite
>> column:
>>
>>
>> *
>>
>> CREATE TABLE altercations (
>>        instigator text,
>>        started_at timestamp,
>>        ships_destroyed int,
>>        energy_used float,
>>        alliance_involvement boolean,
>>        PRIMARY KEY (instigator,started_at,ships_destroyed)
>>    );
>>
>> *****
>>
>> it gives me error: "TSocket read 0 bytes"
>>
>> Rest, as no column family is created, so nothing onwards will work.
>>
>> Is this an issue?
>>
>> -Vivek
>>
>>
>> 
>>  From: Jonathan Ellis 
>> To: dev@cassandra.apache.org; Vivek Mishra 
>> Sent: Tuesday, October 9, 2012 9:08 AM
>> Subject: Re: Compund/Composite column names
>>
>> Works for me on latest 1.1 in cql3 mode.  cql2 mode gives a parse error.
>>
>> On Mon, Oct 8, 2012 at 9:18 PM, Vivek Mishra 
>> wrote:
>> > Hi All,
>> >
>> > I am trying to use compound primary key column name and i am referring
>> to:
>> > http://www.datastax.com/dev/blog/whats-new-in-cql-3-0
>> >
>> >
>> > As mentioned on this example, i tried to 

Re: Cassandra in Java EE applications

2013-01-29 Thread Vivek Mishra
Not sure,But you may want to look into:

https://github.com/impetus-opensource/Kundera/wiki/REST-Based-Access

If it helps.

-Vivek




- Original Message -
From: Sigal Shaharabani 
To: dev@cassandra.apache.org
Cc: 
Sent: Tuesday, January 29, 2013 2:55 PM
Subject: Cassandra in Java EE applications

   Cassandra in Java EE applications

Hi

I am very new to Cassandra, and I am looking for some guidelines or
recommendations about connecting to Cassandra in a Java EE application
(would probably be a REST service).

I can’t find much by searching the web, but I did find the option of
creating a REST service for Cassandra itself, but there isn’t much detail
about how it’s done.

I would appreciate any help or advice

Thanks

Sigal

-- 
This message may contain confidential and/or privileged information. 
If you are not the addressee or authorized to receive this on behalf of the 
addressee you must not use, copy, disclose or take action based on this 
message or any information herein. 
If you have received this message in error, please advise the sender 
immediately by reply email and delete this message. Thank you.


Re: CQL vs Thrift

2013-07-18 Thread Vivek Mishra
+1. Thrift should be all about raw data cells.

-Vivek


 From: Jonathan Ellis 
To: dev@cassandra.apache.org 
Sent: Thursday, July 18, 2013 2:48 AM
Subject: Re: CQL vs Thrift
 

On Wed, Jul 17, 2013 at 4:03 PM, Tyler Hobbs  wrote:
> I'll leave it to somebody else to comment on adding collections, etc to
> Thrift.

Doesn't make sense, since Thrift is all about the raw data cells, and
collections are an abstraction layer on top of that.

-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder, http://www.datastax.com
@spyced

Fw: Fwd: CQLsh assume command

2013-08-25 Thread Vivek Mishra
Hi,
fyi. 

Cqlsh ASSUME command, does it work with INSERT statement?

Any suggestions?

-Vivek

-- Forwarded message --
From: Vivek Mishra 
Date: Sun, Aug 25, 2013 at 12:58 AM
Subject: CQLsh assume command
To: u...@cassandra.apache.org



Hi,
i am trying to get CQL3 ASSUME command working, as it works with Cassandra-cli.

In my example, i have create a table as :

create table
default(id blob PRIMARY KEY);
Then after connecting with CQLsh(version 3), i did execute:
assume default(id) values are text;
and then tried to insert a simple record as :


insert into default(id) values('1');

But still i am getting error as:
Bad Request: cannot parse '1' as hex bytes

Any suggestion, what am i doing incorrect here?

-Vivek

Re: CQLsh assume command

2013-08-25 Thread Vivek Mishra
I did post on user mailing list as well. 
I understand that, we can use these functions with each DDL/DML statement, but 
prior 2.0, ASSUME function should have worked as per provided definition.

Thanks for your reply.


-Vivek


 From: Aleksey Yeschenko 
To: dev@cassandra.apache.org; Vivek Mishra  
Sent: Sunday, August 25, 2013 7:37 PM
Subject: Re: CQLsh assume command
 

This is a wrong mailing list for this kind of questions.

That aside, you should use CQL3 conversion functions instead, that work both 
for INSERT/UPDATE and SELECT.

INSERT INTO default(id) VALUES (textAsBlob('1'));
SELECT blobAsText(id) FROM default;

ASSUME is gone in 2.0. 

-- 
AY


On Sunday, August 25, 2013 at 10:05 AM, Vivek Mishra wrote:

> Hi,
> fyi. 
> 
> Cqlsh ASSUME command, does it work with INSERT statement?
> 
> Any suggestions?
> 
> -Vivek
> 
> -- Forwarded message --
> From: Vivek Mishra mailto:mishra.v...@gmail.com)>
> Date: Sun, Aug 25, 2013 at 12:58 AM
> Subject: CQLsh assume command
> To: u...@cassandra.apache.org (mailto:u...@cassandra.apache.org)
> 
> 
> 
> Hi,
> i am trying to get CQL3 ASSUME command working, as it works with 
> Cassandra-cli.
> 
> In my example, i have create a table as :
> 
> create table
> default(id blob PRIMARY KEY);
> Then after connecting with CQLsh(version 3), i did execute:
> assume default(id) values are text;
> and then tried to insert a simple record as :
> 
> 
> insert into default(id) values('1');
> 
> But still i am getting error as:
> Bad Request: cannot parse '1' as hex bytes
> 
> Any suggestion, what am i doing incorrect here?
> 
> -Vivek 

Fw: Fwd: CQL & Thrift

2013-08-30 Thread Vivek Mishra
fyi. Just curious to know the real reason behind "not to mix thrift and CQL3".

Any pointers?

-Vivek



-- Forwarded message ------
From: Vivek Mishra 
Date: Fri, Aug 30, 2013 at 11:21 PM
Subject: Re: CQL & Thrift
To: u...@cassandra.apache.org



Hi,
I understand that, but i want to understand the reason behind such behavior?  
Is it because of maintaining different metadata objects for CQL3 and thrift?

Any suggestion?

-Vivek



On Fri, Aug 30, 2013 at 11:15 PM, Jon Haddad  wrote:

If you're going to work with CQL, work with CQL.  If you're going to work with 
Thrift, work with Thrift.  Don't mix.
>
>
>On Aug 30, 2013, at 10:38 AM, Vivek Mishra  wrote:
>
>Hi,
>>If i a create a table with CQL3 as 
>>
>>
>>create table user(user_id text PRIMARY KEY, first_name text, last_name text, 
>>emailid text);
>>
>>
>>and create index as:
>>create index on user(first_name);
>>
>>
>>then inserted some data as:
>>insert into user(user_id,first_name,last_name,"emailId") 
>>values('@mevivs','vivek','mishra','vivek.mis...@impetus.co.in');
>>
>>
>>
>>
>>
>>Then if update same column family using Cassandra-cli as:
>>
>>
>>update column family user with key_validation_class='UTF8Type' and 
>>column_metadata=[{column_name:last_name, validation_class:'UTF8Type', 
>>index_type:KEYS},{column_name:first_name, validation_class:'UTF8Type', 
>>index_type:KEYS}];
>>
>>
>>
>>
>>
>>Now if i connect via cqlsh and explore user table, i can see column 
>>first_name,last_name are not part of table structure anymore. Here is the 
>>output:
>>
>>
>>CREATE TABLE user (
>>  key text PRIMARY KEY
>>) WITH
>>  bloom_filter_fp_chance=0.01 AND
>>  caching='KEYS_ONLY' AND
>>  comment='' AND
>>  dclocal_read_repair_chance=0.00 AND
>>  gc_grace_seconds=864000 AND
>>  read_repair_chance=0.10 AND
>>  replicate_on_write='true' AND
>>  populate_io_cache_on_flush='false' AND
>>  compaction={'class': 'SizeTieredCompactionStrategy'} AND
>>  compression={'sstable_compression': 'SnappyCompressor'};
>>
>>
>>cqlsh:cql3usage> select * from user;
>>
>>
>> user_id
>>-
>> @mevivs
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>I understand that, CQL3 and thrift interoperability is an issue. But this 
>>looks to me a very basic scenario.
>>
>>
>>
>>
>>
>>
>>Any suggestions? Or If anybody can explain a reason behind this?
>>
>>
>>-Vivek
>>
>>
>>
>>
>>
>>
>>
>>
>

Re: Fw: Fwd: CQL & Thrift

2013-08-30 Thread Vivek Mishra
True. but in my example i did not drop any column:

update column family user with key_validation_class='UTF8Type' and 
column_metadata=[{column_name:last_name, validation_class:'UTF8Type', 
index_type:KEYS},{column_name:first_name, validation_class:'UTF8Type', 
index_type:KEYS}];



And surprisingly:

alter table user add first_name text;
alter table user add last_name text;


It gives me back column with values(on cqlsh), but still no indexes.  


They have two different schema systems, two different access languages, there 
is some compatibility between the two, but working out which feature sets mix 
and match is more effort then just picking one.
 If two different schema systems and two different languages. But why 
can't they differently rather than a random behavior. I haven't looked into the 
code, so not sure if my question is valid or not 


Thanks for your reply.

-Vivek


 From: Edward Capriolo 
To: "dev@cassandra.apache.org" ; Vivek Mishra 
 
Sent: Friday, August 30, 2013 11:53 PM
Subject: Re: Fw: Fwd: CQL & Thrift
 


This is always so hard to explain but

http://www.datastax.com/dev/blog/thrift-to-cql3


Get to the part that looks like this:

update column family user_profiles
with key_validation_class = UTF8Type
and comparator = UTF8Type
and column_metadata=[]

"Since the static column values validation types have been dropped, they are 
not available to your client library anymore. In particular, as can be seen in 
the output above, cqlsh display some value in a non human-readable format. And 
unless the client library exposes an easy way to force the deserialization 
format for a value, such deserialization will have to be done manually in 
client code."

This I think the above is largest reason. Due to the way 'CQL'  wants to 
present 'thrift' column familes, you have to lose your 'thrift' notion of 
schema, because it is not compatible with the 'cql' notion of schema. I am 
wrapping 'thrift' and 'cql' in quotes because 'CQL' is an access language, but 
when you define tables as non-compact storage they gain 'features' that make 
them not understandable by non-cql clients.

They have two different schema systems, two different access languages, there 
is some compatibility between the two, but working out which feature sets mix 
and match is more effort then just picking one.



On Fri, Aug 30, 2013 at 2:05 PM, Vivek Mishra  wrote:

fyi. Just curious to know the real reason behind "not to mix thrift and CQL3".
>
>Any pointers?
>
>-Vivek
>
>
>
>-- Forwarded message --
>From: Vivek Mishra 
>Date: Fri, Aug 30, 2013 at 11:21 PM
>Subject: Re: CQL & Thrift
>To: u...@cassandra.apache.org
>
>
>
>Hi,
>I understand that, but i want to understand the reason behind such behavior?  
>Is it because of maintaining different metadata objects for CQL3 and thrift?
>
>Any suggestion?
>
>-Vivek
>
>
>
>On Fri, Aug 30, 2013 at 11:15 PM, Jon Haddad  wrote:
>
>If you're going to work with CQL, work with CQL.  If you're going to work with 
>Thrift, work with Thrift.  Don't mix.
>>
>>
>>On Aug 30, 2013, at 10:38 AM, Vivek Mishra  wrote:
>>
>>Hi,
>>>If i a create a table with CQL3 as 
>>>
>>>
>>>create table user(user_id text PRIMARY KEY, first_name text, last_name text, 
>>>emailid text);
>>>
>>>
>>>and create index as:
>>>create index on user(first_name);
>>>
>>>
>>>then inserted some data as:
>>>insert into user(user_id,first_name,last_name,"emailId") 
>>>values('@mevivs','vivek','mishra','vivek.mis...@impetus.co.in');
>>>
>>>
>>>
>>>
>>>
>>>Then if update same column family using Cassandra-cli as:
>>>
>>>
>>>update column family user with key_validation_class='UTF8Type' and 
>>>column_metadata=[{column_name:last_name, validation_class:'UTF8Type', 
>>>index_type:KEYS},{column_name:first_name, validation_class:'UTF8Type', 
>>>index_type:KEYS}];
>>>
>>>
>>>
>>>
>>>
>>>Now if i connect via cqlsh and explore user table, i can see column 
>>>first_name,last_name are not part of table structure anymore. Here is the 
>>>output:
>>>
>>>
>>>CREATE TABLE user (
>>>  key text PRIMARY KEY
>>>) WITH
>>>  bloom_filter_fp_chance=0.01 AND
>>>  caching='KEYS_ONLY' AND
>>>  comment='' AND
>>>  dclocal_read_repair_chance=0.00 AND
>>>  gc_grace_seconds=864000 AND
>>>  read_repair_chance=0.10 AND
>>>  replicate_on_write='true' AND
>>>  populate_io_cache_on_flush='false' AND
>>>  compaction={'class': 'SizeTieredCompactionStrategy'} AND
>>>  compression={'sstable_compression': 'SnappyCompressor'};
>>>
>>>
>>>cqlsh:cql3usage> select * from user;
>>>
>>>
>>> user_id
>>>-
>>> @mevivs
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>I understand that, CQL3 and thrift interoperability is an issue. But this 
>>>looks to me a very basic scenario.
>>>
>>>
>>>
>>>
>>>
>>>
>>>Any suggestions? Or If anybody can explain a reason behind this?
>>>
>>>
>>>-Vivek
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>

Broken pipe : Cassandra 1.2.9

2013-12-24 Thread Vivek Mishra
Hi,
I have a 6 node, 2DC cluster setup. I have configured consistency level to 
QUORUM.  But very often i am getting "Broken pipe"
com.impetus.client.cassandra.CassandraClientBase
(CassandraClientBase.java:1926) - Error while executing native CQL
query Caused by: .
org.apache.thrift.transport.TTransportExceptionjava.net.SocketException: Broken 
pipe
       at
org.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransportjava:147)
at org.apache.thrift.transport.TFramedTransport.flush(TFramedTransport.java:156)
at
org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:65)
at
org.apache.cassandra.thrift.Cassandra$Client.send_execute_cql3_query(Cassandra.java:1556)
at
org.apache.cassandra.thrift.Cassandra$Client.execute_cql3_query(Cassandra.java:1546)



I am simply reading few records from a column family(not huge amount of data)

Connection pooling and socket time out is properly configured. I have even 
modified 
read_request_timeout_in_ms

request_timeout_in_ms

write_request_timeout_in_ms  in cassandra.yaml to higher value.



It works fine with single node.

any idea? Is it an issue at server side or with client API?


-Vivek


Re: Broken pipe : Cassandra 1.2.9

2013-12-24 Thread Vivek Mishra
Hi,
Thanks. retry is only option? On server side is it possible to configure such 
retries?

-Vivek



On Tuesday, December 24, 2013 7:58 PM, Jason Wee  wrote:
 
Hmm.. Broken pipe sounds like the existing connection is disconnected. Try 
reestablish connection again to the cluster node?

/Jason



On Tue, Dec 24, 2013 at 5:54 PM, Vivek Mishra  wrote:

Hi,
>I have a 6 node, 2DC cluster setup. I have configured consistency level to 
>QUORUM.  But very often i am getting "Broken pipe"
>com.impetus.client.cassandra.CassandraClientBase
>(CassandraClientBase.java:1926) - Error while executing native CQL
>query Caused by: .
>org.apache.thrift.transport.TTransportExceptionjava.net.SocketException: 
>Broken pipe
>       at
>org.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransportjava:147)
>at 
>org.apache.thrift.transport.TFramedTransport.flush(TFramedTransport.java:156)
>at
>org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:65)
>at
>org.apache.cassandra.thrift.Cassandra$Client.send_execute_cql3_query(Cassandra.java:1556)
>at
>org.apache.cassandra.thrift.Cassandra$Client.execute_cql3_query(Cassandra.java:1546)
>
>
>
>I am simply reading few records from a column family(not huge amount of data)
>
>Connection pooling and socket time out is properly configured. I have even 
>modified 
>read_request_timeout_in_ms
>
>request_timeout_in_ms
>
>write_request_timeout_in_ms  in cassandra.yaml to higher value.
>
>
>
>It works fine with single node.
>
>any idea? Is it an issue at server side or with client API?
>
>
>-Vivek
>

Database Metadata

2011-05-20 Thread Vivek Mishra
Any thoughts on creating something like seperate DatabaseMetadata api for CQL?


JdbcDriverTest

2011-06-15 Thread Vivek Mishra
Hi,
I am trying to run JdbcDriverTest. But somehow it is failing for 

java.sql.SQLException: Internal error processing execute_cql_query
    at 
org.apache.cassandra.cql.jdbc.CassandraStatement.execute(CassandraStatement.java:176)

This is happening on startServer(). Looking into Cassandra.yaml, i can see that 
definitions for JdbcInteger, Standard1 Col families are missing. 

Any idea about this?
I took latest 0.8.0 release.

Vivek


Re: JdbcDriverTest

2011-06-15 Thread Vivek Mishra
I can see that cassandra.yaml is not loading any default keyspace or column 
family now.
Wondering if JdbcDriverTest should be modified to load required keyspace and 
Columnfamilies( e.g. JdbcInteger, Standard1) explicitly?


--- On Wed, 6/15/11, Jonathan Ellis  wrote:

From: Jonathan Ellis 
Subject: Re: JdbcDriverTest
To: dev@cassandra.apache.org
Date: Wednesday, June 15, 2011, 5:05 PM

Internal error means, the error is in the server logs.
On Jun 15, 2011 5:33 AM, "Vivek Mishra"  wrote:
> Hi,
> I am trying to run JdbcDriverTest. But somehow it is failing for
>
> java.sql.SQLException: Internal error processing execute_cql_query
>     at
org.apache.cassandra.cql.jdbc.CassandraStatement.execute(CassandraStatement.java:176)
>
> This is happening on startServer(). Looking into Cassandra.yaml, i can see
that definitions for JdbcInteger, Standard1 Col families are missing.
>
> Any idea about this?
> I took latest 0.8.0 release.
>
> Vivek


Re: JdbcDriverTest

2011-06-15 Thread Vivek Mishra
looking into logs leads me to this:

java.lang.NoSuchMethodError: 
org.apache.commons.lang.StringUtils.join(Ljava/util/Collection;Ljava/lang/String;)Ljava/lang/String;
    at org.apache.cassandra.db.RowMutation.toString(RowMutation.java:263)

I can see that version required and mentioned in build.xml is 2.4 of 
commons-lang. But same API is present with apache-rat version 0.6(included 
under maven-dependency)

--- On Wed, 6/15/11, Vivek Mishra  wrote:

From: Vivek Mishra 
Subject: Re: JdbcDriverTest
To: dev@cassandra.apache.org
Date: Wednesday, June 15, 2011, 5:10 PM

I can see that cassandra.yaml is not loading any default keyspace or column 
family now.
Wondering if JdbcDriverTest should be modified to load required keyspace and 
Columnfamilies( e.g. JdbcInteger, Standard1) explicitly?


--- On Wed, 6/15/11, Jonathan Ellis  wrote:

From: Jonathan Ellis 
Subject: Re: JdbcDriverTest
To: dev@cassandra.apache.org
Date: Wednesday, June 15, 2011, 5:05 PM

Internal error means, the error is in the server logs.
On Jun 15, 2011 5:33 AM, "Vivek Mishra"  wrote:
> Hi,
> I am trying to run JdbcDriverTest. But somehow it is failing for
>
> java.sql.SQLException: Internal error processing execute_cql_query
>     at
org.apache.cassandra.cql.jdbc.CassandraStatement.execute(CassandraStatement.java:176)
>
> This is happening on startServer(). Looking into Cassandra.yaml, i can see
that definitions for JdbcInteger, Standard1 Col families are missing.
>
> Any idea about this?
> I took latest 0.8.0 release.
>
> Vivek


Connection Pooling

2011-08-25 Thread Vivek Mishra
Any plan for connection pooling? is it already in place?

-Vivek


CqlResult in CassandraConnection

2011-08-28 Thread Vivek Mishra
Hi,
Recently i can see changes made in jdbc connection API. 

Wondering why are we returning CqlResult from CassandraConnection, ideally it 
should return ResultSet as jdbc api.

Any thoughts?

-Vivek


Re: CqlResult in CassandraConnection

2011-08-28 Thread Vivek Mishra
I was looking at AbstractCassandraConnection,AbstractResultSet and 
AbstractStatement classes. Name looks to me quite confusing as none of them is 
an abstract class.  1 more thin, any specific reason for creating class level 
hierarchy? 


Plans for any other implementation/s of CassandraConnection, ResultSet and 
Statement sub class?

Vovel




From: Rick Shaw 
To: dev@cassandra.apache.org
Cc: Vivek Mishra 
Sent: Sunday, August 28, 2011 9:39 PM
Subject: Re: CqlResult in CassandraConnection

The class itself is not public, so it is generally protected from misuse, but 
it is a good recommendation to remove the public modifier on those 
non-interface imethods as well. I'll see to it.

On Aug 28, 2011, at 11:35 AM, Eric Evans wrote:

> On Sun, Aug 28, 2011 at 3:47 AM, Vivek Mishra  wrote:
>> Recently i can see changes made in jdbc connection API.
>> 
>> Wondering why are we returning CqlResult from CassandraConnection, ideally 
>> it should return ResultSet as jdbc api.
>> 
>> Any thoughts?
> 
> The execute methods aren't a part of the java.sql.Connection
> interface, but they are public, and so shouldn't be returning Thrift
> structs.  Maybe we just need to drop the public modifier.
> 
> Can you open a ticket Vivek?
> 
> -- 
> Eric Evans
> Acunu | http://www.acunu.com | @acunu

Re: CqlResult in CassandraConnection

2011-08-28 Thread Vivek Mishra
Thanks Rick.


As to class level hierarchy, I am not sure I understand the reference? Could 
you elaborate?

 As we have got 1 super class and sub class in place for ( 
AbstractCassandraConnection,AbstractResultSet and AbstractStatement). So 
thought to ask for if any other implementation is on roadmap? 


Vivek




From: Rick Shaw 
To: dev@cassandra.apache.org; Vivek Mishra 
Sent: Monday, August 29, 2011 12:59 AM
Subject: Re: CqlResult in CassandraConnection

The reason they are set up that was is to clearly delineate between methods 
that there are no plans to implement any time in the near future; it minimizes 
the distraction in the classes that get a lot of activity. It is not necessary, 
but it was done that way when I started looking at the code and I recognized it 
as a clever approach and I followed its example. As to being confusing, I guess 
the abstract keyword was inadvertently omitted along the way and got 
propagated; but the intended effect is not hampered by the omission. I'll clean 
it up with the addition of the keyword to improve on its clarity.

As to class level hierarchy, I am not sure I understand the reference? Could 
you elaborate?

As to plans: Broad plans for 1.0 timeframe target are published in 
CASSANDRA-2876. The implementation of the prepared statement improvements 
(CASSANDRA-2885) is waiting on required support of CQL in various forms. 

I am also unclear as to what you are asking for in the final paragraph? Changes 
in each of those classes is inevitable to support new features but there are no 
plans (by me) for any other  (alternate) classes. Perhaps you are implying they 
could be marked final? Note CassandraPreparedStatement is a sub-class of 
CassandraStatement.

On Aug 28, 2011, at 1:33 PM, Vivek Mishra wrote:

> I was looking at AbstractCassandraConnection,AbstractResultSet and 
> AbstractStatement classes. Name looks to me quite confusing as none of them 
> is an abstract class.  1 more thin, any specific reason for creating class 
> level hierarchy? 
> -2876
> Plans for any other implementation/s of CassandraConnection, ResultSet and 
> Statement sub class?
> 
> Vovel
> 
> 
> 
> 
> From: Rick Shaw 
> To: dev@cassandra.apache.org
> Cc: Vivek Mishra 
> Sent: Sunday, August 28, 2011 9:39 PM
> Subject: Re: CqlResult in CassandraConnection
> 
> The class itself is not public, so it is generally protected from misuse, but 
> it is a good recommendation to remove the public modifier on those 
> non-interface imethods as well. I'll see to it.
> 
> On Aug 28, 2011, at 11:35 AM, Eric Evans wrote:
> 
>> On Sun, Aug 28, 2011 at 3:47 AM, Vivek Mishra  wrote:
>>> Recently i can see changes made in jdbc connection API.
>>> 
>>> Wondering why are we returning CqlResult from CassandraConnection, ideally 
>>> it should return ResultSet as jdbc api.
>>> 
>>> Any thoughts?
>> 
>> The execute methods aren't a part of the java.sql.Connection
>> interface, but they are public, and so shouldn't be returning Thrift
>> structs.  Maybe we just need to drop the public modifier.
>> 
>> Can you open a ticket Vivek?
>> 
>> -- 
>> Eric Evans
>> Acunu | http://www.acunu.com | @acunu

Re: Proposal: Moving CQL drivers

2011-09-06 Thread Vivek Mishra
Sounds good moving to github.
1 quick question, what about JIRAs already raised w.r.t drivers? Not sure but 
is it possible to integrate these new projects with current JIRA flow?

Planning to make these new projects based on maven build process?(As that might 
be helpful in case of any quick release required for any sub module).

Any subsequent Cassandra release will be independent on driver release/s or 
vice versa?

What about if creating a single github project like CQLDrivers and creating 
jdbc and dbapi2 as sub projects of it? 


As a developer it can help in case somebody needs to check in some stuff in 
both of these.


-Vivek





From: Eric Evans 
To: dev@cassandra.apache.org
Sent: Tuesday, September 6, 2011 10:50 PM
Subject: Proposal: Moving CQL drivers

So following on from the previous discussion[1] about moving the CQL
drivers out of tree, my interpretation of that discussion is that we
have consensus that this should be done, and that they should go in
Google Code and Apache Extras.  Further, it seems a foregone
conclusion that Git be used, and so I also assume that's a safe
assumption, at least for the two existing drivers (Python and Java).

One of the obstacles was the tight coupling of components that the
JDBC driver depends on, which should now be solved in trunk
(https://issues.apache.org/jira/browse/CASSANDRA-2936).  Other than
that the only items remaining relate to updating the tests so that
they can connect to an already running instance, instead of the
setup/teardown of nodes that is done now.

Here is what I propose to do (one driver at a time):

1. Setup new Git-based projects on Apache Extras (cassandra-jdbc and
cassandra-dbapi2)
2. Import the most current code and fix-up the tests as needed
3. Submit issues w/ patches for the removal of the corresponding
driver from Cassandra

I would like to have this in place for 1.0, and believe it should be
OK despite the fact that we are freezing on September 8 (we're still
freezing on 9/8 I assume?).  Since the plan was to delete the drivers
directory after branching anyway, this shouldn't be disruptive to the
release (even if drivers/ weren't deleted, the only functional change
would be to remove JDBC build and test targets from build.xml).

Thoughts?


[1]: http://thread.gmane.org/gmane.comp.db.cassandra.devel/4075

-- 
Eric Evans
Acunu | http://www.acunu.com | @acunu

CQL, Hive and Lucene

2011-12-18 Thread Vivek Mishra
Hi,

I was looking into CQL, Hive over Cassandra and secondary index via lucene. 
Wondering why we need all these. If CQL is going to be query interface for all 
cassandra specific queries, why it is required to have Hive support( Just for 
running M/R jobs)?  

Secondary index support via Lucene : How much scalable is this? And how it is 
going to be different from current secondary index support provided by 
Cassandra(0.7.x onwards).
I understand that still search within super columns is not possible in 
Cassandra. I did implement the same in Kundera via LUCENE only.


Apart from this, any new release of lucene and hive will need a migration. 
Shouldn't we develop these stuff out of cassandra?



Sincerely,
Vivek 

Re: Dynamic columns in a column family?

2012-01-07 Thread Vivek Mishra
I think Cassandra automatically handles it. isn't it?



 From: Frank Yang 
To: dev@cassandra.apache.org 
Sent: Friday, January 6, 2012 11:30 PM
Subject: Dynamic columns in a column family?
 
Hi everyone,

I am wondering whether it is possible to not to define the column
metadata when creating a column family, but to specify the column when
client updates data, for example:

CREATE COLUMN FAMILY products WITH default_validation_class= UTF8Type
AND key_validation_class=UTF8Type AND comparator=UTF8Type;
set products['1001']['brand']= ‘Sony’;

In other words, we don't want to fix the columns definition when
creating a column family, as we might have to insert new columns into
the column family.  Is it possible to achieve it?

Thanks,
Fan

Re: [Compile Error] java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

2012-03-12 Thread Vivek Mishra
I think, Snakeyaml jar is missing from your classpath.

You can download it from here:

http://www.java2s.com/Code/Jar/s/Downloadsnakeyamljar.htm






 From: Thushan Ganegedara 
To: dev@cassandra.apache.org 
Sent: Tuesday, March 13, 2012 9:40 AM
Subject: Re: [Compile Error] java.lang.NoClassDefFoundError: 
org/slf4j/LoggerFactory
 
Hi Dave,

Thank you for the quick reply. I did the following
I put slf4j-api-1.6.1.jar and slf4j-log4j12-1.6.1.jar to my class path as
you suggested.
It presented me with another error
Failed to instantiate SLF4J LoggerFactory

When I googled this I found the following post, though it's not directly
related to cassandra
https://medsphere.org/thread/1960

When I removed slf4j-log4j12-1.6-1.jar and ran, it gives me following error

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further
details.
java.lang.NoClassDefFoundError: org/yaml/snakeyaml/error/YAMLException
    at
org.apache.cassandra.service.AbstractCassandraDaemon.setup(AbstractCassandraDaemon.java:125)
    at
org.apache.cassandra.service.AbstractCassandraDaemon.activate(AbstractCassandraDaemon.java:352)
    at
org.apache.cassandra.thrift.CassandraDaemon.main(CassandraDaemon.java:105)
Caused by: java.lang.ClassNotFoundException:
org.yaml.snakeyaml.error.YAMLException
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 3 more
Exception encountered during startup: org/yaml/snakeyaml/error/YAMLException


On Tue, Mar 13, 2012 at 7:30 AM, Dave Brosius wrote:

> You need to add slf4j-api-1.6.1.jar and slf4j-log4j12-1.6.1.jar to your
> class path
>
>
> You can also look at this page, http://wiki.apache.org/**
> cassandra/HowToDebug  for
> another example of setting up cassandra for debugging.
>
>
>
>
> On 03/12/2012 09:47 PM, Thushan Ganegedara wrote:
>
>> Hi all,
>> I have followed the instruction presented on
>> Running cassandra on Eclipse -
>> http://wiki.apache.org/**cassandra/**RunningCassandraInEclipse
>> But when I tried to compile the codebase it presented me with the
>> following
>> error
>>
>> java.lang.
>> NoClassDefFoundError: org/slf4j/LoggerFactory
>>     at
>> org.apache.cassandra.service.**AbstractCassandraDaemon.<**clinit>(**
>> AbstractCassandraDaemon.java:**103)
>> Caused by: java.lang.**ClassNotFoundException: org.slf4j.LoggerFactory
>>     at java.net.URLClassLoader$1.run(**Unknown Source)
>>     at java.security.**AccessController.doPrivileged(**Native Method)
>>     at java.net.URLClassLoader.**findClass(Unknown Source)
>>     at java.lang.ClassLoader.**loadClass(Unknown Source)
>>     at sun.misc.Launcher$**AppClassLoader.loadClass(**Unknown Source)
>>     at java.lang.ClassLoader.**loadClass(Unknown Source)
>>     ... 1 more
>> Exception in thread "main"
>>
>> Can anybody help me here?
>> Thnx a lot
>>
>>
>>
>


-- 
Regards,

Thushan Ganegedara,
Department of Computer Science and Engineering,
University of Moratuwa.