Skip to content

Instantly share code, notes, and snippets.

@tarnacious
Created July 27, 2011 14:29
Show Gist options
  • Select an option

  • Save tarnacious/1109460 to your computer and use it in GitHub Desktop.

Select an option

Save tarnacious/1109460 to your computer and use it in GitHub Desktop.
Connecting to Riak with Corrugated Iron
$ csharp
Mono C# Shell, type "help;" for help
Enter statements below.
csharp> LoadAssembly("CorrugatedIron.dll");
csharp> var config = CorrugatedIron.Config.RiakClusterConfiguration.LoadFromConfig("riakConfig","riak.config");
csharp> var cluster = new CorrugatedIron.Comms.RiakCluster(config, new CorrugatedIron.Comms.RiakConnectionFactory());
csharp> var client = cluster.CreateClient();
csharp> var buckets = client.ListBuckets();
csharp> foreach(var bucket in buckets.Value) { Console.WriteLine(bucket); };
images
images
yakmr
yak
messages2
goog
messages
..
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="riakConfig" type="CorrugatedIron.Config.RiakClusterConfiguration, CorrugatedIron" />
</configSections>
<riakConfig nodePollTime="5000" defaultRetryWaitTime="200" defaultRetryCount="3">
<nodes>
<node name="dev1" hostAddress="localhost" pbcPort="8081" restScheme="http" restPort="8091" poolSize="20" />
<node name="dev2" hostAddress="localhost" pbcPort="8082" restScheme="http" restPort="8092" poolSize="20" />
<node name="dev3" hostAddress="localhost" pbcPort="8083" restScheme="http" restPort="8093" poolSize="20" />
</nodes>
</riakConfig>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment