MCPcopy Create free account
hub / github.com/OpenTSDB/opentsdb / fullRowSeconds

Method fullRowSeconds

test/core/TestCompactionQueue.java:371–396  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

369 }
370
371 @Test
372 public void fullRowSeconds() throws Exception {
373 ArrayList<KeyValue> kvs = new ArrayList<KeyValue>(3600);
374 ArrayList<Annotation> annotations = new ArrayList<Annotation>(0);
375
376 byte[] qualifiers = new byte[] {};
377 byte[] values = new byte[] {};
378
379 for (int i = 0; i < 3600; i++) {
380 final short qualifier = (short) (i << Const.FLAG_BITS | 0x07);
381 kvs.add(makekv(Bytes.fromShort(qualifier), Bytes.fromLong(i)));
382 qualifiers = MockBase.concatByteArrays(qualifiers,
383 Bytes.fromShort(qualifier));
384 values = MockBase.concatByteArrays(values, Bytes.fromLong(i));
385 }
386
387 final KeyValue kv = compactionq.compact(kvs, annotations, null);
388 assertArrayEquals(MockBase.concatByteArrays(qualifiers), kv.qualifier());
389 assertArrayEquals(MockBase.concatByteArrays(values, ZERO), kv.value());
390
391 // We had one row to compact, so one put to do.
392 verify(tsdb, times(1)).put(KEY, qualifiers,
393 MockBase.concatByteArrays(values, ZERO), kvCount - 1);
394 // And we had to delete individual cells.
395 verify(tsdb, times(1)).delete((byte[])any(), (byte[][])any());
396 }
397
398 @Test
399 public void bigRowMs() throws Exception {

Callers

nothing calls this directly

Calls 8

makekvMethod · 0.95
concatByteArraysMethod · 0.95
putMethod · 0.80
addMethod · 0.45
compactMethod · 0.45
qualifierMethod · 0.45
valueMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected