MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / ensureCapacity

Method ensureCapacity

src/core/BatchedDataPoints.java:262–271  ·  view source on GitHub ↗

Checks the size of the qualifier and value arrays to make sure we have space. If not then we double the size of the arrays. This way a row allocates space for a full hour of second data but if the user requires millisecond storage with more than 3600 points, it will expand. @param next_qualifier The

(final byte[] next_qualifier, 
      final byte[] next_value)

Source from the content-addressed store, hash-verified

260 * @param next_value The next value to use for it's length
261 */
262 private void ensureCapacity(final byte[] next_qualifier,
263 final byte[] next_value) {
264 if (qualifier_index + next_qualifier.length >= batched_qualifier.length) {
265 batched_qualifier = Arrays.copyOf(batched_qualifier,
266 batched_qualifier.length * 2);
267 }
268 if (value_index + next_value.length >= batched_value.length) {
269 batched_value = Arrays.copyOf(batched_value, batched_value.length * 2);
270 }
271 }
272
273 /**
274 * Appends the value and qualifier to the appropriate arrays

Callers 2

appendMethod · 0.95
escapeJsonMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected