Core::connect - is $connectionID actually useful to anyone?

4 views
Skip to first unread message

mjpearson

unread,
Apr 6, 2010, 5:41:57 AM4/6/10
to pandra-dev
I'm not really happy with specifying a connection id as well as a
hostname, is anyone using it?

To have it play a little more happily with token map autodiscover,
this should really be dropped and just generate a host/port hash
internally where explicit connections have been defined. I'm not sure
developers will really want to micromanage the connection handler -
just pass it a host/port (and possibly a ring token) and start work.

Changing this would obviously break most current implementations :S
but ideally the connect method changes from :

static public function connect($connectionID, $host, $poolName =
self::DEFAULT_POOL_NAME, $port = THRIFT_PORT_DEFAULT);

to :

static public function connect($host, $port = THRIFT_PORT_DEFAULT,
$poolName = self::DEFAULT_POOL_NAME);

a painful change now, but more convenient down the track.

mjpearson

unread,
Apr 15, 2010, 2:20:55 AM4/15/10
to pandra-dev
Quick note that node auto discovery has been rolled out, with
connection id's now correlating to the cassandra tokens..

PandraCore::auto('localhost');

The tokens for a cluster with connection(s) established can be
extracted with :

PandraCore::getPoolTokens();

much easier :)

vineet daniel

unread,
Apr 15, 2010, 2:25:08 AM4/15/10
to pandr...@googlegroups.com

Hi

Can you please provide a working example of get_range_slice function in Pandra. What all parameters mean and do. Because I could not find documentaion for your library.

Regards
Vineet Daniel



--
To unsubscribe, reply using "remove me" as the subject.

mjpearson

unread,
Apr 15, 2010, 2:39:07 AM4/15/10
to pandra-dev
Hi,

This is in core as getRangeKeys :

/**
* @param string $keySpace keyspace of key
* @param array $keyRange associative array of keys indexed by
'start' and 'finish'
* @param cassandra_ColumnParent $columnParent
* @param cassandra_SlicePredicate $predicate column names or
range predicate
* @param int number of rows to return
* @param int $consistencyLevel response consistency level
* @return <type>
*/
static public function getRangeKeys($keySpace,
array $keyRange,
cassandra_ColumnParent $columnParent,
cassandra_SlicePredicate $predicate,
$numRows = DEFAULT_ROW_LIMIT,
$consistencyLevel = NULL);

Has been deprecated in Cassandra 0.6, so pandra 0.2 will need array
$keyRange swapped out with a cassandra_KeyRange object instead.
getRangeKeys will work in the meantime though.

.michael.

On Apr 15, 4:25 pm, vineet daniel <vineetdan...@gmail.com> wrote:
> Hi
>
> Can you please provide a working example of get_range_slice function in
> Pandra. What all parameters mean and do. Because I could not find
> documentaion for your library.
>
> Regards
> Vineet Daniel
>

Ian Rogers

unread,
Sep 22, 2010, 1:00:36 PM9/22/10
to mjpearson, pandr...@googlegroups.com

IMHO I think you're right in that using the connection id's is
exposing far too much of the internal workings of pandra/cassandra -
user apps will only know about host names...

Bet then I'd also like the following:

1. drop the seperate port parameter and instead allow more fully/
standard specified hostnames e.g. 'my.example.com:9001'. This would
open up the way for the future when there's encrypted connections
specified as e.g. 'ssl://my.example.com:9001

2. now that Cassandra is data-center aware - add a
setPreferedHosts(<mixed>) method. getClient() would then choose from
this list (if possible) so apps can specify cassandra nodes in the
same rack/whatever as themselves.

Cheers,

Ian

Reply all
Reply to author
Forward
0 new messages