mjpearson / Pandra

Cassandra abstraction layer and keyspace scaffolder for PHP developers --- ABANDONED.
GNU Lesser General Public License v3.0
93 stars 11 forks source link

PandraCore::getRangeKey - Key range is overlapping keys #49

Open loretoparisi opened 13 years ago

loretoparisi commented 13 years ago

I'm using the key slice in this way on a Super Column Family:

 $res=PandraCore::getRangeKeys(
        'myNS',
        array('start'=>$start,'finish'=>''),
        new cassandra_ColumnParent(array(
            'column_family' => 'mySCF',
        )),
    new PandraSlicePredicate(
        PandraSlicePredicate::TYPE_RANGE,
        array('start' => '',
            'finish' => '',
            'count' => $limit,
            'reversed' => true)),
            $limit
        );

This is the only way using parameters $start and $limit to achieve a sortain of key range, sliciing from $start=0 to $start=$limit

But something is wrong, because I'm having back same keys during iterations:

Event: block:1 start:50 size:24 count:24 memory: 6.22 M

Following keys will be repeated in the next loop:

And the repeating keys block: Event: block:0 start:26 size:20 count:44 memory: 6.22 M

Since the block total size should be 50, from the second block (I'm reading from the last one), starting from 26: Event: block:0 start:26 size:20 count:44 memory: 6.22 M

I should have a new key range. What's happening is that key ranges are overlapping in some way.

Any idea?