You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Brayton Thompson <th...@grnoc.iu.edu> on 2010/10/14 21:41:12 UTC

0.7 API Change?

Was there a change to the API in 0.7?

example...
from the api wikki

insert

void insert(string keyspace, string key, ColumnPath column_path, binary value, i64 timestamp, ConsistencyLevel consistency_level)


Now from the thrift generated perl library for the 0.7 beta 2 download.

sub insert{
  my $self = shift;
  my $key = shift;
  my $column_parent = shift;
  my $column = shift;
  my $consistency_level = shift;

  $self->send_insert($key, $column_parent, $column, $consistency_level);
  $self->recv_insert();
}

For those of you who don't use perl... 
  my $self = shift;
  my $key = shift;
  my $column_parent = shift;
  my $column = shift;
  my $consistency_level = shift;

these get the function arguments out in the order they are listed. The first argument (in this example the thing stored into $self) is a reference to the class object the method belongs to.  So in our example keyspace goes into $key, key goes into $column_parent ... etc.

This is not a huge issue, I can look at the module to determine the new ordering of arguments. However how can I run an insert if the keyspace is never supplied to the method?

Thank you for your time.

Re: 0.7 API Change?

Posted by Alberto Velandia <be...@yogadigital.net>.
You have to call the Ghostbusters!!!


On Oct 14, 2010, at 2:44 PM, Jesse McConnell wrote:

> you have to call set_keyspace on the connection now
> 
> cheers,
> jesse
> 
> --
> jesse mcconnell
> jesse.mcconnell@gmail.com
> 
> 
> On Thu, Oct 14, 2010 at 14:41, Brayton Thompson <th...@grnoc.iu.edu> wrote:
> Was there a change to the API in 0.7?
> 
> example...
> from the api wikki
> 
> insert
> 
> void insert(string keyspace, string key, ColumnPath column_path, binary value, i64 timestamp, ConsistencyLevel consistency_level)
> 
> 
> Now from the thrift generated perl library for the 0.7 beta 2 download.
> 
> sub insert{
>   my $self = shift;
>   my $key = shift;
>   my $column_parent = shift;
>   my $column = shift;
>   my $consistency_level = shift;
> 
>   $self->send_insert($key, $column_parent, $column, $consistency_level);
>   $self->recv_insert();
> }
> 
> For those of you who don't use perl... 
>   my $self = shift;
>   my $key = shift;
>   my $column_parent = shift;
>   my $column = shift;
>   my $consistency_level = shift;
> 
> these get the function arguments out in the order they are listed. The first argument (in this example the thing stored into $self) is a reference to the class object the method belongs to.  So in our example keyspace goes into $key, key goes into $column_parent ... etc.
> 
> This is not a huge issue, I can look at the module to determine the new ordering of arguments. However how can I run an insert if the keyspace is never supplied to the method?
> 
> Thank you for your time.
> 

 
> Alberto Velandia
> Director de proyectos
> Calle 74 # 15-80 - Int 2. Oficina 202
> Osaka Trade Center
> Bogotá, Colombia, Latam.
> Tel: +571-345-1070
> Cel: +57301-466-3902
> Site en desarrollo: http://www.staging.yoga-digital.net/works
> Messenger: beto@yogadigital.net
> SkypeID: beto_velandia
>  

> La pureza de lo simple
> Este mensaje se dirige exclusivamente a su destinatario y puede contener información privilegiada o confidencial. Si no es usted el destinatario indicado, queda notificado de que la lectura, utilización, divulgación y/o copia sin autorización está prohibida en virtud de la legislación vigente. Si ha recibido este mensaje por error, le rogamos que nos lo comunique inmediatamente por esta misma vía y proceda a su destrucción. El correo electrónico vía Internet no permite asegurar la confidencialidad de los mensajes que se transmiten ni su integridad o correcta recepción. Yoga Digital S.A.S. no asume ninguna responsabilidad por estas circunstancias.
> 
> This message is intended exclusively for its addressee and may contain information that is CONFIDENTIAL and protected by a professional privilege or whose disclosure is prohibited by law. If you are not the intended recipient you are hereby notified that any read, dissemination, copy or disclosure of this communication is strictly prohibited by law. If this message has been received in error, please immediately notify us via e-mail and delete it.  Internet e-mail neither guarantees the confidentiality nor the integrity or proper receipt of the messages sent. Yoga Digital S.A.S. does not assume any liability for those circumstances.
> 


