Merge branch 'master' of github.com:SpringSource/spring-data-keyvalue
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.riak;
|
||||
package org.springframework.data.keyvalue.riak;
|
||||
|
||||
import org.springframework.dao.DataAccessResourceFailureException;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.riak;
|
||||
package org.springframework.data.keyvalue.riak;
|
||||
|
||||
import org.springframework.dao.DataAccessException;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.riak.convert;
|
||||
package org.springframework.data.keyvalue.riak.convert;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.riak.core;
|
||||
package org.springframework.data.keyvalue.riak.core;
|
||||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.util.Assert;
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.data.riak.core;
|
||||
package org.springframework.data.keyvalue.riak.core;
|
||||
|
||||
/**
|
||||
* A generic interface for representing composite keys in data stores that use a
|
||||
@@ -1,8 +1,8 @@
|
||||
package org.springframework.data.riak.core;
|
||||
package org.springframework.data.keyvalue.riak.core;
|
||||
|
||||
/**
|
||||
* A generic interface to a resolver to turn a single object into a {@link
|
||||
* org.springframework.data.riak.core.BucketKeyPair}.
|
||||
* org.springframework.data.keyvalue.riak.core.BucketKeyPair}.
|
||||
*
|
||||
* @author J. Brisbin <jon@jbrisbin.com>
|
||||
*/
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.data.riak.core;
|
||||
package org.springframework.data.keyvalue.riak.core;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.riak.core;
|
||||
package org.springframework.data.keyvalue.riak.core;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -36,7 +36,7 @@ public interface KeyValueStoreOperations {
|
||||
<K, V> KeyValueStoreOperations set(K key, V value);
|
||||
|
||||
/**
|
||||
* Variation on set() that allows the user to specify {@link org.springframework.data.riak.core.QosParameters}.
|
||||
* Variation on set() that allows the user to specify {@link org.springframework.data.keyvalue.riak.core.QosParameters}.
|
||||
*
|
||||
* @param key
|
||||
* @param value
|
||||
@@ -58,7 +58,7 @@ public interface KeyValueStoreOperations {
|
||||
|
||||
/**
|
||||
* Variation on setWithMetaData() that allows the user to pass {@link
|
||||
* org.springframework.data.riak.core.QosParameters}.
|
||||
* org.springframework.data.keyvalue.riak.core.QosParameters}.
|
||||
*
|
||||
* @param key
|
||||
* @param value
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.data.riak.core;
|
||||
package org.springframework.data.keyvalue.riak.core;
|
||||
|
||||
/**
|
||||
* A generic interface for dealing with values and their store metadata.
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.data.riak.core;
|
||||
package org.springframework.data.keyvalue.riak.core;
|
||||
|
||||
/**
|
||||
* Specify Quality Of Service parameters.
|
||||
@@ -1,11 +1,11 @@
|
||||
package org.springframework.data.riak.core;
|
||||
package org.springframework.data.keyvalue.riak.core;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* An implementation of {@link org.springframework.data.riak.core.KeyValueStoreMetaData}
|
||||
* An implementation of {@link org.springframework.data.keyvalue.riak.core.KeyValueStoreMetaData}
|
||||
* for Riak.
|
||||
*
|
||||
* @author J. Brisbin <jon@jbrisbin.com>
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.data.riak.core;
|
||||
package org.springframework.data.keyvalue.riak.core;
|
||||
|
||||
/**
|
||||
* A generic class for specifying Quality Of Service parameters on operations.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.riak.core;
|
||||
package org.springframework.data.keyvalue.riak.core;
|
||||
|
||||
import org.codehaus.groovy.runtime.GStringImpl;
|
||||
import org.codehaus.jackson.map.ObjectMapper;
|
||||
@@ -26,11 +26,11 @@ import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.core.convert.ConversionService;
|
||||
import org.springframework.core.convert.support.ConversionServiceFactory;
|
||||
import org.springframework.dao.DataAccessResourceFailureException;
|
||||
import org.springframework.data.riak.DataStoreOperationException;
|
||||
import org.springframework.data.riak.convert.KeyValueStoreMetaData;
|
||||
import org.springframework.data.riak.mapreduce.MapReduceJob;
|
||||
import org.springframework.data.riak.mapreduce.MapReduceOperations;
|
||||
import org.springframework.data.riak.mapreduce.RiakMapReduceJob;
|
||||
import org.springframework.data.keyvalue.riak.DataStoreOperationException;
|
||||
import org.springframework.data.keyvalue.riak.convert.KeyValueStoreMetaData;
|
||||
import org.springframework.data.keyvalue.riak.mapreduce.MapReduceJob;
|
||||
import org.springframework.data.keyvalue.riak.mapreduce.MapReduceOperations;
|
||||
import org.springframework.data.keyvalue.riak.mapreduce.RiakMapReduceJob;
|
||||
import org.springframework.http.*;
|
||||
import org.springframework.http.client.ClientHttpRequest;
|
||||
import org.springframework.http.client.ClientHttpRequestFactory;
|
||||
@@ -60,12 +60,12 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* An implementation of {@link org.springframework.data.riak.core.KeyValueStoreOperations} and
|
||||
* {@link org.springframework.data.riak.mapreduce.MapReduceOperations} for the Riak data store.
|
||||
* An implementation of {@link org.springframework.data.keyvalue.riak.core.KeyValueStoreOperations} and
|
||||
* {@link org.springframework.data.keyvalue.riak.mapreduce.MapReduceOperations} for the Riak data store.
|
||||
* <p/>
|
||||
* To use the RiakTemplate, create a singleton in your Spring application-context.xml:
|
||||
* <pre><code>
|
||||
* <bean id="riak" class="org.springframework.data.riak.core.RiakTemplate"
|
||||
* <bean id="riak" class="org.springframework.data.keyvalue.riak.core.RiakTemplate"
|
||||
* p:defaultUri="http://localhost:8098/riak/{bucket}/{key}"
|
||||
* p:mapReduceUri="http://localhost:8098/mapred"/>
|
||||
* </code></pre>
|
||||
@@ -80,10 +80,10 @@ import java.util.regex.Pattern;
|
||||
* </code></pre>
|
||||
* You're key object should be one of: <ul><li>A <code>String</code> encoding the bucket and key
|
||||
* together, separated by a colon. e.g. "mybucket:mykey"</li> <li>An implementation of
|
||||
* BucketKeyPair (like {@link org.springframework.data.riak.core.SimpleBucketKeyPair})</li>
|
||||
* BucketKeyPair (like {@link org.springframework.data.keyvalue.riak.core.SimpleBucketKeyPair})</li>
|
||||
* <li>A <code>Map</code> with both a "bucket" and a "key" specified.</li> <li>A
|
||||
* <code>String</code> of only the key name, but specifying a bucket by using the {@link
|
||||
* org.springframework.data.riak.convert.KeyValueStoreMetaData} annotation on the object you're
|
||||
* org.springframework.data.keyvalue.riak.convert.KeyValueStoreMetaData} annotation on the object you're
|
||||
* storing.</li></ul>
|
||||
*
|
||||
* @author J. Brisbin <jon@jbrisbin.com>
|
||||
@@ -94,7 +94,7 @@ public class RiakTemplate extends RestGatewaySupport implements KeyValueStoreOpe
|
||||
/**
|
||||
* Client ID used by Riak to correlate updates.
|
||||
*/
|
||||
private static final String RIAK_CLIENT_ID = "org.springframework.data.riak.core.RiakTemplate/1.0";
|
||||
private static final String RIAK_CLIENT_ID = "org.springframework.data.keyvalue.riak.core.RiakTemplate/1.0";
|
||||
/**
|
||||
* Regex used to extract host, port, and prefix from the given URI.
|
||||
*/
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.data.riak.core;
|
||||
package org.springframework.data.keyvalue.riak.core;
|
||||
|
||||
/**
|
||||
* @author J. Brisbin <jon@jbrisbin.com>
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.data.riak.core;
|
||||
package org.springframework.data.keyvalue.riak.core;
|
||||
|
||||
/**
|
||||
* @author J. Brisbin <jon@jbrisbin.com>
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.data.riak.core;
|
||||
package org.springframework.data.keyvalue.riak.core;
|
||||
|
||||
import org.codehaus.groovy.runtime.GStringImpl;
|
||||
import org.springframework.util.ClassUtils;
|
||||
@@ -1,10 +1,10 @@
|
||||
package org.springframework.data.riak.mapreduce;
|
||||
package org.springframework.data.keyvalue.riak.mapreduce;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* An implementation of {@link org.springframework.data.riak.mapreduce.MapReduceOperation}
|
||||
* An implementation of {@link org.springframework.data.keyvalue.riak.mapreduce.MapReduceOperation}
|
||||
* to represent an Erlang M/R function, which must be already defined inside the
|
||||
* Riak server.
|
||||
*
|
||||
@@ -1,9 +1,9 @@
|
||||
package org.springframework.data.riak.mapreduce;
|
||||
package org.springframework.data.keyvalue.riak.mapreduce;
|
||||
|
||||
import org.springframework.data.riak.core.BucketKeyPair;
|
||||
import org.springframework.data.keyvalue.riak.core.BucketKeyPair;
|
||||
|
||||
/**
|
||||
* An implementation of {@link org.springframework.data.riak.mapreduce.MapReduceOperation}
|
||||
* An implementation of {@link org.springframework.data.keyvalue.riak.mapreduce.MapReduceOperation}
|
||||
* to describe a Javascript language M/R function.
|
||||
*
|
||||
* @author J. Brisbin <jon@jbrisbin.com>
|
||||
@@ -39,7 +39,7 @@ public class JavascriptMapReduceOperation implements MapReduceOperation {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the {@link org.springframework.data.riak.core.BucketKeyPair} to
|
||||
* Set the {@link org.springframework.data.keyvalue.riak.core.BucketKeyPair} to
|
||||
* point to for the Javascript to use in this M/R function.
|
||||
*
|
||||
* @param bucketKeyPair
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.riak.mapreduce;
|
||||
package org.springframework.data.keyvalue.riak.mapreduce;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.riak.mapreduce;
|
||||
package org.springframework.data.keyvalue.riak.mapreduce;
|
||||
|
||||
/**
|
||||
* A generic interface to a Map/Reduce operation.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.riak.mapreduce;
|
||||
package org.springframework.data.keyvalue.riak.mapreduce;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Future;
|
||||
@@ -27,7 +27,7 @@ import java.util.concurrent.Future;
|
||||
public interface MapReduceOperations {
|
||||
|
||||
/**
|
||||
* Execute a {@link org.springframework.data.riak.mapreduce.MapReduceJob}
|
||||
* Execute a {@link org.springframework.data.keyvalue.riak.mapreduce.MapReduceJob}
|
||||
* synchronously.
|
||||
*
|
||||
* @param job
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.riak.mapreduce;
|
||||
package org.springframework.data.keyvalue.riak.mapreduce;
|
||||
|
||||
/**
|
||||
* A generic interface to the phases of Map/Reduce jobs.
|
||||
@@ -14,14 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.riak.mapreduce;
|
||||
package org.springframework.data.keyvalue.riak.mapreduce;
|
||||
|
||||
import org.codehaus.jackson.JsonFactory;
|
||||
import org.codehaus.jackson.JsonGenerator;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.riak.core.BucketKeyPair;
|
||||
import org.springframework.data.riak.core.RiakTemplate;
|
||||
import org.springframework.data.keyvalue.riak.core.BucketKeyPair;
|
||||
import org.springframework.data.keyvalue.riak.core.RiakTemplate;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
@@ -31,7 +31,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* An implementation of {@link org.springframework.data.riak.mapreduce.MapReduceJob}
|
||||
* An implementation of {@link org.springframework.data.keyvalue.riak.mapreduce.MapReduceJob}
|
||||
* for the Riak data store.
|
||||
*
|
||||
* @author J. Brisbin <jon@jbrisbin.com>
|
||||
@@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.riak.mapreduce;
|
||||
package org.springframework.data.keyvalue.riak.mapreduce;
|
||||
|
||||
/**
|
||||
* An implementation of {@link org.springframework.data.riak.mapreduce.MapReducePhase}
|
||||
* An implementation of {@link org.springframework.data.keyvalue.riak.mapreduce.MapReducePhase}
|
||||
* for the Riak data store.
|
||||
*
|
||||
* @author J. Brisbin <jon@jbrisbin.com>
|
||||
@@ -13,13 +13,13 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.riak.core
|
||||
package org.springframework.data.keyvalue.riak.core
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
import org.springframework.context.ApplicationContext
|
||||
import org.springframework.data.riak.mapreduce.JavascriptMapReduceOperation
|
||||
import org.springframework.data.riak.mapreduce.MapReduceJob
|
||||
import org.springframework.data.riak.mapreduce.RiakMapReducePhase
|
||||
import org.springframework.data.keyvalue.riak.mapreduce.JavascriptMapReduceOperation
|
||||
import org.springframework.data.keyvalue.riak.mapreduce.MapReduceJob
|
||||
import org.springframework.data.keyvalue.riak.mapreduce.RiakMapReducePhase
|
||||
import org.springframework.test.context.ContextConfiguration
|
||||
import spock.lang.Specification
|
||||
|
||||
@@ -197,7 +197,7 @@ class RiakTemplateSpec extends Specification {
|
||||
|
||||
given:
|
||||
MapReduceJob job = riak.createMapReduceJob()
|
||||
def mapJs = new JavascriptMapReduceOperation("function(v){ var o=Riak.mapValuesJson(v); return [1]; }")
|
||||
def mapJs = new JavascriptMapReduceOperation("function(v){ var o=Riak.mapValuesJson(v); return [1]; }\n")
|
||||
def mapPhase = new RiakMapReducePhase("map", "javascript", mapJs)
|
||||
|
||||
def reduceJs = new JavascriptMapReduceOperation("Riak.reduceSum")
|
||||
@@ -220,7 +220,7 @@ class RiakTemplateSpec extends Specification {
|
||||
|
||||
given:
|
||||
MapReduceJob job = riak.createMapReduceJob()
|
||||
def mapJs = new JavascriptMapReduceOperation("function(v){ var o=Riak.mapValuesJson(v); return [1]; }")
|
||||
def mapJs = new JavascriptMapReduceOperation("function(v){ var o=Riak.mapValuesJson(v); return [1]; }\n")
|
||||
def mapPhase = new RiakMapReducePhase("map", "javascript", mapJs)
|
||||
|
||||
def reduceJs = new JavascriptMapReduceOperation("Riak.reduceSum")
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.riak.core;
|
||||
package org.springframework.data.keyvalue.riak.core;
|
||||
|
||||
/**
|
||||
* @author J. Brisbin <jon@jbrisbin.com>
|
||||
@@ -5,6 +5,6 @@
|
||||
|
||||
<import resource="classpath:/META-INF/spring/app-context.xml"/>
|
||||
|
||||
<bean id="riakTemplate" class="org.springframework.data.riak.core.RiakTemplate"/>
|
||||
<bean id="riakTemplate" class="org.springframework.data.keyvalue.riak.core.RiakTemplate"/>
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Bundle-SymbolicName: org.springframework.data.riak
|
||||
Bundle-SymbolicName: org.springframework.data.keyvalue.riak
|
||||
Bundle-Name: Spring data Riak Support
|
||||
Bundle-Vendor: SpringSource
|
||||
Bundle-ManifestVersion: 2
|
||||
|
||||
Reference in New Issue
Block a user