Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: 3.7.0

Fetching latest commit…

Cannot retrieve the latest commit at this time

..
Failed to load latest commit information.
spec/hyperion
src/hyperion
README.md
project.clj

README.md

hyperion.riak

A Hyperion implementation for Riak

About

  1. Records are stored as JSON in buckets that correspond to their :kind.
  2. Buckets are namespaced with the value of app as a prefix to the bucket name. ie. Given that app is bound to the value \"my_app_\", a record of kind \"widget\" will be stored in the \"my_app_widget\" bucket.
  3. All buckets are implicitly created with default options. Siblings should not occur.
  4. All fields of each record are indexed to optimize searching.
  5. all "-by-kind" queries execute a MapReduce query which will handle all filtering, sorting, limiting, and offseting. According to the Riak documentation, MapReduce queries should not be performed across an entire bucket (a.k.a kind). In order to avoid this, you should use one of the folling optimized filters when performing a "-by-kind" query.

    • one :=. This is optimized to execute an equals query on the secondary index.
    • :< and :> together. This is optimized to execute a range query on the secondary index.
    • one :>=. This is optimized to execute a range query on the secondary index.
    • one :<=. This is optimized to execute a range query on the secondary index.

    All other operations on the "-by-kind" queries should be avoided. They will perform poorly and place a large demand on your cluster.

Usage

Opening a Riak client

(new-riak-datastore [options])

i.e.

(new-riak-datastore :api :pbc)

Options:

  • :api - [:pbc :http] *required

HTTP Options:

  • :host
  • :port
  • :http-client
  • :mapreduce-path
  • :max-connections
  • :retry-handler
  • :riak-path
  • :scheme
  • :timeout
  • :url

    See the HTTPClientConfig for more info.

PBC Options:

  • :host
  • :port
  • :connection-timeout-millis
  • :idle-connection-ttl-millis
  • :initial-pool-size
  • :pool-size
  • :socket-buffer-size-kb

    See the PBClientConfig for more info.

Riak Configuration

Riak's configuration is located at (when installed using homebrew): /usr/local/Cellar/riak/1.1.4-x86_64/libexec/etc/app.config Hyperion Riak requires LeveDB persistence. Change the config file storage portion like so:

%% Storage_backend specifies the Erlang module defining the storage
%% mechanism that will be used on this node.
%% {storage_backend, riak_kv_bitcask_backend},
{storage_backend, riak_kv_eleveldb_backend},

Development

Configuration

The specs require that riak's delete_mode is immediate. Add the following to the riak_kv section of config.

{delete_mode, immediate}

For more info: http://lists.basho.com/pipermail/riak-users_lists.basho.com/2011-October/006048.html

Types

Natively Supported

  • java.lang.Boolean
  • java.lang.String

Supported by Packer/Unpacker

  • java.lang.Byte
  • java.lang.Integer
  • java.lang.Long
  • java.lang.BigInteger
  • java.lang.Float
  • java.lang.Double
  • java.lang.Character
  • clojure.lang.Keyword

License

Copyright © 2012 8th Light, Inc.

Distributed under the Eclipse Public License, the same as Clojure.

Something went wrong with that request. Please try again.