Re: 0.7 API Change?

Posted by Jonathan Ellis <jb...@gmail.com>.
Have you read NEWS?  Framed mode is on by default in 0.7.

On Thu, Oct 14, 2010 at 3:44 PM, Brayton Thompson <th...@grnoc.iu.edu> wrote:
> Ok i made the changes, now im running into a thrift exception on
> set_keyspace().
>
> $VAR1 = bless( {
>                  'code' => 0,
>                  'message' => 'TSocket: Could not read 4 bytes from
> xxx.xxx.xxx.xxx:9160'
>                }, 'Thrift::TException' );
> xxx.xxx.xxx.xxx is ip of the machine that the code is running on.
> 9160 is open in iptables. I have 3 nodes who are all clustered happily
> together to prove it.
> any ideas?
> On Oct 14, 2010, at 3:44 PM, Jesse McConnell wrote:
>
> you have to call set_keyspace on the connection now
> cheers,
> jesse
> --
> jesse mcconnell
> jesse.mcconnell@gmail.com
>
>
> On Thu, Oct 14, 2010 at 14:41, Brayton Thompson <th...@grnoc.iu.edu>
> wrote:
>>
>> Was there a change to the API in 0.7?
>> example...
>> from the api wikki
>>
>> insert
>>
>>
>> void insert(string keyspace, string key, ColumnPath column_path, binary value, i64 timestamp, ConsistencyLevel consistency_level)
>>
>> Now from the thrift generated perl library for the 0.7 beta 2 download.
>> sub insert{
>>   my $self = shift;
>>   my $key = shift;
>>   my $column_parent = shift;
>>   my $column = shift;
>>   my $consistency_level = shift;
>>   $self->send_insert($key, $column_parent, $column, $consistency_level);
>>   $self->recv_insert();
>> }
>> For those of you who don't use perl...
>>   my $self = shift;
>>   my $key = shift;
>>   my $column_parent = shift;
>>   my $column = shift;
>>   my $consistency_level = shift;
>> these get the function arguments out in the order they are listed. The
>> first argument (in this example the thing stored into $self) is a reference
>> to the class object the method belongs to.  So in our example keyspace goes
>> into $key, key goes into $column_parent ... etc.
>> This is not a huge issue, I can look at the module to determine the new
>> ordering of arguments. However how can I run an insert if the keyspace is
>> never supplied to the method?
>> Thank you for your time.
>
>



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

Re: 0.7 API Change?

Posted by Brayton Thompson <th...@grnoc.iu.edu>.
Ok i made the changes, now im running into a thrift exception on set_keyspace().


$VAR1 = bless( {
                 'code' => 0,
                 'message' => 'TSocket: Could not read 4 bytes from xxx.xxx.xxx.xxx:9160'
               }, 'Thrift::TException' );

xxx.xxx.xxx.xxx is ip of the machine that the code is running on.

9160 is open in iptables. I have 3 nodes who are all clustered happily together to prove it.
any ideas?

On Oct 14, 2010, at 3:44 PM, Jesse McConnell wrote:

