public function toArray($useIdentifierKeys = null)
    {
        $originalUseIdentifierKeys = $this->useIdentifierKeys;
        $useIdentifierKeys = isset($useIdentifierKeys) ? (boolean) $useIdentifierKeys : $this->useIdentifierKeys;
        $cursor = $this;

        /* Let iterator_to_array() decide to use keys or not. This will avoid
         * superfluous RiakCursor::info() from the key() method until the
         * cursor position is tracked internally.
         */
        $this->useIdentifierKeys = true;

        $results = $this->retry(function() use ($cursor, $useIdentifierKeys) {
            return iterator_to_array($cursor, $useIdentifierKeys);
        }, true);

        $this->useIdentifierKeys = $originalUseIdentifierKeys;

        return $results;
    }