func (m ConcurrentMap) Get(key int) (int64, bool) {
	shard := m.GetShard(key)
	shard.RLock()
	val, ok := shard.items[key]
	shard.RUnlock()
	return val, ok
}
Get retrieves an element from map under given key.
package util
import (
	"encoding/json"
	"sync"
)
type ConcurrentMap struct {
	shards     []*ConcurrentMapShared
	shardCount int
}
type ConcurrentMapShared struct {
	items map[int]int64
	sync.RWMutex  
}
func New(shardCount int) ConcurrentMap {
	m := new(ConcurrentMap)
	m.shardCount = shardCount
	m.shards = make([]*ConcurrentMapShared, shardCount)
	for i := 0; i < shardCount; i++ {
		m.shards[i] = &ConcurrentMapShared{items: make(map[int]int64)}
	}
	return *m
}
func (m ConcurrentMap) GetShard(key int) *ConcurrentMapShared {
	return m.shards[uint(m.fnv32(key))%uint(m.shardCount)]
}
func (m ConcurrentMap) MSet(data map[int]int64) {
	for key, value := range data {
		m.Set(key, value)
	}
}
func (m ConcurrentMap) Set(key int, value int64) {
	shard := m.GetShard(key)
	shard.Lock()
	shard.items[key] = value
	shard.Unlock()
}
type UpsertCb func(exist bool, valueInMap int64, newValue int64) int64
func (m ConcurrentMap) Upsert(key int, value int64, cb UpsertCb) (res int64) {
	shard := m.GetShard(key)
	shard.Lock()
	v, ok := shard.items[key]
	res = cb(ok, v, value)
	shard.items[key] = res
	shard.Unlock()
	return res
}
func (m ConcurrentMap) SetIfAbsent(key int, value int64) bool {
	shard := m.GetShard(key)
	shard.Lock()
	_, ok := shard.items[key]
	if !ok {
		shard.items[key] = value
	}
	shard.Unlock()
	return !ok
}