core / pragma.utils / InstancedConcurrentMap /

InstancedConcurrentMap #

class InstancedConcurrentMap<K : Any, V : Any>(val instanceId: UUID, val routingUtils: RoutingUtils = RoutingUtils.defaultInstance, val serviceInstanceCount: Int, val concurrentHashMap: ConcurrentMap<K, V> = ConcurrentHashMap()) : Iterable<Map.Entry<K, V>>

Map class that validates keys on "put" into the map. This is for the deterministic routing that drives the whole Pragma architecture.

Parameters #

instanceId

The instanceId of the service using this map.

serviceInstanceCount

The total number of instances for the distributed service using this map.

concurrentHashMap

The underlying map data structure for the ValidatingInstanceIdConcurrentHashMap.

routingUtils

The helper class that does the key validation.

Constructors #

InstancedConcurrentMap

fun <K : Any, V : Any> InstancedConcurrentMap(instanceId: UUID, routingUtils: RoutingUtils = RoutingUtils.defaultInstance, serviceInstanceCount: Int, concurrentHashMap: ConcurrentMap<K, V> = ConcurrentHashMap())

Properties #

NameSummary

concurrentHashMap

private val concurrentHashMap: ConcurrentMap<K, V>

instanceId

private val instanceId: UUID

routingUtils

private val routingUtils: RoutingUtils

serviceInstanceCount

private val serviceInstanceCount: Int