Example usage for java.util.concurrent ConcurrentNavigableMap putAll

List of usage examples for java.util.concurrent ConcurrentNavigableMap putAll

Introduction

In this page you can find the example usage for java.util.concurrent ConcurrentNavigableMap putAll.

Prototype

void putAll(Map<? extends K, ? extends V> m);

Source Link

Document

Copies all of the mappings from the specified map to this map (optional operation).

Usage

From source file:com.palantir.atlasdb.transaction.impl.SerializableTransaction.java

private void markRangeRead(String table, RangeRequest range, List<RowResult<byte[]>> result) {
    if (!isSerializableTable(table)) {
        return;/*w  w  w.j av  a  2s  . c  om*/
    }
    ConcurrentNavigableMap<Cell, byte[]> reads = getReadsForTable(table);
    for (RowResult<byte[]> row : result) {
        Map<Cell, byte[]> map = Maps2.fromEntries(row.getCells());
        map = transformGetsForTesting(map);
        reads.putAll(map);
    }
    setRangeEnd(table, range, result.get(result.size() - 1).getRowName());
}

From source file:com.palantir.atlasdb.transaction.impl.SerializableTransaction.java

private void markRowsRead(String table, Iterable<byte[]> rows, ColumnSelection cols,
        Iterable<RowResult<byte[]>> result) {
    if (!isSerializableTable(table)) {
        return;//from  w  ww  .j a  va  2  s  .co m
    }
    ConcurrentNavigableMap<Cell, byte[]> reads = getReadsForTable(table);
    for (RowResult<byte[]> row : result) {
        Map<Cell, byte[]> map = Maps2.fromEntries(row.getCells());
        map = transformGetsForTesting(map);
        reads.putAll(map);
    }
    Set<RowRead> rowReads = rowsRead.get(table);
    if (rowReads == null) {
        rowsRead.putIfAbsent(table, Sets.<RowRead>newConcurrentHashSet());
        rowReads = rowsRead.get(table);
    }
    rowReads.add(new RowRead(rows, cols));
}