Skip to content

Instantly share code, notes, and snippets.

@peschkaj
Created February 12, 2013 23:18
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/4774418 to your computer and use it in GitHub Desktop.
Save peschkaj/4774418 to your computer and use it in GitHub Desktop.
namespace CorrugatedIron.Models.MapReduce.Inputs
{
public static class RiakIndex
{
private static string RiakKeysIndex = "$key";
public static RiakIndexInput AllKeys(string bucket)
{
string first = "\u0000";
string last = char.ConvertFromUtf32(0x10FFFF);
return Keys(bucket, first, last);
}
public static RiakIndexInput Keys(string bucket, string start, string end)
{
return new RiakBinIndexRangeInput(bucket, RiakKeysIndex, start, end);
}
}
}
namespace CorrugatedIron.Extensions
{
public static class StringExtensions
{
private static List<string> magicStrings = new List<string> { "$key" };
public static bool IsBinaryKey(this string value)
{
return magicStrings.Contains(value) || value.EndsWith(RiakConstants.IndexSuffix.Binary);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment