-
-
Save asonge/9dc39b4784618e0dc826 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getKeys() { | |
$params = array('props'=>'false','keys'=>'true'); | |
$url = RiakUtils::buildRestPath($this->client, $this, NULL, NULL, $params); | |
$response = RiakUtils::httpRequest('GET', $url); | |
# Use a RiakObject to interpret the response, we are just interested in the value. | |
$obj = new RiakObject($this->client, $this, NULL); | |
$obj->populate($response, array(200)); | |
if (!$obj->exists()) { | |
throw Exception("Error getting bucket properties."); | |
} | |
$keys = $obj->getData(); | |
return array_map("urldecode",$keys["keys"]); | |
} |
Which is why it's not recommended...though I'm just using it on an admin panel until i start building indexes.
Just ran a map/reduce (no indexing) and it took even longer
$client->add($bucket->name)
->map("function(v){return [v.key];}")
->run();
---
645ms
620ms
621ms
626ms
623ms
628ms
627ms
622ms
625ms
628ms
---
Total: 6267ms
Average: 627ms
Not familiar with indexing in Riak.
I'd be interested to see how you do it.
I'm usually found idling in #riak
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This method sure is expensive.
keys=true and keys=stream are about the same.