Permalink
Browse files

support for default r/w/dw values

  • Loading branch information...
1 parent 0068b95 commit 8d16095358a01812d386b3d5d6d58b47d99c8c0b @argv0 argv0 committed Jun 20, 2010
Showing with 33 additions and 9 deletions.
  1. +24 −0 riak/bucket.py
  2. +8 −8 riak/client.py
  3. +1 −1 setup.py
View
24 riak/bucket.py
@@ -236,6 +236,30 @@ def get_n_val(self):
"""
return self.get_property('n_val')
+ def set_default_r_val(self, rval):
+ return self.set_property('r', rval)
+
+ def get_default_r_val(self):
+ return self.get_property('r')
+
+ def set_default_w_val(self, wval):
+ return self.set_property('w', wval)
+
+ def get_default_w_val(self):
+ return self.get_property('w')
+
+ def set_default_dw_val(self, dwval):
+ return self.set_property('dw', dwval)
+
+ def get_default_dw_val(self):
+ return self.get_property('dw')
+
+ def set_default_rw_val(self, rwval):
+ return self.set_property('rw', rwval)
+
+ def get_default_rw_val(self):
+ return self.get_property('rw')
+
def set_allow_multiples(self, bool):
"""
If set to True, then writes with conflicting data will be stored
View
16 riak/client.py
@@ -52,10 +52,10 @@ def __init__(self, host='127.0.0.1', port=8098, prefix='riak',
client_id)
else:
self._transport = transport_class(host, port, client_id=client_id)
- self._r = 2
- self._w = 2
- self._dw = 0
- self._rw = 2
+ self._r = "default"
+ self._w = "default"
+ self._dw = "default"
+ self._rw = "default"
self._encoders = {'application/json':json.dumps,
'text/json':json.dumps}
self._decoders = {'application/json':json.loads,
@@ -69,7 +69,7 @@ def get_transport(self):
def get_r(self):
"""
- Get the R-value setting for this RiakClient. (default 2)
+ Get the R-value setting for this RiakClient. (default "quorum")
@return integer
"""
return self._r
@@ -88,7 +88,7 @@ def set_r(self, r):
def get_w(self):
"""
- Get the W-value setting for this RiakClient. (default 2)
+ Get the W-value setting for this RiakClient. (default "quorum")
@return integer
"""
return self._w
@@ -105,7 +105,7 @@ def set_w(self, w):
def get_dw(self):
"""
- Get the DW-value for this ClientOBject. (default 2)
+ Get the DW-value for this ClientOBject. (default "quorum")
@return integer
"""
return self._dw
@@ -122,7 +122,7 @@ def set_dw(self, dw):
def get_rw(self):
"""
- Get the RW-value for this ClientObject. (default 2)
+ Get the RW-value for this ClientObject. (default "quorum")
@return integer
"""
return self._rw
View
2 setup.py
@@ -18,7 +18,7 @@ def make_pb():
if __name__ == "__main__":
setup(
name='riak',
- version='1.0.1',
+ version='1.1.0',
packages = find_packages(),
install_requires = ['protobuf>=2.3.0'],
dependency_links = ["http://downloads.basho.com/support"],

0 comments on commit 8d16095

Please sign in to comment.