Switch branches/tags
vector-clock-fixes v1.4.0 release-1.10.26-cutoff release-1.10.25-cutoff release-1.10.24-cutoff release-1.10.23-cutoff release-1.10.22-cutoff release-1.10.21-cutoff release-1.10.20-cutoff release- release-1.10.19-cutoff release-1.10.18-cutoff release-1.10.17-cutoff release-1.10.16-cutoff release-1.10.15-cutoff release-1.10.14-cutoff release-1.10.13-cutoff release-1.10.12-cutoff release-1.10.11-cutoff release-1.10.10-cutoff release-1.10.9-cutoff release-1.10.8-cutoff release-1.10.7-cutoff release-1.10.6-cutoff release-1.10.5-cutoff release-1.10.4-cutoff release-1.10.3-cutoff release-1.10.2-cutoff release-1.10.1-cutoff release-1.10.0-cutoff release-1.9.22-cutoff release-1.9.21-cutoff release-1.9.20-cutoff release-1.9.19-cutoff release-1.9.18-cutoff release-1.9.17-cutoff release-1.9.16-cutoff release-1.9.15-cutoff release-1.9.14-cutoff release-1.9.13-cutoff release-1.9.12-cutoff release-1.9.11-cutoff release-1.9.10-cutoff release-1.9.9-cutoff release-1.9.8-cutoff release-1.9.7-cutoff release-1.9.6-cutoff release-1.9.5-cutoff release-1.9.4-cutoff release-1.9.3-cutoff release-1.9.2-cutoff release-1.9.1-cutoff release-1.9.0-cutoff release-1.8.16-cutoff release-1.8.15-cutoff release-1.8.14-cutoff release-1.8.13-cutoff release-1.8.12-cutoff release-1.8.11-cutoff release-1.8.10-cutoff release-1.8.9-cutoff release-1.8.8-cutoff release-1.8.5-cutoff release-1.8.4-cutoff release-1.8.3-cutoff release-1.8.1-cutoff release-1.7.3-cutoff release-1.7.2-cutoff release-1.7.1-cutoff release-1.7.0-cutoff release-1.6.8-cutoff release-1.6.6-cutoff release-1.6.4 release-1.6.4-cutoff release-1.6.3-cutoff release-1.6.2-cutoff release-1.6.1-cutoff release-1.6.0-cutoff release-1.5.9-cutoff release-1.5.8-cutoff release-1.5.7-cutoff release-1.5.4-cutoff release-1.5.2-cutoff release-1.5.1-cutoff release-1.3.0-cutoff before-replicatype-was-removed before-donorbased-was-removed
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
64 lines (42 sloc) 2 KB
This directory contains a pure Python implementation of a voldemort client.
It supports both raw (string) and JSON serialized stores. Only the protocol
buffer interface over TCP is supported for talking to the server. Only
server-side routing is supported.
To install the module, you will need the following dependencies:
- nose >= 0.11
- simplejson >= 2.1.1
- Google protobuf > 2.3.0
The setup process will automatically install nose and simplejson, since they
are well behaved Python packages. The protobuf module will need to be downloaded
from and installed manually.
Once the dependencies, run the test suite to sanity check things. You need to
first start up a Voldemort server locally, pointing to the config files in
tests/voldemort_config. From the root voldemort of the voldemort source tree, run:
> bin/voldemort-server clients/python/tests/voldemort_config
In a separate shell, change into the clients/python directory and run:
> python nosetests
If all tests pass, you can install the package with the command:
> python install
This may need to be run as root if you don't have permissions to install to your
local python library.
To use the client, simple import it into your program with the statement:
import voldemort
To create a client connection, instantiate a StoreClient object:
client = voldemort.StoreClient('store_name', [('node1', 6666), ('node2', 6666)])
The values of the store name and cluster nodes/ports will depend on your particular
Voldemort setup. The key and value serialization type will be determined
automatically during client initialization using the values in your cluster's
stores.xml file.
The StoreClient object implements the get(), get_all(), put(), maybe_put(),
and delete() methods. For example:
> v1 = client.put("foo", "hello")
> resp = client.get("foo")
> resp[0][0]
> client.delete("foo")
> client.get("foo")
The test suite contains many other usage examples.