public void enqueue(List<WriteInfo> allWrites) { Map<Cell, byte[]> referencesToDedicatedCells = new HashMap<>(); Map<Cell, byte[]> cellsToWrite = new HashMap<>(); Map<PartitionInfo, List<WriteInfo>> partitionedWrites = partitioner.filterAndPartition(allWrites); partitionedWrites.forEach((partitionInfo, writes) -> { referencesToDedicatedCells.putAll(populateReferences(partitionInfo, writes)); cellsToWrite.putAll(populateCells(partitionInfo, writes)); }); partitionedWrites.keySet().stream() .map(PartitionInfo::timestamp) .mapToLong(x -> x) .max() .ifPresent(timestamp -> { write(referencesToDedicatedCells, timestamp); write(cellsToWrite, timestamp); updateWriteMetrics(partitionedWrites); }); }
public void enqueue(List<WriteInfo> allWrites) { Map<Cell, byte[]> referencesToDedicatedCells = new HashMap<>(); Map<Cell, byte[]> cellsToWrite = new HashMap<>(); Map<PartitionInfo, List<WriteInfo>> partitionedWrites = partitioner.filterAndPartition(allWrites); partitionedWrites.forEach((partitionInfo, writes) -> { referencesToDedicatedCells.putAll(populateReferences(partitionInfo, writes)); cellsToWrite.putAll(populateCells(partitionInfo, writes)); }); partitionedWrites.keySet().stream() .map(PartitionInfo::timestamp) .mapToLong(x -> x) .max() .ifPresent(timestamp -> { write(referencesToDedicatedCells, timestamp); write(cellsToWrite, timestamp); updateWriteMetrics(partitionedWrites); }); }