Source:
<code>public void finishDelete(ConnectorSession session, ConnectorTableHandle tableHandle, Collection<Slice> fragments) { RaptorTableHandle table = (RaptorTableHandle) tableHandle; long transactionId = table.getTransactionId().getAsLong(); long tableId = table.getTableId(); List<ColumnInfo> columns = getColumnHandles(session, tableHandle).values().stream() .map(RaptorColumnHandle.class::cast) .map(ColumnInfo::fromHandle).collect(toList()); if (table.isTableSupportsDeltaDelete()) { <START> ImmutableMap.Builder<UUID, DeltaInfoPair> shardMapBuilder = new ImmutableMap.Builder<>(); <END> fragments.stream() .map(fragment -> SHARD_DELETE_DELTA_CODEC.fromJson(fragment.getBytes())) .forEach(delta -> shardMapBuilder.put(delta.getOldShardUuid(), delta.getDeltaInfoPair())); OptionalLong updateTime = OptionalLong.of(session.getStartTime()); log.info("Finishing delete for tableId %s (affected shardUuid: %s)", tableId, shardMapBuilder.build().size()); shardManager.replaceDeltaUuids(transactionId, tableId, columns, shardMapBuilder.build(), updateTime); } else { ImmutableSet.Builder<UUID> oldShardUuidsBuilder = ImmutableSet.builder(); ImmutableList.Builder<ShardInfo> newShardsBuilder = ImmutableList.builder(); fragments.stream() .map(fragment -> SHARD_DELTA_CODEC.fromJson(fragment.getBytes())) .forEach(delta -> { oldShardUuidsBuilder.addAll(delta.getOldShardUuids()); newShardsBuilder.addAll(delta.getNewShards()); }); Set<UUID> oldShardUuids = oldShardUuidsBuilder.build(); List<ShardInfo> newShards = newShardsBuilder.build(); OptionalLong updateTime = OptionalLong.of(session.getStartTime()); log.info("Finishing delete for tableId %s (removed: %s, rewritten: %s)", tableId, oldShardUuids.size() - newShards.size(), newShards.size()); shardManager.replaceShardUuids(transactionId, tableId, columns, oldShardUuids, newShards, updateTime); } clearRollback(); }</code><technical_language>= ImmutableMap.builder();</technical_language>

Target:
public void finishDelete(ConnectorSession session, ConnectorTableHandle tableHandle, Collection<Slice> fragments) { RaptorTableHandle table = (RaptorTableHandle) tableHandle; long transactionId = table.getTransactionId().getAsLong(); long tableId = table.getTableId(); List<ColumnInfo> columns = getColumnHandles(session, tableHandle).values().stream() .map(RaptorColumnHandle.class::cast) .map(ColumnInfo::fromHandle).collect(toList()); if (table.isTableSupportsDeltaDelete()) { ImmutableMap.Builder<UUID, DeltaInfoPair> shardMapBuilder = ImmutableMap.builder(); fragments.stream() .map(fragment -> SHARD_DELETE_DELTA_CODEC.fromJson(fragment.getBytes())) .forEach(delta -> shardMapBuilder.put(delta.getOldShardUuid(), delta.getDeltaInfoPair())); OptionalLong updateTime = OptionalLong.of(session.getStartTime()); log.info("Finishing delete for tableId %s (affected shardUuid: %s)", tableId, shardMapBuilder.build().size()); shardManager.replaceDeltaUuids(transactionId, tableId, columns, shardMapBuilder.build(), updateTime); } else { ImmutableSet.Builder<UUID> oldShardUuidsBuilder = ImmutableSet.builder(); ImmutableList.Builder<ShardInfo> newShardsBuilder = ImmutableList.builder(); fragments.stream() .map(fragment -> SHARD_DELTA_CODEC.fromJson(fragment.getBytes())) .forEach(delta -> { oldShardUuidsBuilder.addAll(delta.getOldShardUuids()); newShardsBuilder.addAll(delta.getNewShards()); }); Set<UUID> oldShardUuids = oldShardUuidsBuilder.build(); List<ShardInfo> newShards = newShardsBuilder.build(); OptionalLong updateTime = OptionalLong.of(session.getStartTime()); log.info("Finishing delete for tableId %s (removed: %s, rewritten: %s)", tableId, oldShardUuids.size() - newShards.size(), newShards.size()); shardManager.replaceShardUuids(transactionId, tableId, columns, oldShardUuids, newShards, updateTime); } clearRollback(); }