Example usage for java.util.concurrent ConcurrentSkipListMap put

List of usage examples for java.util.concurrent ConcurrentSkipListMap put

Introduction

In this page you can find the example usage for java.util.concurrent ConcurrentSkipListMap put.

Prototype

public V put(K key, V value) 

Source Link

Document

Associates the specified value with the specified key in this map.

Usage

From source file:com.palantir.atlasdb.keyvalue.impl.InMemoryKeyValueService.java

@Override
public void addGarbageCollectionSentinelValues(String tableName, Set<Cell> cells) {
    ConcurrentSkipListMap<Key, byte[]> table = getTableMap(tableName).entries;
    for (Cell cell : cells) {
        table.put(new Key(cell, Value.INVALID_VALUE_TIMESTAMP), ArrayUtils.EMPTY_BYTE_ARRAY);
    }/*from w  w w. ja v  a  2  s . c o  m*/
}

From source file:org.apache.hadoop.hbase.client.coprocessor.TimeseriesAggregationClient.java

/**
 * This is the client side interface/handle for calling the average method for a given cf-cq
 * combination. It was necessary to add one more call stack as its return type should be a decimal
 * value, irrespective of what columninterpreter says. So, this methods collects the necessary
 * parameters to compute the average and returs the double value.
 * @param table/*from  w  ww  .j  a v a 2 s .  co  m*/
 * @param ci
 * @param scan
 * @return <R, S>
 * @throws Throwable
 */
public <R, S, P extends Message, Q extends Message, T extends Message> ConcurrentSkipListMap<Long, Double> avg(
        final HTable table, final ColumnInterpreter<R, S, P, Q, T> ci, Scan scan) throws Throwable {
    ConcurrentSkipListMap<Long, Pair<S, Long>> p = getAvgArgs(table, ci, scan);
    ConcurrentSkipListMap<Long, Double> avg = new ConcurrentSkipListMap<Long, Double>();
    for (Map.Entry<Long, Pair<S, Long>> entry : p.entrySet()) {
        avg.put(entry.getKey(), ci.divideForAvg(entry.getValue().getFirst(), entry.getValue().getSecond()));
    }
    return avg;
}

From source file:org.apache.hadoop.hbase.coprocessor.client.TimeseriesAggregationClient.java

/**
 * This is the client side interface/handle for calling the average method for a given cf-cq
 * combination. It was necessary to add one more call stack as its return type should be a decimal
 * value, irrespective of what columninterpreter says. So, this methods collects the necessary
 * parameters to compute the average and returs the double value.
 * @param table//from  ww w .java  2  s .  c o  m
 * @param ci
 * @param scan
 * @return <R, S>
 * @throws Throwable
 */
public <R, S, P extends Message, Q extends Message, T extends Message> ConcurrentSkipListMap<Long, Double> avg(
        final Table table, final ColumnInterpreter<R, S, P, Q, T> ci, Scan scan) throws Throwable {
    ConcurrentSkipListMap<Long, Pair<S, Long>> p = getAvgArgs(table, ci, scan);
    ConcurrentSkipListMap<Long, Double> avg = new ConcurrentSkipListMap<Long, Double>();
    for (Map.Entry<Long, Pair<S, Long>> entry : p.entrySet()) {
        avg.put(entry.getKey(), ci.divideForAvg(entry.getValue().getFirst(), entry.getValue().getSecond()));
    }
    return avg;
}