seomoz/askari — pull request #51 by phs (2013-10-09 20:15:21+00:00)
Title: Phs/mk 99 relation client

This introduces two classes, `Relation` and a helper named `Cell`.

`Cell`s wrap QualifierSchemas and offer encoding/decoding operations.

`Relation` wraps a built-in HBase client (`HTable`) and offers typed
crud operations for rows within a specific relation.

Since we didn't want to make proxy objects for all the various bits of
their client API, we just allow users to create, modify, then invoke
"operation" objects such as `Get` and `Put`. The wrapping methods
deal with encoding/decoding ruby objects to binary form.

In truth clients could exploit the exposed encoding methods and never
use `Relation` to produce such operations. On the other end, common
methods on operations such as including families, qualifiers or
values are exposed off of `Cell` as "double-dispatch" methods. These
merely accept an operation, perform some codec & delegate to the
operation.

We currently support put, get, scan, check_and_put and
check_and_delete.

Other notable changes:

The crud helper contract changed slightly, to allow fixtures to see and use `let` definitions.

`NamedType` no longer forgives naked values: it will only encode things that are in a hash and have the right key.