RefDoubleHashMap

com.netflix.atlas.core.util.RefDoubleHashMap
class RefDoubleHashMap[T <: AnyRef](capacity: Int)

Mutable reference to double map based on open-addressing. Primary use-case is computing an aggregate double value based on a key.

Value parameters

capacity

Initial capacity guideline. The actual size of the underlying buffer will be the next prime >= capacity. Default is 10.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def add(k: T, amount: Double): Unit

Add amount to the value associated with k. If the key is not already in the map a new entry will be created with a value of amount.

Add amount to the value associated with k. If the key is not already in the map a new entry will be created with a value of amount.

Attributes

def foreach(f: (T, Double) => Unit): Unit

Execute f for each item in the set.

Execute f for each item in the set.

Attributes

def get(k: T, dflt: Double): Double

Get the value associated with key, k. If no value is present, then the dflt value will be returned.

Get the value associated with key, k. If no value is present, then the dflt value will be returned.

Attributes

def mapToArray[R](buffer: Array[R])(f: (T, Double) => R): Array[R]

Apply a mapping function f and converts the result to an array.

Apply a mapping function f and converts the result to an array.

Attributes

def max(k: T, amount: Double): Unit

Compute max amount and the value associated with k. If the key is not already in the map a new entry will be created with a value of amount.

Compute max amount and the value associated with k. If the key is not already in the map a new entry will be created with a value of amount.

Attributes

def min(k: T, amount: Double): Unit

Compute min amount and the value associated with k. If the key is not already in the map a new entry will be created with a value of amount.

Compute min amount and the value associated with k. If the key is not already in the map a new entry will be created with a value of amount.

Attributes

def put(k: T, v: Double): Unit

Put a ref to integer pair into the map. The key, k, should not be equivalent to the noData value used for this map. If an entry with the same key already exists, then the value will be overwritten.

Put a ref to integer pair into the map. The key, k, should not be equivalent to the noData value used for this map. If an entry with the same key already exists, then the value will be overwritten.

Attributes

def putIfAbsent(k: T, v: Double): Boolean

Put ref to integer pair into the map if there is not already a mapping for k. Returns true if the value was inserted into the map.

Put ref to integer pair into the map if there is not already a mapping for k. Returns true if the value was inserted into the map.

Attributes

def size: Int

Return the number of items in the set. This is a constant time operation.

Return the number of items in the set. This is a constant time operation.

Attributes

def toMap: Map[T, Double]

Converts this set to a Map[T, Int]. Used mostly for debugging and tests.

Converts this set to a Map[T, Int]. Used mostly for debugging and tests.

Attributes