/** * Dumps all cells of the segment into the given log */ void dump(Logger log) { for (Cell cell: getCellSet()) { log.debug(Objects.toString(cell)); } }
/** * @return whether the segment has any cells */ public boolean isEmpty() { return getCellSet().isEmpty(); }
/** * Returns a subset of the segment cell set, which starts with the given cell * @param firstCell a cell in the segment * @return a subset of the segment cell set, which starts with the given cell */ protected SortedSet<Cell> tailSet(Cell firstCell) { return getCellSet().tailSet(firstCell); }
public SortedSet<Cell> headSet(Cell firstKeyOnRow) { return getCellSet().headSet(firstKeyOnRow); }
private static Iterator<Cell> createIterator(Segment segment) { return segment.getCellSet().iterator(); }
public Iterator<Cell> iterator() { return getCellSet().iterator(); }
public Cell last() { return getCellSet().last(); }
protected void internalAdd(Cell cell, boolean mslabUsed, MemStoreSizing memstoreSizing, boolean sizeAddedPreOperation) { boolean succ = getCellSet().add(cell); updateMetaInfo(cell, succ, mslabUsed, memstoreSizing, sizeAddedPreOperation); }
/** * @param cell Find the row that comes after this one. If null, we return the * first. * @return Next row or null if none found. */ Cell getNextRow(final Cell cell) { Cell lowest = null; List<Segment> segments = getSegments(); for (Segment segment : segments) { if (lowest == null) { lowest = getNextRow(cell, segment.getCellSet()); } else { lowest = getLowest(lowest, getNextRow(cell, segment.getCellSet())); } } return lowest; }
protected Segment(Segment segment) { this.cellSet.set(segment.getCellSet()); this.comparator = segment.getComparator(); this.updatesLock = segment.getUpdatesLock(); this.minSequenceId = segment.getMinSequenceId(); this.memStoreLAB = segment.getMemStoreLAB(); this.memStoreSizing = segment.memStoreSizing; this.tagsPresent = segment.isTagsPresent(); this.timeRangeTracker = segment.getTimeRangeTracker(); }