org.springframework.data.keyvalue.riak.groovy
Class RiakBuilder
java.lang.Object
groovy.lang.GroovyObjectSupport
groovy.util.BuilderSupport
org.springframework.data.keyvalue.riak.groovy.RiakBuilder
- All Implemented Interfaces:
- groovy.lang.GroovyObject
public class RiakBuilder
- extends groovy.util.BuilderSupport
A Groovy Builder that implements a powerful and syntactically succinct DSL for Riak datastore
access using SDKV for Riak's AsyncRiakTemplate
.
The DSL responds to most of the important methods from the AsyncRiakTemplate
:
- set
- setAsBytes
- put
- get
- getAsBytes
- getAsType
- containsKey
- delete
- foreach
An example of DSL usage (to delete all entries in a bucket):
riak.foreach(bucket: "test") {
completed { v, meta ->
delete(bucket: "test", key: meta.key)
}
}
- Author:
- J. Brisbin
Methods inherited from class groovy.util.BuilderSupport |
doInvokeMethod, getCurrent, getName, invokeMethod, setClosureDelegate, setCurrent |
Methods inherited from class groovy.lang.GroovyObjectSupport |
getMetaClass, getProperty, setMetaClass, setProperty |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected final org.apache.commons.logging.Log log
riak
protected AsyncRiakTemplate riak
workerPool
protected ExecutorService workerPool
defaultBucketName
protected String defaultBucketName
results
protected List<Object> results
RiakBuilder
public RiakBuilder()
RiakBuilder
public RiakBuilder(AsyncRiakTemplate riak)
RiakBuilder
public RiakBuilder(AsyncRiakTemplate riak,
ExecutorService workerPool)
RiakBuilder
public RiakBuilder(groovy.util.BuilderSupport proxyBuilder,
AsyncRiakTemplate riak)
RiakBuilder
public RiakBuilder(groovy.lang.Closure nameMappingClosure,
groovy.util.BuilderSupport proxyBuilder,
AsyncRiakTemplate riak)
getAsyncTemplate
public AsyncRiakTemplate getAsyncTemplate()
setAsyncTemplate
public void setAsyncTemplate(AsyncRiakTemplate riak)
getWorkerPool
public ExecutorService getWorkerPool()
setWorkerPool
public void setWorkerPool(ExecutorService workerPool)
setParent
protected void setParent(Object parent,
Object child)
- Specified by:
setParent
in class groovy.util.BuilderSupport
createNode
protected Object createNode(Object name)
- Specified by:
createNode
in class groovy.util.BuilderSupport
createNode
protected Object createNode(Object name,
Object value)
- Specified by:
createNode
in class groovy.util.BuilderSupport
createNode
protected Object createNode(Object name,
Map attributes)
- Specified by:
createNode
in class groovy.util.BuilderSupport
createNode
protected Object createNode(Object name,
Map attributes,
Object value)
- Specified by:
createNode
in class groovy.util.BuilderSupport
invokeMethod
public Object invokeMethod(String methodName,
Object arg)
- Specified by:
invokeMethod
in interface groovy.lang.GroovyObject
- Overrides:
invokeMethod
in class groovy.util.BuilderSupport
nodeCompleted
protected void nodeCompleted(Object parent,
Object node)
- Overrides:
nodeCompleted
in class groovy.util.BuilderSupport
postNodeCompletion
protected Object postNodeCompletion(Object parent,
Object node)
- Overrides:
postNodeCompletion
in class groovy.util.BuilderSupport
createMapReduceJob
protected RiakMapReduceOperation createMapReduceJob()
Copyright © 2010-2011 SpringSource. All Rights Reserved.