INNER CODE UNIT · C#

expectedKeyCount

ZoneTree/ZoneTree · benchmarks/zonetree-scan-lab/Program.cs:1111

    var expectedKeyCount = generator.CountryCodes.Count * generator.StatusValues.Count;
    var distinctKeys = new Dictionary<(string Country, string Status), CountryStatusKey>();
    for (var userId = 1L; userId <= maxId && distinctKeys.Count < expectedKeyCount; userId++)
    {
      var profile = generator.Create(userId);
      var group = (profile.Country, profile.Status);
      if (distinctKeys.ContainsKey(group))
        continue;

      var key = ProfileKeys.CountryStatus(profile);
      distinctKeys.Add(group, new CountryStatusKey(key, Encoding.UTF8.GetBytes(key)));
    }

    if (distinctKeys.Count != expectedKeyCount)
      throw new InvalidOperationException(
          $"Expected {expectedKeyCount} country/status groups, but found {distinctKeys.Count} in {maxId} profiles.");

    var keyPool = distinctKeys.Values

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…