| Copyright | (c) 2011 MailRank, Inc. |
|---|---|
| License | Apache |
| Maintainer | Mark Hibberd <mark@hibberd.id.au>, Nathan Hunter <nhunter@janrain.com> |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell98 |
Network.Riak.Types
Contents
Description
Basic types.
- type ClientID = ByteString
- data Client = Client {}
- data Connection
- data RiakException
- type Bucket = ByteString
- type Key = ByteString
- type Tag = ByteString
- newtype VClock = VClock {}
- data Job
- data Quorum
- type RW = Quorum
- type R = Quorum
- type W = Quorum
- type DW = Quorum
- class (Tagged msg, ReflectDescriptor msg, Show msg, Wire msg) => Request msg
- class (Tagged msg, ReflectDescriptor msg, Show msg, Wire msg) => Response msg
- class (Request req, Response resp) => Exchange req resp | req -> resp, resp -> req
- data MessageTag
- = ErrorResponse
- | PingRequest
- | PingResponse
- | GetClientIDRequest
- | GetClientIDResponse
- | SetClientIDRequest
- | SetClientIDResponse
- | GetServerInfoRequest
- | GetServerInfoResponse
- | GetRequest
- | GetResponse
- | PutRequest
- | PutResponse
- | DeleteRequest
- | DeleteResponse
- | ListBucketsRequest
- | ListBucketsResponse
- | ListKeysRequest
- | ListKeysResponse
- | GetBucketRequest
- | GetBucketResponse
- | SetBucketRequest
- | SetBucketResponse
- | MapReduceRequest
- | MapReduceResponse
- | IndexRequest
- | IndexResponse
- class Tagged msg where
- messageTag :: msg -> MessageTag
- data IndexValue
- = IndexInt !Index !Int
- | IndexBin !Index !ByteString
- data IndexQuery
- = IndexQueryExactInt !Index !Int
- | IndexQueryExactBin !Index !ByteString
- | IndexQueryRangeInt !Index !Int !Int
- | IndexQueryRangeBin !Index !ByteString !ByteString
Client management
type ClientID = ByteString Source
A client identifier. This is used by the Riak cluster when logging vector clock changes, and should be unique for each client.
Constructors
| Client | |
Connection management
Errors
data RiakException Source
The main Riak exception type.
Data types
type Bucket = ByteString Source
A Bucket is a container and keyspace for data stored in Riak, with a set of common properties for its contents (the number of replicas, for instance).
type Key = ByteString Source
Keys are unique object identifiers in Riak and are scoped within buckets.
type Tag = ByteString Source
An application-specific identifier for a link. See http://wiki.basho.com/Links.html for details.
A wrapper that keeps Riak vector clocks opaque.
Constructors
| VClock | |
Fields
| |
A specification of a MapReduce job. http://wiki.basho.com/MapReduce.html.
Constructors
| JSON ByteString | |
| Erlang ByteString |
Quorum management
A read/write quorum. The quantity of replicas that must respond
to a read or write request before it is considered successful. This
is defined as a bucket property or as one of the relevant
parameters to a single request (R,W,DW,RW).
Read/write quorum. How many replicas need to collaborate when deleting a value.
Write quorum. How many replicas to write to before returning a successful response.
Durable write quorum. How many replicas to commit to durable storage before returning a successful response.
Message identification
class (Tagged msg, ReflectDescriptor msg, Show msg, Wire msg) => Request msg Source
A message representing a request from client to server.
Minimal complete definition
expectedResponse
Instances
class (Tagged msg, ReflectDescriptor msg, Show msg, Wire msg) => Response msg Source
A message representing a response from server to client.
class (Request req, Response resp) => Exchange req resp | req -> resp, resp -> req Source
Instances
| Exchange GetClientIDRequest GetClientIDResponse | |
| Exchange GetServerInfoRequest ServerInfo | |
| Exchange ListBucketsRequest ListBucketsResponse | |
| Exchange MapReduceRequest MapReduce | |
| Exchange GetBucketRequest GetBucketResponse | |
| Exchange GetRequest GetResponse | |
| Exchange IndexRequest IndexResponse | |
| Exchange PutRequest PutResponse |
data MessageTag Source
An identifier for an inbound or outbound message.
Constructors
Instances
Messages are tagged.
Instances
| Tagged MessageTag | |
| Tagged GetClientIDRequest | |
| Tagged GetServerInfoRequest | |
| Tagged ListBucketsRequest | |
| Tagged MapReduceRequest | |
| Tagged PingRequest | |
| Tagged DeleteRequest | |
| Tagged GetBucketRequest | |
| Tagged GetRequest | |
| Tagged IndexRequest | |
| Tagged ListKeysRequest | |
| Tagged PutRequest | |
| Tagged SetBucketRequest | |
| Tagged GetBucketResponse | |
| Tagged GetClientIDResponse | |
| Tagged GetResponse | |
| Tagged ListBucketsResponse | |
| Tagged PutResponse | |
| Tagged ErrorResponse | |
| Tagged IndexResponse | |
| Tagged ListKeysResponse | |
| Tagged MapReduce | |
| Tagged ServerInfo | |
| Tagged SetClientIDRequest | |
| (Tagged a, Tagged b) => Tagged (Either a b) |
data IndexQuery Source
Index query. Can be exact or range, int or bin. Index name should not contain the "_bin" or "_int" part, since it's determined from data constructor.
Constructors
| IndexQueryExactInt !Index !Int | |
| IndexQueryExactBin !Index !ByteString | |
| IndexQueryRangeInt !Index !Int !Int | |
| IndexQueryRangeBin !Index !ByteString !ByteString |
Instances