@Override public void addVersionDelete(Cell cell) { SortedMap<Long, TagInfo> set = deletesMap.get(cell.getTimestamp()); if (set == null) { set = new TreeMap<>(); deletesMap.put(cell.getTimestamp(), set); } set.put(cell.getSequenceId(), new TagInfo(cell)); // The init set should be the puts whose mvcc is smaller than this Delete. Because // there may be some Puts masked by them. The Puts whose mvcc is larger than this Delete can // not be copied to this node because we may delete one version and the oldest put may not be // masked. SortedSet<Long> nextValue = mvccCountingMap.ceilingEntry(cell.getSequenceId()).getValue(); SortedSet<Long> thisValue = new TreeSet<>(nextValue.headSet(cell.getSequenceId())); mvccCountingMap.put(cell.getSequenceId(), thisValue); }
@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); } }