public void append(DecoratedKey decoratedKey, ColumnFamily cf) { if (decoratedKey.getKey().remaining() > FBUtilities.MAX_UNSIGNED_SHORT) { logger.error("Key size {} exceeds maximum of {}, skipping row", decoratedKey.getKey().remaining(), FBUtilities.MAX_UNSIGNED_SHORT); return; } long startPosition = beforeAppend(decoratedKey); long endPosition; try { RowIndexEntry entry = rawAppend(cf, startPosition, decoratedKey, dataFile.stream); endPosition = dataFile.getFilePointer(); afterAppend(decoratedKey, endPosition, entry); } catch (IOException e) { throw new FSWriteError(e, dataFile.getPath()); } long rowSize = endPosition - startPosition; maybeLogLargePartitionWarning(decoratedKey, rowSize); sstableMetadataCollector.update(rowSize, cf.getColumnStats()); }
/** * @param row * @return null if the row was compacted away entirely; otherwise, the PK index entry for this row */ public RowIndexEntry append(AbstractCompactedRow row) { long startPosition = beforeAppend(row.key); RowIndexEntry entry; try { entry = row.write(startPosition, dataFile.stream); if (entry == null) return null; } catch (IOException e) { throw new FSWriteError(e, dataFile.getPath()); } long endPosition = dataFile.getFilePointer(); long rowSize = endPosition - startPosition; maybeLogLargePartitionWarning(row.key, rowSize); sstableMetadataCollector.update(rowSize, row.columnStats()); afterAppend(row.key, endPosition, entry); return entry; }
.updateMaxColumnNames(maxColumnNames) .updateHasLegacyCounterShards(hasLegacyCounterShards); afterAppend(key, currentPosition, RowIndexEntry.create(currentPosition, cf.deletionInfo().getTopLevelDeletion(), columnIndexer.build())); return currentPosition;