Re: Perl interface for 0.7.0

2011-02-02 Thread Jonathan Ellis
Hi Jose,

Thanks for the note.  Did you update the wiki page?  You can do so by
clicking Login, which will prompt you to create an account.

On Sun, Jan 23, 2011 at 6:12 PM, Jose Fonseca  wrote:
> Hi everyone,
>  just a quick note about the examples up at
> http://wiki.apache.org/cassandra/ThriftExamples#Perl
>
> As is widely known, none of them work using the Thrift-generated Perl
> modules from Cassandra 0.7.0.
>
> As a side note, even after I updated the test script to 0.7.0,
> Thrift::BufferedTransport also would not work, the result is :
> $VAR1 = bless( {
>                 'code' => 0,
>                 'message' => 'TSocket: Could not read 4 bytes from
> localhost:9160'
>               }, 'Thrift::TException' );
>
> After I found a discussion related to a PHP problem with the same sympton, I
> tried changing to Thrift::FramedTransport and it fixes the problem. I've
> included a Perl snippet that works against 0.7.0 - it is based on the
> current Wiki example. The only way to find the method signatures for the
> rest of the API at this time seems to be by reading the code in
> Cassandra/Cassandra.pm and Cassandra/Type.pm. I wish I had the time to
> contribute better Perl documentation, in fact I will if my day job allows me
> some time to.
>
> Best wishes,
> Jose Fonseca
>
>
> #!/usr/bin/perl -w
>
> use strict;
> use warnings;
>
> # Change for your environment
> use lib '/opt/apache-cassandra-0.7.0/interface/gen-perl/';
> use Cassandra::Cassandra;
> use Cassandra::Constants;
> use Cassandra::Types;
>
> use Thrift;
> use Thrift::BinaryProtocol;
> use Thrift::Socket;
> use Thrift::BufferedTransport;
> use Thrift::FramedTransport;
>
> use Data::Dumper;
>
> # localhost and 9160 are default in storage conf for rpc listener
> my $socket = new Thrift::Socket('localhost', 9160);
> my $transport = new Thrift::FramedTransport($socket,1024,1024);
> my $protocol = new Thrift::BinaryProtocol($transport);
> my $client = new Cassandra::CassandraClient($protocol);
>
> eval {
>   $transport->open();
>   my $keyspace = 'test1';
>   my $row_key = 'people_code_1';
>
>   # ColumnParent tells the API the ColumnFamily or SuperColumn we're
> working on
>   my $column_parent      = new Cassandra::ColumnParent({column_family =>
> "people"});
>   my $consistency_level = Cassandra::ConsistencyLevel::ONE;
>   my $auth_request      = new Cassandra::AuthenticationRequest();
>
>   # accessing object internals directly seems to be standard practice on
> the Thrift-generated code
>   $auth_request->{credentials} = { username => 'user', password => 'pass'
> };
>
>   $client->login($auth_request);
>   $client->set_keyspace($keyspace);
>
>   my $timestamp = time;
>
>   my $column = new Cassandra::Column();
>   $column->{name}         = 'name';
>   $column->{value}     = 'Jon Stewart';
>   $column->{timestamp} = time;
>
>   $client->insert($row_key, $column_parent, $column, $consistency_level);
>
>   $column->{name}         = 'tv_show';
>   $column->{value}     = 'The Daily Show';
>   $client->insert($row_key, $column_parent, $column, $consistency_level);
>
>   # -- INSERT ANOTHER TV PERSONALITY ---
>
>   $row_key = 'people_code_2'; # this is analog to a primary key, you'll
> later search for this guy using this key
>
>   $column->{name} = 'name';
>   $column->{value} = 'Stephen Colbert';
>   $column->{timestamp} = time;
>
>   $client->insert($row_key, $column_parent, $column, $consistency_level);
>
>   $column->{name} = 'tv_show';
>   $column->{value} = 'The Colbert Report';
>   $client->insert($row_key, $column_parent, $column, $consistency_level);
>
>   # -- LET's QUERY THE PEOPLE COLUMN FAMILY TO FIND OUT WHO WE HAVE ON FILE
> ---
>
>   my $slice_range = new Cassandra::SliceRange();
>   $slice_range->{start} = "";
>   $slice_range->{finish} = "";
>
>   my $predicate = new Cassandra::SlicePredicate();
>   $predicate->{slice_range} = $slice_range;
>
>   # let's load user with primary key = 'people_code_1'
>   my $result = $client->get_slice('people_code_1', $column_parent,
> $predicate, $consistency_level);
>   print "'people_code_1': " . Dumper($result) . "\n";
>
>   # now, let's load user with primary key = 'people_code_2'
>   $result = $client->get_slice('people_code_2', $column_parent, $predicate,
> $consistency_level);
>   print "'people_code_2': " . Dumper($result) . "\n";
>
>   # nice, eh?
>
>   $transport->close();
> };
>
> if ($@) {
>   warn(Dumper($@));
> }
>
> 1;
>



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


