@Override protected VisibilityDeleteVersionsNode getDeepCopy() { VisibilityDeleteVersionsNode node = new VisibilityDeleteVersionsNode(ts, mvcc, tagInfo); for (Map.Entry<Long, SortedMap<Long, TagInfo>> e : deletesMap.entrySet()) { node.deletesMap.put(e.getKey(), new TreeMap<>(e.getValue())); } for (Map.Entry<Long, SortedSet<Long>> e : mvccCountingMap.entrySet()) { node.mvccCountingMap.put(e.getKey(), new TreeSet<>(e.getValue())); } return node; }
@Override protected void resetInternal() { delFamMap.put(Long.MAX_VALUE, new VisibilityDeleteVersionsNode(Long.MIN_VALUE, Long.MAX_VALUE, new TagInfo())); } }
@Override public void add(Cell cell) { prepare(cell); byte type = cell.getTypeByte(); switch (KeyValue.Type.codeToType(type)) { // By the order of seen. We put null cq at first. case DeleteFamily: // Delete all versions of all columns of the specified family delFamMap.put(cell.getSequenceId(), new VisibilityDeleteVersionsNode(cell.getTimestamp(), cell.getSequenceId(), new TagInfo(cell))); break; case DeleteFamilyVersion: // Delete all columns of the specified family and specified version delFamMap.ceilingEntry(cell.getSequenceId()).getValue().addVersionDelete(cell); break; // These two kinds of markers are mix with Puts. case DeleteColumn: // Delete all versions of the specified column delColMap.put(cell.getSequenceId(), new VisibilityDeleteVersionsNode(cell.getTimestamp(), cell.getSequenceId(), new TagInfo(cell))); break; case Delete: // Delete the specified version of the specified column. delColMap.ceilingEntry(cell.getSequenceId()).getValue().addVersionDelete(cell); break; default: throw new AssertionError("Unknown delete marker type for " + cell); } }