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.
PandraCore::auto('localhost');
The tokens for a cluster with connection(s) established can be
extracted with :
PandraCore::getPoolTokens();
much easier :)
--
To unsubscribe, reply using "remove me" as the subject.
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
>
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