Re: Clarification on intended bootstrapping semantics

2011-02-02 Thread Jonathan Ellis
On Thu, Jan 20, 2011 at 5:05 AM, Peter Schuller
 wrote:
> (1) Starting from scratch with N nodes, M of which are seed nodes (M
> <= N), no initial token and autobootstrap false, starting them all up
> with clean data directories should be supported without concern for
> start-up order.  The cluster is expected to converge. As long as no
> writes are happening, and there is no data in the cluster, there is no
> problem. There will be no "divergent histories" that prevent gossip
> from working.

Right.

> (2) Specifically, given that one wants for example 2 seeds, there is
> no requirement to join the "second" seed as a non-seed *first*, only
> to then restart with it as seed after having joined the cluster.

Right.

> (3) The critical invariant for the operator to maintain with respect
> to seed nodes, is that no node is ever listed as a seed node in other
> node's configuration, without said seed node first having joined the
> cluster.

It's more forgiving than that.  The real critical invariant is that
nodes should not have disjoint sets of seed nodes.  (Which we commonly
interpret as "keep all the seed lists the same.")

> (4) It is always fine for a seed node to consider itself a seed even
> during initial start-up and joining the ring.

Yes.

> (5) enabling auto_bootstrap does not just affect the method by which
> tokens are selected, but also affects *whether* the bootstrap process
> includes streaming data from other nodes prior to becoming up in the
> ring (i.e., whether StorageService.bootstrap() is going to be called
> in initServer())

Right, in fact, the second part is the primary effect since usually
you should specify initial_token when adding nodes.

> (6) having a node join a pre-existing cluster with data in it without
> auto_bootstrap set to true, would cause the ring to join the cluster
> but be void of data, thus potentially violating consistency guarantees
> (but recovery is possible by running repair)

Right.

> (7) A consequence of (5)+(6) is that auto_bootstrap should *always* be
> enabled on all nodes in a production cluster, except:
> (7a) New nodes being brought in as seeds

No, this will break things as in (6).  The right way to add new seeds
is to first add it as a non-seed, then update config files to add it
to seed list later.

> (7b) During the very first initial cluster setup with no data

Yes.

> (7) The above is intended and on purpose, and it would be correct to
> operate under these assumptions when updating/improving documentation.

Yes. :)

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


RE: [VOTE] 0.7.1 (attempt #2)

2011-02-02 Thread Jeremiah Jordan
So are 0.6.10 and 0.6.11 broken too or did only the 0.7.0 version of
https://issues.apache.org/jira/browse/CASSANDRA-1959 break stuff?

-Original Message-
From: Stu Hood [mailto:stuh...@gmail.com] 
Sent: Tuesday, February 01, 2011 7:19 PM
To: dev@cassandra.apache.org
Subject: Re: [VOTE] 0.7.1 (attempt #2)

-1
Kelvin was kind enough to confirm that ALL is broken in this release and
trunk. See https://issues.apache.org/jira/browse/CASSANDRA-2094

On Sun, Jan 30, 2011 at 5:24 PM, Stu Hood  wrote:

> -0
> Upgrading from 0.7.0 to these artifacts was fine, but the write ONE
read
> ALL distributed test times out in an unexpected location, with no
error
> messages on the server. The test looks valid, but is also failing in
> 0.8/trunk.
>
> I'll try and bisect it tomorrow from CASSANDRA-1964 (which passed
> consistently) to the breakage.
>
>
> On Sun, Jan 30, 2011 at 1:14 AM, Stephen Connolly <
> stephen.alan.conno...@gmail.com> wrote:
>
>> I'm getting
>>
>> Bad Gateway
>>
>> The proxy server received an invalid response from an upstream
server.
>>
>> From repository.apache.org.
>>
>> So the Maven central artifacts will probably be staged tomorrow AM
(as
>> my wife will kill me if I "waste" Sunday working on this! and she'd
be
>> right too!) ;-)
>>
>> -Stephen
>>
>> On 28 January 2011 20:34, Stephen Connolly
>>  wrote:
>> > I'll drop and restage the artifacts for maven central when I get a
>> chance
>> >
>> > - Stephen
>> >
>> > ---
>> > Sent from my Android phone, so random spelling mistakes, random
nonsense
>> > words and other nonsense are a direct result of using swype to type
on
>> the
>> > screen
>> >
>> > On 28 Jan 2011 20:30, "Eric Evans"  wrote:
>> >>
>> >> CASSANDRA-2058[1] has landed in 0.7, so let's give this another
shot. I
>> >> propose the following for release as 0.7.1.
>> >>
>> >> SVN:
>> >>
>>
https://svn.apache.org/repos/asf/cassandra/branches/cassandra-0.7@r10648
45
>> >> 0.7.1 artifacts: http://people.apache.org/~eevans
>> >>
>> >> The vote will be open for 72 hours.
>> >>
>> >>
>> >> [1]: https://issues.apache.org/jira/browse/CASSANDRA-2058
>> >> [2]: http://goo.gl/5Tafg (CHANGES.txt)
>> >> [3]: http://goo.gl/PkreZ (NEWS.txt)
>> >>
>> >> --
>> >> Eric Evans
>> >> eev...@rackspace.com
>> >>
>> >>
>> >>
>> >
>>
>
>


Re: [VOTE] 0.7.1 (attempt #2)

2011-02-02 Thread Jonathan Ellis
2094 does not affect 0.6 (but 2081, which only affects range_slices,
is present in 0.6)

On Wed, Feb 2, 2011 at 3:11 PM, Jeremiah Jordan
 wrote:
> So are 0.6.10 and 0.6.11 broken too or did only the 0.7.0 version of
> https://issues.apache.org/jira/browse/CASSANDRA-1959 break stuff?
>
> -Original Message-
> From: Stu Hood [mailto:stuh...@gmail.com]
> Sent: Tuesday, February 01, 2011 7:19 PM
> To: dev@cassandra.apache.org
> Subject: Re: [VOTE] 0.7.1 (attempt #2)
>
> -1
> Kelvin was kind enough to confirm that ALL is broken in this release and
> trunk. See https://issues.apache.org/jira/browse/CASSANDRA-2094
>
> On Sun, Jan 30, 2011 at 5:24 PM, Stu Hood  wrote:
>
>> -0
>> Upgrading from 0.7.0 to these artifacts was fine, but the write ONE
> read
>> ALL distributed test times out in an unexpected location, with no
> error
>> messages on the server. The test looks valid, but is also failing in
>> 0.8/trunk.
>>
>> I'll try and bisect it tomorrow from CASSANDRA-1964 (which passed
>> consistently) to the breakage.
>>
>>
>> On Sun, Jan 30, 2011 at 1:14 AM, Stephen Connolly <
>> stephen.alan.conno...@gmail.com> wrote:
>>
>>> I'm getting
>>>
>>> Bad Gateway
>>>
>>> The proxy server received an invalid response from an upstream
> server.
>>>
>>> From repository.apache.org.
>>>
>>> So the Maven central artifacts will probably be staged tomorrow AM
> (as
>>> my wife will kill me if I "waste" Sunday working on this! and she'd
> be
>>> right too!) ;-)
>>>
>>> -Stephen
>>>
>>> On 28 January 2011 20:34, Stephen Connolly
>>>  wrote:
>>> > I'll drop and restage the artifacts for maven central when I get a
>>> chance
>>> >
>>> > - Stephen
>>> >
>>> > ---
>>> > Sent from my Android phone, so random spelling mistakes, random
> nonsense
>>> > words and other nonsense are a direct result of using swype to type
> on
>>> the
>>> > screen
>>> >
>>> > On 28 Jan 2011 20:30, "Eric Evans"  wrote:
>>> >>
>>> >> CASSANDRA-2058[1] has landed in 0.7, so let's give this another
> shot. I
>>> >> propose the following for release as 0.7.1.
>>> >>
>>> >> SVN:
>>> >>
>>>
> https://svn.apache.org/repos/asf/cassandra/branches/cassandra-0.7@r10648
> 45
>>> >> 0.7.1 artifacts: http://people.apache.org/~eevans
>>> >>
>>> >> The vote will be open for 72 hours.
>>> >>
>>> >>
>>> >> [1]: https://issues.apache.org/jira/browse/CASSANDRA-2058
>>> >> [2]: http://goo.gl/5Tafg (CHANGES.txt)
>>> >> [3]: http://goo.gl/PkreZ (NEWS.txt)
>>> >>
>>> >> --
>>> >> Eric Evans
>>> >> eev...@rackspace.com
>>> >>
>>> >>
>>> >>
>>> >
>>>
>>
>>
>



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