@@ -0,0 +1,2229 @@
+package de.danielbasedow.prospecter.benchmark;%0A%0Aimport com.fasterxml.jackson.core.io.JsonStringEncoder;%0Aimport de.danielbasedow.prospecter.core.schema.Schema;%0Aimport de.danielbasedow.prospecter.core.schema.SchemaBuilder;%0Aimport de.danielbasedow.prospecter.core.schema.SchemaBuilderJSON;%0Aimport de.danielbasedow.prospecter.core.schema.SchemaConfigurationError;%0A%0Aimport java.io.BufferedReader;%0Aimport java.io.File;%0Aimport java.io.FileReader;%0A%0Apublic class TxtFileLoader %7B%0A%0A    public static Schema buildSchema(String fileName) throws SchemaConfigurationError %7B%0A        SchemaBuilder schemaBuilder = new SchemaBuilderJSON(new File(fileName));%0A        return schemaBuilder.getSchema();%0A    %7D%0A%0A    public static String buildJsonQuery(String queryString, long id) %7B%0A        JsonStringEncoder encoder = JsonStringEncoder.getInstance();%0A        return %22%7B%22 +%0A                %22%5C%22id%5C%22: %22 + String.valueOf(id) + %22,%22 +%0A                %22%5C%22query%5C%22: %7B%22 +%0A                %22%5C%22conditions%5C%22: %5B%22 +%0A                %22%7B%22 +%0A                %22%5C%22field%5C%22: %5C%22textField%5C%22,%22 +%0A                %22%5C%22condition%5C%22: %5C%22match%5C%22,%22 +%0A                %22%5C%22value%5C%22: %5C%22%22 + new String(encoder.quoteAsString(queryString)) + %22%5C%22%22 +%0A                %22%7D%22 +%0A                %22%5D%22 +%0A                %22%7D%22 +%0A                %22%7D%22;%0A    %7D%0A%0A%0A    public static void main(String%5B%5D args) %7B%0A        try %7B%0A            Schema schema = buildSchema(args%5B0%5D);%0A%0A            String line;%0A            BufferedReader br = new BufferedReader(new FileReader(new File(args%5B1%5D)));%0A            long i = 0;%0A            while ((line = br.readLine()) != null) %7B%0A                i++;%0A                schema.addQuery(buildJsonQuery(line.trim(), i));%0A                if (i %25 10000 == 0) %7B%0A                    System.out.println(i);%0A                %7D%0A            %7D%0A            br.close();%0A            schema.close();%0A            printVMStats();%0A        %7D catch (Exception e) %7B%0A            e.printStackTrace();%0A        %7D%0A%0A    %7D%0A%0A    public static void printVMStats() %7B%0A        Runtime runtime = Runtime.getRuntime();%0A        System.out.println(%22used: %22 + (runtime.totalMemory() - runtime.freeMemory()));%0A        runtime.gc();%0A        System.out.println(%22used: %22 + (runtime.totalMemory() - runtime.freeMemory()));%0A    %7D%0A%7D%0A

add loader for queries from txt files