MCPcopy Create free account
hub / github.com/cmu-db/benchbase / _put

Method _put

src/main/java/com/oltpbenchmark/util/Histogram.java:139–158  ·  view source on GitHub ↗

The main method that updates a value in the histogram with a given sample count This should be called by one of the public interface methods that are synchronized This method is not synchronized on purpose for performance @param value @param count

(X value, int count)

Source from the content-addressed store, hash-verified

137 * @param count
138 */
139 private void _put(X value, int count) {
140 if (value == null) {
141 return;
142 }
143 this.num_samples += count;
144
145 // If we already have this value in our histogram, then add the new count
146 // to its existing total
147 if (this.histogram.containsKey(value)) {
148 count += this.histogram.get(value);
149 }
150
151 // If the new count is zero, then completely remove it if we're not allowed to have zero entries
152 if (count == 0 && !this.keep_zero_entries) {
153 this.histogram.remove(value);
154 } else {
155 this.histogram.put(value, count);
156 }
157 this.dirty = true;
158 }
159
160 /**
161 * Recalculate the min/max count value sets Since this is expensive, this should only be done

Callers 5

putMethod · 0.95
setMethod · 0.95
putAllMethod · 0.95
putHistogramMethod · 0.95
removeAllMethod · 0.95

Calls 3

getMethod · 0.45
removeMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected