Skip to content

Instantly share code, notes, and snippets.

@peschkaj
Created September 12, 2013 03:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peschkaj/6532771 to your computer and use it in GitHub Desktop.
Save peschkaj/6532771 to your computer and use it in GitHub Desktop.
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