private static void DoAllowMultProducesMultipleTest(IRiakBatchClient client)
        {
            // delete first if something does exist
            client.Delete(MultiBucket, MultiKey);

            // Do this via the REST interface - will be substantially slower than PBC
            var props = new RiakBucketProperties().SetAllowMultiple(true).SetLastWriteWins(false);

            props.CanUsePbc.ShouldBeFalse();
            client.SetBucketProperties(MultiBucket, props).IsSuccess.ShouldBeTrue();

            var doc          = new RiakObject(MultiBucket, MultiKey, MultiBodyOne, RiakConstants.ContentTypes.ApplicationJson);
            var writeResult1 = client.Put(doc);

            writeResult1.IsSuccess.ShouldBeTrue();

            doc = new RiakObject(MultiBucket, MultiKey, MultiBodyTwo, RiakConstants.ContentTypes.ApplicationJson);
            var writeResult2 = client.Put(doc);

            writeResult2.IsSuccess.ShouldBeTrue();
            writeResult2.Value.Siblings.Count.ShouldEqual(2);

            var result = client.Get(MultiBucket, MultiKey);

            result.Value.Siblings.Count.ShouldEqual(2);
        }
示例#2
0
        // TESTING PURPOSES ONLY
        public static void DeleteBucket(this IRiakBatchClient client, string bucketType, string bucket)
        {
            var keylistResult = client.ListKeys(bucketType, bucket);

            if (keylistResult.Value == null)
            {
                return;
            }

            var objectIds = keylistResult.Value.Select(key => new RiakObjectId(bucketType, bucket, key));

            client.Delete(objectIds);
        }
示例#3
0
        private static void DoAllowMultProducesMultipleTest(IRiakBatchClient client)
        {
            // delete first if something does exist
            client.Delete(MultiBucket, MultiKey);

            var doc          = new RiakObject(MultiBucket, MultiKey, MultiBodyOne, RiakConstants.ContentTypes.ApplicationJson);
            var writeResult1 = client.Put(doc);

            writeResult1.IsSuccess.ShouldBeTrue();

            doc = new RiakObject(MultiBucket, MultiKey, MultiBodyTwo, RiakConstants.ContentTypes.ApplicationJson);
            var writeResult2 = client.Put(doc);

            writeResult2.IsSuccess.ShouldBeTrue();
            writeResult2.Value.Siblings.Count.ShouldBeGreaterThan(2);

            var result = client.Get(MultiBucket, MultiKey);

            result.Value.Siblings.Count.ShouldBeGreaterThan(2);
        }
        private static void DoAllowMultProducesMultipleTest(IRiakBatchClient client)
        {
            // delete first if something does exist
            client.Delete(MultiBucket, MultiKey);

            var doc = new RiakObject(MultiBucket, MultiKey, MultiBodyOne, RiakConstants.ContentTypes.ApplicationJson);
            var writeResult1 = client.Put(doc);
            writeResult1.IsSuccess.ShouldBeTrue();

            doc = new RiakObject(MultiBucket, MultiKey, MultiBodyTwo, RiakConstants.ContentTypes.ApplicationJson);
            var writeResult2 = client.Put(doc);
            writeResult2.IsSuccess.ShouldBeTrue();
            writeResult2.Value.Siblings.Count.ShouldBeGreaterThan(2);

            var result = client.Get(MultiBucket, MultiKey);
            result.Value.Siblings.Count.ShouldBeGreaterThan(2);
        }
        private static void DoAllowMultProducesMultipleTest(IRiakBatchClient client)
        {
            // delete first if something does exist
            client.Delete(MultiBucket, MultiKey);

            // Do this via the REST interface - will be substantially slower than PBC
            var props = new RiakBucketProperties().SetAllowMultiple(true).SetLastWriteWins(false);
            props.CanUsePbc.ShouldBeFalse();
            client.SetBucketProperties(MultiBucket, props).IsSuccess.ShouldBeTrue();

            var doc = new RiakObject(MultiBucket, MultiKey, MultiBodyOne, RiakConstants.ContentTypes.ApplicationJson);
            var writeResult1 = client.Put(doc);
            writeResult1.IsSuccess.ShouldBeTrue();

            doc = new RiakObject(MultiBucket, MultiKey, MultiBodyTwo, RiakConstants.ContentTypes.ApplicationJson);
            var writeResult2 = client.Put(doc);
            writeResult2.IsSuccess.ShouldBeTrue();
            writeResult2.Value.Siblings.Count.ShouldBeGreaterThan(2);

            var result = client.Get(MultiBucket, MultiKey);
            result.Value.Siblings.Count.ShouldBeGreaterThan(2);
        }
示例#6
0
 // TESTING PURPOSES ONLY
 public static void DeleteBucket(this IRiakBatchClient client, string bucket)
 {
     DeleteBucket(client, null, bucket);
 }