From 3dfb76535e36a90247aafb9d2816e29db966b64d Mon Sep 17 00:00:00 2001 From: "J. Brisbin" Date: Tue, 14 Dec 2010 14:53:33 -0600 Subject: [PATCH] Tweaking reference docs for Riak support. --- src/docbkx/reference/riak.xml | 80 ++++++++++++++++++++--------------- 1 file changed, 45 insertions(+), 35 deletions(-) diff --git a/src/docbkx/reference/riak.xml b/src/docbkx/reference/riak.xml index f5d0b4fc3..15edc0c1e 100644 --- a/src/docbkx/reference/riak.xml +++ b/src/docbkx/reference/riak.xml @@ -38,9 +38,12 @@ ]]> - There are a couple additional properties on the RiakTemplate that can be changed from their defaults. If you want to specify your own ConversionService to use when converting objects for storage inside Riak, then set it on the "conversionService" property: +
+ Advanced Template Configuration + + There are a couple additional properties on the RiakTemplate that can be changed from their defaults. If you want to specify your own ConversionService to use when converting objects for storage inside Riak, then set it on the "conversionService" property: - + ]]> - + - Depending on the application, it might be useful to set default Quality-of-Service parameters. In Riak paralance, these are the "dw", "w", and "r" parameters. They can be set to an integer representing the number of vnodes that need to report having received the data before declaring the operation a success, or the string "one", "all", or (the default) "quorum". These values can be overridden by passing a different set of QosParameters to the set/get operation you're performing. + Depending on the application, it might be useful to set default Quality-of-Service parameters. In Riak paralance, these are the "dw", "w", and "r" parameters. They can be set to an integer representing the number of vnodes that need to report having received the data before declaring the operation a success, or the string "one", "all", or (the default) "quorum". These values can be overridden by passing a different set of QosParameters to the set/get operation you're performing. - + ]]> - + - It might also be necessary to replace the default ExecutorService (by default a cached ThreadPoolExecutor) with an executor you've explicitly configured. Set your ExecutorService on the template's "executorService" property. + It might also be necessary to replace the default ExecutorService (by default a cached ThreadPoolExecutor) with an executor you've explicitly configured. Set your ExecutorService on the template's "executorService" property. - +
@@ -86,8 +89,11 @@ One of the primary goals of the SDKV project is to make accessing Key/Value stores easier for the developer by taking away the mundane tasks of basic IO, buffering, type conversion, exception handling, and sundry other logistical concerns so the developer can focus on creating great applications. SDKV for Riak works toward this goal by making basic persistence and data access as easy as using a Map. - To store data in Riak, use one of the six different set methods: - + Saving data into Riak + + To store data in Riak, use one of the six different set methods: + - + ]]> + - Additionally, there is a setWithMetaData method that takes a Map of metadata that will be set as the outgoing HTTP headers. To set custom metadata, your key should be prefixed with X-Riak-Meta- e.g. X-Riak-Meta-Custom-Header. + Additionally, there is a setWithMetaData method that takes a Map of metadata that will be set as the outgoing HTTP headers. To set custom metadata, your key should be prefixed with X-Riak-Meta- e.g. X-Riak-Meta-Custom-Header. +
- Retrieving data from Riak is just as easy. There are actually 13 different get methods on RiakTemplate that give the developer a wide range options for accessing and converting your data. +
+ Retrieving data from Riak - Assuming you've stored a POJO using an appropriate set method, you can retrieve that object from Riak using a get: - Retrieving data from Riak is just as easy. There are actually 13 different get methods on RiakTemplate that give the developer a wide range options for accessing and converting your data. + + Assuming you've stored a POJO using an appropriate set method, you can retrieve that object from Riak using a get: + - + // If your entry is Content-Type: application/octet-stream, + // you can access the raw bytes. + byte[] b = riak.getAsBytes(bucket, key); // No conversion at all + } + } + ]]> + +