public static void main()

in stresso/src/main/java/stresso/trie/Diff.java [70:122]


  public static void main(String[] args) throws Exception {

    if (args.length != 2) {
      System.err.println("Usage: " + Diff.class.getSimpleName() + " <fluo conn props> <app name>");
      System.exit(-1);
    }

    FluoConfiguration config = new FluoConfiguration(new File(args[0]));
    config.setApplicationName(args[1]);

    try (FluoClient client = FluoFactory.newClient(config); Snapshot snap = client.newSnapshot()) {

      StressoConfig sconf = StressoConfig.retrieve(client);

      Map<String, Long> rootCounts =
          getRootCount(client, snap, sconf.stopLevel, sconf.stopLevel, sconf.nodeSize);
      ArrayList<String> rootRows = new ArrayList<>(rootCounts.keySet());
      Collections.sort(rootRows);

      // TODO 8
      for (int level = sconf.stopLevel + 1; level <= 8; level++) {
        System.out.printf("Level %d:\n", level);

        Map<String, Long> counts =
            getRootCount(client, snap, level, sconf.stopLevel, sconf.nodeSize);

        long sum = 0;

        for (String row : rootRows) {
          long c1 = rootCounts.get(row);
          long c2 = counts.getOrDefault(row, -1L);

          if (c1 != c2) {
            System.out.printf("\tdiff: %s %d %d\n", row, c1, c2);
          }

          if (c2 > 0) {
            sum += c2;
          }
        }

        HashSet<String> extras = new HashSet<>(counts.keySet());
        extras.removeAll(rootCounts.keySet());

        for (String row : extras) {
          long c = counts.get(row);
          System.out.printf("\textra: %s %d\n", row, c);
        }

        System.out.println("\tsum " + sum);
      }
    }
  }