> you have to call set_keyspace on the connection now
> 
> cheers,
> jesse
> 
> --
> jesse mcconnell
> jesse.mcconnell@gmail.com
> 
> 
> On Thu, Oct 14, 2010 at 14:41, Brayton Thompson <th...@grnoc.iu.edu> wrote:
> Was there a change to the API in 0.7?
> 
> example...
> from the api wikki
> 
> insert
> 
> void insert(string keyspace, string key, ColumnPath column_path, binary value, i64 timestamp, ConsistencyLevel consistency_level)
> 
> 
> Now from the thrift generated perl library for the 0.7 beta 2 download.
> 
> sub insert{
>   my $self = shift;
>   my $key = shift;
>   my $column_parent = shift;
>   my $column = shift;
>   my $consistency_level = shift;
> 
>   $self->send_insert($key, $column_parent, $column, $consistency_level);
>   $self->recv_insert();
> }
> 
> For those of you who don't use perl... 
>   my $self = shift;
>   my $key = shift;
>   my $column_parent = shift;
>   my $column = shift;
>   my $consistency_level = shift;
> 
> these get the function arguments out in the order they are listed. The first argument (in this example the thing stored into $self) is a reference to the class object the method belongs to.  So in our example keyspace goes into $key, key goes into $column_parent ... etc.
> 
> This is not a huge issue, I can look at the module to determine the new ordering of arguments. However how can I run an insert if the keyspace is never supplied to the method?
> 
> Thank you for your time.
> 


Re: 0.7 API Change?

Posted by Jesse McConnell <je...@gmail.com>.
you have to call set_keyspace on the connection now

cheers,
jesse

--
jesse mcconnell
jesse.mcconnell@gmail.com


On Thu, Oct 14, 2010 at 14:41, Brayton Thompson <th...@grnoc.iu.edu>wrote:

> Was there a change to the API in 0.7?
>
> example...
> from the api wikki
>
> insert
>
>    -
>
>
>    void insert(string keyspace, string key, ColumnPath column_path, binary value, i64 timestamp, ConsistencyLevel consistency_level)
>
>
> Now from the thrift generated perl library for the 0.7 beta 2 download.
>
> sub insert{
>   my $self = shift;
>   my $key = shift;
>   my $column_parent = shift;
>   my $column = shift;
>   my $consistency_level = shift;
>
>   $self->send_insert($key, $column_parent, $column, $consistency_level);
>   $self->recv_insert();
> }
>
> For those of you who don't use perl...
>   my $self = shift;
>   my $key = shift;
>   my $column_parent = shift;
>   my $column = shift;
>   my $consistency_level = shift;
>
> these get the function arguments out in the order they are listed. The
> first argument (in this example the thing stored into $self) is a reference
> to the class object the method belongs to.  So in our example keyspace goes
> into $key, key goes into $column_parent ... etc.
>
> This is not a huge issue, I can look at the module to determine the new
> ordering of arguments. However how can I run an insert if the keyspace is
> never supplied to the method?
>
> Thank you for your time.
>

Re: 0.7 API Change?

Posted by Brayton Thompson <th...@grnoc.iu.edu>.
awesome thank you.

On Oct 14, 2010, at 3:44 PM, Brandon Williams wrote:

> 
> 
> On Thu, Oct 14, 2010 at 2:41 PM, Brayton Thompson <th...@grnoc.iu.edu> wrote:
> Was there a change to the API in 0.7?
> 
> Yes, many.
>  
> example...
> from the api wikki
> 
> 
> Use http://wiki.apache.org/cassandra/API07 for 0.7.
>  
> This is not a huge issue, I can look at the module to determine the new ordering of arguments. However how can I run an insert if the keyspace is never supplied to the method?
> 
> set_keyspace first.
> 
> -Brandon 


Re: 0.7 API Change?

Posted by Brandon Williams <dr...@gmail.com>.
On Thu, Oct 14, 2010 at 2:41 PM, Brayton Thompson <th...@grnoc.iu.edu>wrote:

> Was there a change to the API in 0.7?
>

Yes, many.


> example...
> from the api wikki
>
>
Use http://wiki.apache.org/cassandra/API07 for 0.7.


> This is not a huge issue, I can look at the module to determine the new
> ordering of arguments. However how can I run an insert if the keyspace is
> never supplied to the method?
>

set_keyspace first.

-Brandon