Package com.basho.riak.client.core.query

Examples of com.basho.riak.client.core.query.Namespace


   
    private void initValues(String bucketType) throws InterruptedException
    {
        // insert 200 items into a bucket
      
        Namespace ns = new Namespace(bucketType, mrBucketName);
       
        String keyPrefix = "mr_test_";
        for (int i = 0; i < 200; i++)
        {
            Location loc = new Location(ns, keyPrefix + i);
View Full Code Here


    }
   
    private void erlangBucketMR(String bucketType) throws InterruptedException, ExecutionException
    {
        initValues(bucketType);
        Namespace ns = new Namespace(bucketType, mrBucketName);
        BucketMapReduce bmr =
            new BucketMapReduce.Builder()
                .withNamespace(ns)
                .withMapPhase(Function.newErlangFunction("riak_kv_mapreduce", "map_object_value"), false)
                .withReducePhase(Function.newErlangFunction("riak_kv_mapreduce", "reduce_string_to_integer"), false)
View Full Code Here

   
    private void JsBucketMR(String bucketType) throws InterruptedException, ExecutionException
    {
        initValues(bucketType);
       
        Namespace ns = new Namespace(bucketType, mrBucketName);
        BucketMapReduce bmr =
            new BucketMapReduce.Builder()
                .withNamespace(ns)
                .withMapPhase(Function.newNamedJsFunction("Riak.mapValuesJson"), false)
                .withReducePhase(Function.newNamedJsFunction("Riak.reduceNumericSort"), true)
View Full Code Here

    @Test
    public void multiPhaseResult() throws InterruptedException, ExecutionException
    {
        initValues(Namespace.DEFAULT_BUCKET_TYPE);
       
        Namespace ns = new Namespace(Namespace.DEFAULT_BUCKET_TYPE, mrBucketName);
        BucketMapReduce bmr =
            new BucketMapReduce.Builder()
                .withNamespace(ns)
                .withMapPhase(Function.newNamedJsFunction("Riak.mapValuesJson"), true)
                .withReducePhase(Function.newNamedJsFunction("Riak.reduceNumericSort"), true)
View Full Code Here

   
    @Test
    public void keyFilter() throws InterruptedException, ExecutionException
    {
        initValues(Namespace.DEFAULT_BUCKET_TYPE);
        Namespace ns = new Namespace(Namespace.DEFAULT_BUCKET_TYPE, mrBucketName);
        BucketMapReduce bmr =
            new BucketMapReduce.Builder()
                .withNamespace(ns)
                .withMapPhase(Function.newNamedJsFunction("Riak.mapValuesJson"))
                .withReducePhase(Function.newErlangFunction("riak_kv_mapreduce", "reduce_sort"),true)
View Full Code Here

    public void differentBucketType() throws InterruptedException, ExecutionException
    {
        Assume.assumeTrue(testBucketType);
       
        initValues(bucketType.toString());
        Namespace ns = new Namespace(bucketType.toString(), mrBucketName);
        BucketMapReduce bmr =
            new BucketMapReduce.Builder()
                .withNamespace(ns)
                .withMapPhase(Function.newAnonymousJsFunction(
                    "function(value, keydata, arg) {" +
View Full Code Here

    {
        Assume.assumeTrue(testBucketType);

        initValues(bucketType.toString());
       
         Namespace ns = new Namespace(bucketType.toString(), mrBucketName);
        BucketMapReduce bmr =
            new BucketMapReduce.Builder()
                .withNamespace(ns)
                .withKeyFilter(new TokenizeFilter("_",3))
                .withKeyFilter(new StringToIntFilter())
View Full Code Here

        }
       
        RiakCluster cluster = new RiakCluster.Builder(list).build();
        cluster.start();
       
        Namespace ns = new Namespace(Namespace.DEFAULT_BUCKET_TYPE, "test_bucket");
        Location location = new Location(ns, "test_key2");
       
        FetchOperation operation =
            new FetchOperation.Builder(location).build();
View Full Code Here

       
        RiakCluster cluster = new RiakCluster.Builder(list).build();
       
        cluster.start();
       
        Namespace ns = new Namespace(Namespace.DEFAULT_BUCKET_TYPE, "test_bucket");
        Location location = new Location(ns, "test_key2");
       
        FetchOperation operation =
            new FetchOperation.Builder(location)
                    .build();
View Full Code Here

   
    private void testSimpleStore(String bucketType) throws InterruptedException, ExecutionException
    {
       
        RiakObject obj = new RiakObject().setValue(BinaryValue.create(value));
        Namespace ns = new Namespace(bucketType, bucketName.toString());
        Location location = new Location(ns, key);
        StoreOperation storeOp =
            new StoreOperation.Builder(location)
                .withContent(obj)
                .build();
View Full Code Here

TOP

Related Classes of com.basho.riak.client.core.query.Namespace

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.