private void updateSequenceId(final Iterable<List<Cell>> cellItr, final long sequenceId) throws IOException { for (List<Cell> cells: cellItr) { if (cells == null) return; for (Cell cell : cells) { PrivateCellUtil.setSequenceId(cell, sequenceId); } } }
@Override public void setSequenceId(long seqId) throws IOException { // The incoming cell is supposed to be ExtendedCell type. PrivateCellUtil.setSequenceId(cell, seqId); }
@Override public void setSequenceId(long seqId) throws IOException { PrivateCellUtil.setSequenceId(cell, seqId); }
@Override public void setSequenceId(long seqId) throws IOException { PrivateCellUtil.setSequenceId(this.cell, seqId); }
/** * Sets the given seqId to the cell. * Marked as audience Private as of 1.2.0. * Setting a Cell sequenceid is an internal implementation detail not for general public use. * @param cell * @param seqId * @throws IOException when the passed cell is not of type {@link ExtendedCell} * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0. */ @Deprecated public static void setSequenceId(Cell cell, long seqId) throws IOException { PrivateCellUtil.setSequenceId(cell, seqId); }
protected void setCurrentCell(Cell newVal) throws IOException { this.cur = newVal; if (this.cur != null && this.reader.isBulkLoaded() && !this.reader.isSkipResetSeqId()) { PrivateCellUtil.setSequenceId(cur, this.reader.getSequenceID()); } }
@Override public long append(RegionInfo info, WALKeyImpl key, WALEdit edits, boolean inMemstore) throws IOException { WriteEntry writeEntry = key.getMvcc().begin(); if (!edits.isReplay()) { for (Cell cell : edits.getCells()) { PrivateCellUtil.setSequenceId(cell, writeEntry.getWriteNumber()); } } key.setWriteEntry(writeEntry); if (!this.listeners.isEmpty()) { final long start = System.nanoTime(); long len = 0; for (Cell cell : edits.getCells()) { len += PrivateCellUtil.estimatedSerializedSizeOf(cell); } final long elapsed = (System.nanoTime() - start) / 1000000L; for (WALActionsListener listener : this.listeners) { listener.postAppend(len, elapsed, key, edits); } } return -1; }
/** * Here is where a WAL edit gets its sequenceid. SIDE-EFFECT is our stamping the sequenceid into * every Cell AND setting the sequenceid into the MVCC WriteEntry!!!! * @return The sequenceid we stamped on this edit. */ long stampRegionSequenceId(MultiVersionConcurrencyControl.WriteEntry we) throws IOException { long regionSequenceId = we.getWriteNumber(); if (!this.getEdit().isReplay() && inMemstore) { for (Cell c : getEdit().getCells()) { PrivateCellUtil.setSequenceId(c, regionSequenceId); } } getKey().setWriteEntry(we); return regionSequenceId; }
lastCleanCell = c; lastCleanCellSeqId = c.getSequenceId(); PrivateCellUtil.setSequenceId(c, 0); } else { lastCleanCell = null; PrivateCellUtil.setSequenceId(lastCleanCell, lastCleanCellSeqId); PrivateCellUtil.setSequenceId(lastCleanCell, lastCleanCellSeqId);
@Test public void testNumberOfMemStoreScannersAfterFlush() throws IOException { long seqId = 100; long timestamp = System.currentTimeMillis(); Cell cell0 = CellBuilderFactory.create(CellBuilderType.DEEP_COPY).setRow(row).setFamily(family) .setQualifier(qf1).setTimestamp(timestamp).setType(Cell.Type.Put) .setValue(qf1).build(); PrivateCellUtil.setSequenceId(cell0, seqId); testNumberOfMemStoreScannersAfterFlush(Arrays.asList(cell0), Collections.emptyList()); Cell cell1 = CellBuilderFactory.create(CellBuilderType.DEEP_COPY).setRow(row).setFamily(family) .setQualifier(qf2).setTimestamp(timestamp).setType(Cell.Type.Put) .setValue(qf1).build(); PrivateCellUtil.setSequenceId(cell1, seqId); testNumberOfMemStoreScannersAfterFlush(Arrays.asList(cell0), Arrays.asList(cell1)); seqId = 101; timestamp = System.currentTimeMillis(); Cell cell2 = CellBuilderFactory.create(CellBuilderType.DEEP_COPY).setRow(row2).setFamily(family) .setQualifier(qf2).setTimestamp(timestamp).setType(Cell.Type.Put) .setValue(qf1).build(); PrivateCellUtil.setSequenceId(cell2, seqId); testNumberOfMemStoreScannersAfterFlush(Arrays.asList(cell0), Arrays.asList(cell1, cell2)); }
PrivateCellUtil.setSequenceId(cell, sequenceId);
private Cell createCell(byte[] row, byte[] qualifier, long ts, long sequenceId, byte[] value) throws IOException { Cell c = CellBuilderFactory.create(CellBuilderType.DEEP_COPY).setRow(row).setFamily(family) .setQualifier(qualifier).setTimestamp(ts).setType(Cell.Type.Put) .setValue(value).build(); PrivateCellUtil.setSequenceId(c, sequenceId); return c; }
if (mobCell.getValueLength() != 0) { PrivateCellUtil.setSequenceId(mobCell, c.getSequenceId()); writer.append(mobCell); cellsCountCompactedFromMob++;
continue; PrivateCellUtil.setSequenceId(cell, currentReplaySeqId);
@Override public void setSequenceId(long seqId) throws IOException { // The incoming cell is supposed to be ExtendedCell type. PrivateCellUtil.setSequenceId(cell, seqId); }
@Override public void setSequenceId(long seqId) throws IOException { // The incoming cell is supposed to be ExtendedCell type. PrivateCellUtil.setSequenceId(cell, seqId); }
@Override public void setSequenceId(long seqId) throws IOException { PrivateCellUtil.setSequenceId(this.cell, seqId); }
/** * Sets the given seqId to the cell. Marked as audience Private as of 1.2.0. Setting a Cell * sequenceid is an internal implementation detail not for general public use. * @param cell * @param seqId * @throws IOException when the passed cell is not of type {@link ExtendedCell} * @deprecated As of HBase-2.0. Will be removed in HBase-3.0 */ @Deprecated public static void setSequenceId(Cell cell, long seqId) throws IOException { PrivateCellUtil.setSequenceId(cell, seqId); }
/** * Sets the given seqId to the cell. Marked as audience Private as of 1.2.0. Setting a Cell * sequenceid is an internal implementation detail not for general public use. * @param cell * @param seqId * @throws IOException when the passed cell is not of type {@link ExtendedCell} * @deprecated As of HBase-2.0. Will be removed in HBase-3.0 */ @Deprecated public static void setSequenceId(Cell cell, long seqId) throws IOException { PrivateCellUtil.setSequenceId(cell, seqId); }
private Cell createCell(byte[] row, byte[] qualifier, long ts, long sequenceId, byte[] value) throws IOException { Cell c = CellBuilderFactory.create(CellBuilderType.DEEP_COPY).setRow(row).setFamily(family) .setQualifier(qualifier).setTimestamp(ts).setType(Cell.Type.Put) .setValue(value).build(); PrivateCellUtil.setSequenceId(c, sequenceId); return c; }