MCPcopy Create free account
hub / github.com/apache/solr / SolrGen

Class SolrGen

solr/benchmark/src/java/org/apache/solr/bench/generators/SolrGen.java:39–386  ·  view source on GitHub ↗

The type Solr gen. @param the type parameter

Source from the content-addressed store, hash-verified

37 * @param <T> the type parameter
38 */
39public class SolrGen<T> implements Gen<T> {
40
41 private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
42
43 /** The constant OPEN_PAREN. */
44 public static final String OPEN_PAREN = " (";
45
46 /** The constant CLOSE_PAREN. */
47 public static final char CLOSE_PAREN = ')';
48
49 /** The constant COUNT_TYPES_ARE_TRACKED_LIMIT_WAS_REACHED. */
50 public static final String COUNT_TYPES_ARE_TRACKED_LIMIT_WAS_REACHED =
51 " Count types are tracked, limit was reached.\n\n";
52
53 /** The constant RANDOM_DATA_GEN_REPORTS. */
54 public static final String RANDOM_DATA_GEN_REPORTS =
55 "\n\n\n***** Random Data Gen Reports *****\n\n";
56
57 /** The constant ONLY. */
58 public static final String ONLY = "\n\nOnly ";
59
60 /** The Child. */
61 protected final Gen<T> child;
62
63 private final Class<?> type;
64 private Distribution distribution = Distribution.UNIFORM;
65
66 /** The Start. */
67 protected long start;
68
69 /** The End. */
70 protected long end;
71
72 private static final boolean COLLECT_COUNTS = Boolean.getBoolean("random.counts");
73
74 static {
75 log.info("random.counts is set to {}", COLLECT_COUNTS);
76 }
77
78 private String description;
79
80 private String collectKey;
81
82 /** The constant COUNTS. */
83 public static final Map<String, RandomDataHistogram.Counts> COUNTS = new NonBlockingHashMap<>(64);
84
85 /**
86 * Counts report list.
87 *
88 * @return the list
89 */
90 public static List<String> countsReport() {
91 List<String> reports = new ArrayList<>(COUNTS.size());
92 reports.add(RANDOM_DATA_GEN_REPORTS);
93 if (COUNTS.size() >= RandomDataHistogram.MAX_TYPES_TO_COLLECT) {
94 reports.add(
95 ONLY
96 + RandomDataHistogram.MAX_TYPES_TO_COLLECT

Callers

nothing calls this directly

Calls 3

lookupMethod · 0.45
getBooleanMethod · 0.45
infoMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…