Created
September 12, 2013 03:28
-
-
Save peschkaj/6532771 to your computer and use it in GitHub Desktop.
C# Test for issue https://github.com/basho/riak_kv/issues/660
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using CorrugatedIron; | |
using CorrugatedIron.Models; | |
using CorrugatedIron.Util; | |
using ProtoBuf; | |
namespace TestAllowMult | |
{ | |
public class MainClass | |
{ | |
public static void Main(string[] args) | |
{ | |
var EndPoint = RiakCluster.FromConfig("riakConfig"); | |
var client = EndPoint.CreateClient(); | |
client.DeleteBucket("players"); | |
client.ResetBucketProperties("players"); | |
// optimize for fire-and-forget, since this is player metadata such as rank, nicname, etc, it just | |
// needs to be eventually consistent. | |
var props = new RiakBucketProperties (); | |
props.SetAllowMultiple (true); | |
props.SetLastWriteWins(false); | |
props.SetWVal (1); | |
props.SetRVal (1); | |
var res = client.SetBucketProperties ("players", props); | |
if( ! res.IsSuccess) | |
{ | |
Console.WriteLine(res.ErrorMessage); | |
} | |
props = client.GetBucketProperties("players").Value; | |
props.SetAllowMultiple (false); | |
props.SetLastWriteWins(true); | |
res = client.SetBucketProperties ("players", props); | |
if( ! res.IsSuccess) | |
{ | |
Console.WriteLine(res.ErrorMessage); | |
} | |
var readprops = client.GetBucketProperties("players"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment