You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by sh...@accenture.com on 2011/02/02 21:53:18 UTC

py_stress error in Cassandra 0.7

Hi,

I am trying to get the py_stress to work in Cassandra 0.7. I keep getting this error:

ubuntu@ip-10-114-85-218:~/apache-cassandra-0.7.0/contrib/py_stress$ python stress.py
Traceback (most recent call last):
  File "stress.py", line 520, in <module>
    make_keyspaces()
  File "stress.py", line 185, in make_keyspaces
    cfams = [CfDef(keyspace='Keyspace1', name='Standard1', column_metadata=colms),
NameError: global name 'CfDef' is not defined

Any suggestions?

Thanks,
Shan (Susie) Lu,  Analyst
Accenture Technology Labs - Silicon Valley
cell  +1 425.749.2546
email shan.lu@accenture.com<ma...@accenture.com>



This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information.  If you have received it in error, please notify the sender immediately and delete the original.  Any other use of the email by you is prohibited.

Re: py_stress error in Cassandra 0.7

Posted by Jonathan Ellis <jb...@gmail.com>.
That means you have an old version of the Thrift compiler.

On Wed, Feb 2, 2011 at 1:54 PM,  <sh...@accenture.com> wrote:
> I tried running with the 0.7 version and get this error:
>
>
>
> Buildfile: build.xml
>
>
>
> gen-thrift-py:
>
>      [echo] Generating Thrift Python code from
> /home/ubuntu/apache-cassandra-0.7.0/interface/cassandra.thrift ....
>
>      [exec]
> [WARNING:/home/ubuntu/apache-cassandra-0.7.0/interface/cassandra.thrift:375]
> Constant strings should be quoted: ConsistencyLevel.ONE
>
>      [exec]
>
>      [exec]
>
>      [exec]
> [FAILURE:/home/ubuntu/apache-cassandra-0.7.0/interface/cassandra.thrift:375]
> type error: const "consistency_level" was declared as enum
>
>
>
> BUILD FAILED
>
> /home/ubuntu/apache-cassandra-0.7.0/build.xml:250: exec returned: 1
>
>
>
> Total time: 0 seconds
>
>
>
> Thank you,
>
> Shan (Susie) Lu, Accenture Tech Labs SV
>
> email shan.lu@accenture.com
>
>
>
> From: Brandon Williams [mailto:driftx@gmail.com]
> Sent: Wednesday, February 02, 2011 1:18 PM
> To: user@cassandra.apache.org
> Subject: Re: py_stress error in Cassandra 0.7
>
>
>
> As the README suggests, you need to run ant gen-thrift-py first.
>
> On Wed, Feb 2, 2011 at 2:53 PM, <sh...@accenture.com> wrote:
>
> Hi,
>
>
>
> I am trying to get the py_stress to work in Cassandra 0.7. I keep getting
> this error:
>
>
>
> ubuntu@ip-10-114-85-218:~/apache-cassandra-0.7.0/contrib/py_stress$ python
> stress.py
>
> Traceback (most recent call last):
>
>   File "stress.py", line 520, in <module>
>
>     make_keyspaces()
>
>   File "stress.py", line 185, in make_keyspaces
>
>     cfams = [CfDef(keyspace='Keyspace1', name='Standard1',
> column_metadata=colms),
>
> NameError: global name 'CfDef' is not defined
>
>
>
> Any suggestions?
>
>
>
> Thanks,
>
> Shan (Susie) Lu,  Analyst
>
> Accenture Technology Labs - Silicon Valley
>
> cell  +1 425.749.2546
>
> email shan.lu@accenture.com
>
>
>
> This message is for the designated recipient only and may contain
> privileged, proprietary, or otherwise private information. If you have
> received it in error, please notify the sender immediately and delete the
> original. Any other use of the email by you is prohibited.
>
>
>
> This message is for the designated recipient only and may contain
> privileged, proprietary, or otherwise private information. If you have
> received it in error, please notify the sender immediately and delete the
> original. Any other use of the email by you is prohibited.



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

RE: py_stress error in Cassandra 0.7

Posted by sh...@accenture.com.
I tried running with the 0.7 version and get this error:

Buildfile: build.xml

gen-thrift-py:
     [echo] Generating Thrift Python code from /home/ubuntu/apache-cassandra-0.7.0/interface/cassandra.thrift ....
     [exec] [WARNING:/home/ubuntu/apache-cassandra-0.7.0/interface/cassandra.thrift:375] Constant strings should be quoted: ConsistencyLevel.ONE
     [exec]
     [exec]
     [exec] [FAILURE:/home/ubuntu/apache-cassandra-0.7.0/interface/cassandra.thrift:375] type error: const "consistency_level" was declared as enum

BUILD FAILED
/home/ubuntu/apache-cassandra-0.7.0/build.xml:250: exec returned: 1

Total time: 0 seconds

Thank you,
Shan (Susie) Lu, Accenture Tech Labs SV
email shan.lu@accenture.com<ma...@accenture.com>

From: Brandon Williams [mailto:driftx@gmail.com]
Sent: Wednesday, February 02, 2011 1:18 PM
To: user@cassandra.apache.org
Subject: Re: py_stress error in Cassandra 0.7

As the README suggests, you need to run ant gen-thrift-py first.
On Wed, Feb 2, 2011 at 2:53 PM, <shan.lu<http://shan.lu>@accenture.com<http://accenture.com>> wrote:
Hi,

I am trying to get the py_stress to work in Cassandra 0.7. I keep getting this error:

ubuntu@ip-10-114-85-218:~/apache-cassandra-0.7.0/contrib/py_stress$<mailto:ubuntu@ip-10-114-85-218:~/apache-cassandra-0.7.0/contrib/py_stress$> python stress.py
Traceback (most recent call last):
  File "stress.py", line 520, in <module>
    make_keyspaces()
  File "stress.py", line 185, in make_keyspaces
    cfams = [CfDef(keyspace='Keyspace1', name='Standard1', column_metadata=colms),
NameError: global name 'CfDef' is not defined

Any suggestions?

Thanks,
Shan (Susie) Lu,  Analyst
Accenture Technology Labs - Silicon Valley
cell  +1 425.749.2546<tel:+14257492546>
email shan.lu@accenture.com<ma...@accenture.com>


This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.



This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information.  If you have received it in error, please notify the sender immediately and delete the original.  Any other use of the email by you is prohibited.

Re: py_stress error in Cassandra 0.7

Posted by Brandon Williams <dr...@gmail.com>.
As the README suggests, you need to run ant gen-thrift-py first.

On Wed, Feb 2, 2011 at 2:53 PM, <sh...@accenture.com> wrote:

> Hi,
>
>
>
> I am trying to get the py_stress to work in Cassandra 0.7. I keep getting
> this error:
>
>
>
> ubuntu@ip-10-114-85-218:~/apache-cassandra-0.7.0/contrib/py_stress$ python
> stress.py
>
> Traceback (most recent call last):
>
>   File "stress.py", line 520, in <module>
>
>     make_keyspaces()
>
>   File "stress.py", line 185, in make_keyspaces
>
>     cfams = [CfDef(keyspace='Keyspace1', name='Standard1',
> column_metadata=colms),
>
> NameError: global name 'CfDef' is not defined
>
>
>
> Any suggestions?
>
>
>
> Thanks,
>
> *Shan (Susie) Lu,  *Analyst**
>
> Accenture Technology Labs - Silicon Valley **
>
> cell  +1 425.749.2546 <tel:+14257492546>
>
> email *shan.lu@accenture.com <ch...@accenture.com>*
>
>
>
> This message is for the designated recipient only and may contain
> privileged, proprietary, or otherwise private information. If you have
> received it in error, please notify the sender immediately and delete the
> original. Any other use of the email by you is prohibited.
>

Re: py_stress error in Cassandra 0.7

Posted by Oleg Proudnikov <ol...@cloudorange.com>.
Have you generated Cassandra Thrift interface?

You will need to install Thrift first: 

http://wiki.apache.org/cassandra/InstallThrift

Then, in the interface directory under Cassandra's home you can run

thrift --gen py cassandra.thrift

If the above does not install generated cassandra thrift module, then copy it
manually to the site-packages directory of your python installation. On my
server it is in 

/usr/lib/python/site-packages

I hope this helps...

Oleg