()
| 703 | } |
| 704 | |
| 705 | @Test |
| 706 | public void failedCompactNoop() throws Exception { |
| 707 | // In this case, the row contains both the compacted form as well as the |
| 708 | // non-compacted form. This could happen if the TSD dies in between the |
| 709 | // `put' of a compaction, before getting a change to do the deletes. |
| 710 | ArrayList<KeyValue> kvs = new ArrayList<KeyValue>(3); |
| 711 | ArrayList<Annotation> annotations = new ArrayList<Annotation>(0); |
| 712 | final byte[] qual1 = { 0x00, 0x07 }; |
| 713 | final byte[] val1 = Bytes.fromLong(4L); |
| 714 | kvs.add(makekv(qual1, val1)); |
| 715 | final byte[] qual2 = { 0x00, 0x17 }; |
| 716 | final byte[] val2 = Bytes.fromLong(5L); |
| 717 | kvs.add(makekv(qual2, val2)); |
| 718 | final byte[] qualcompact = MockBase.concatByteArrays(qual1, qual2); |
| 719 | final byte[] valcompact = MockBase.concatByteArrays(val1, val2, ZERO); |
| 720 | kvs.add(makekv(qualcompact, valcompact)); |
| 721 | |
| 722 | final KeyValue kv = compactionq.compact(kvs, annotations, null); |
| 723 | assertArrayEquals(qualcompact, kv.qualifier()); |
| 724 | assertArrayEquals(valcompact, kv.value()); |
| 725 | |
| 726 | // We didn't have anything to write. |
| 727 | verify(tsdb, never()).put(anyBytes(), anyBytes(), anyBytes(), anyLong()); |
| 728 | // We had to delete stuff in 1 row. |
| 729 | verify(tsdb, times(1)).delete(eq(KEY), eqAnyOrder(new byte[][] { qual1, qual2 })); |
| 730 | } |
| 731 | |
| 732 | @Test |
| 733 | public void annotationOnly() throws Exception { |
nothing calls this directly
no test coverage detected