public static String toString(Entry<Key, Value> entry) { Key key = entry.getKey(); if (NotificationUtil.isNtfy(key)) { StringBuilder sb = new StringBuilder(); encNonAscii(sb, key.getRowData());
@Override protected void consume() throws IOException { PushbackIterator source = (PushbackIterator) getSource(); if (lastKeySet == true) { skipRowCol(source, lastKey); } consumeDeletes(source); if (source.hasTop() && isNtfy(source.getTopKey()) && !isDelete(source.getTopKey())) { lastKey.set(source.getTopKey()); lastKeySet = true; } else { lastKeySet = false; } }
private void consumeDeletes(PushbackIterator source) throws IOException { while (source.hasTop() && isNtfy(source.getTopKey()) && isDelete(source.getTopKey())) { Key keyCopy = new Key(source.getTopKey()); if (scanOrFullMajc) { // consume everything w/ the same row col source.next(); skipRowCol(source, keyCopy); } else { // need to make a decision about propagating delete... IF the pattern of notifications and // deletes seems orderly AND it does not end with a delete THEN // do not propagate delete Value valCopy = new Value(source.getTopValue()); boolean lastKeyWasDelete = true; boolean isOrderly = true; // used to check that deletes and notifications alternate source.next(); while (source.hasTop() && source.getTopKey().equals(keyCopy, PartialKey.ROW_COLFAM_COLQUAL_COLVIS)) { isOrderly &= isDelete(source.getTopKey()) ^ lastKeyWasDelete; lastKeyWasDelete = isDelete(source.getTopKey()); source.next(); } if (!isOrderly || lastKeyWasDelete) { // dropping this delete on a partial compaction does not look promising, so propagate the // delete marker source.pushback(keyCopy, valCopy); break; } } } }