Search in sources :

Example 6 with Namespace

use of com.basho.riak.client.core.query.Namespace in project YCSB by brianfrankcooper.

the class RiakKVClient method setTestEnvironment.

/**
   * Auxiliary function needed for testing. It configures the default bucket-type to take care of the consistency
   * problem by disallowing the siblings creation. Moreover, it disables strong consistency, because we don't have
   * the possibility to create a proper bucket-type to use to fake 2i indexes usage.
   *
   * @param bucket     The bucket name.
   * @throws Exception Thrown if something bad happens.
     */
void setTestEnvironment(String bucket) throws Exception {
    bucketType = "default";
    bucketType2i = bucketType;
    strongConsistency = false;
    Namespace ns = new Namespace(bucketType, bucket);
    StoreBucketProperties newBucketProperties = new StoreBucketProperties.Builder(ns).withAllowMulti(false).build();
    riakClient.execute(newBucketProperties);
}
Also used : StoreBucketProperties(com.basho.riak.client.api.commands.buckets.StoreBucketProperties) Namespace(com.basho.riak.client.core.query.Namespace)

Aggregations

Namespace (com.basho.riak.client.core.query.Namespace)6 Location (com.basho.riak.client.core.query.Location)5 IOException (java.io.IOException)5 TimeoutException (java.util.concurrent.TimeoutException)5 FetchValue (com.basho.riak.client.api.commands.kv.FetchValue)2 RiakObject (com.basho.riak.client.core.query.RiakObject)2 StoreBucketProperties (com.basho.riak.client.api.commands.buckets.StoreBucketProperties)1 IntIndexQuery (com.basho.riak.client.api.commands.indexes.IntIndexQuery)1 DeleteValue (com.basho.riak.client.api.commands.kv.DeleteValue)1 StoreValue (com.basho.riak.client.api.commands.kv.StoreValue)1 UpdateValue (com.basho.riak.client.api.commands.kv.UpdateValue)1 RiakUtils.createResultHashMap (com.yahoo.ycsb.db.riak.RiakUtils.createResultHashMap)1