Search in sources :

Example 1 with StoreBucketProperties

use of com.basho.riak.client.api.commands.buckets.StoreBucketProperties 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

StoreBucketProperties (com.basho.riak.client.api.commands.buckets.StoreBucketProperties)1 Namespace (com.basho.riak.client.core.query.Namespace)1