Skip to content

Instantly share code, notes, and snippets.

@asonge
Created February 12, 2011 19:11
Show Gist options
  • Save asonge/9dc39b4784618e0dc826 to your computer and use it in GitHub Desktop.
Save asonge/9dc39b4784618e0dc826 to your computer and use it in GitHub Desktop.
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"]);
}
@kevburnsjr
Copy link

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