@Override protected void storeBlock(Transaction t, long id, long blockNumber, final byte[] block) { Preconditions.checkArgument(block.length <= BLOCK_SIZE_IN_BYTES, "Block to store in DB must be less than BLOCK_SIZE_IN_BYTES"); final SnapshotsStreamValueTable.SnapshotsStreamValueRow row = SnapshotsStreamValueTable.SnapshotsStreamValueRow.of(id, blockNumber); try { // Do a touch operation on this table to ensure we get a conflict if someone cleans it up. touchMetadataWhileStoringForConflicts(t, row.getId(), row.getBlockId()); tables.getSnapshotsStreamValueTable(t).putValue(row, block); } catch (RuntimeException e) { log.error("Error storing block {} for stream id {}", row.getBlockId(), row.getId(), e); throw e; } }
@Override protected void storeBlock(Transaction t, long id, long blockNumber, final byte[] block) { Preconditions.checkArgument(block.length <= BLOCK_SIZE_IN_BYTES, "Block to store in DB must be less than BLOCK_SIZE_IN_BYTES"); final SnapshotsStreamValueTable.SnapshotsStreamValueRow row = SnapshotsStreamValueTable.SnapshotsStreamValueRow.of(id, blockNumber); try { // Do a touch operation on this table to ensure we get a conflict if someone cleans it up. touchMetadataWhileStoringForConflicts(t, row.getId(), row.getBlockId()); tables.getSnapshotsStreamValueTable(t).putValue(row, block); } catch (RuntimeException e) { log.error("Error storing block {} for stream id {}", row.getBlockId(), row.getId(), e); throw e; } }