MCPcopy Create free account
hub / github.com/Super-long/ChubbyGo / ChubbyGoMapSet

Method ChubbyGoMapSet

BaseServer/chubbyGoMap.go:80–95  ·  view source on GitHub ↗
(key string, value string)

Source from the content-addressed store, hash-verified

78}
79
80func (hs *ChubbyGoConcurrentMap) ChubbyGoMapSet(key string, value string) {
81 // sync.map在拷贝以后失效
82 if hs.Flag == SyncMap {
83
84 Map := hs.MapEntry.Addr().Interface().(*sync.Map)
85 Map.Store(key, value)
86
87 } else if hs.Flag == ConcurrentMap {
88
89 Map := hs.MapEntry.Addr().Interface().(*ConcurrentHashMap)
90 Map.Set(key, value)
91
92 } else {
93 log.Println("ERROR : ChubbyGoMapSet -> No such situation.")
94 }
95}
96
97func (hs *ChubbyGoConcurrentMap) ChubbyGoMapDelete(key string){
98 if hs.Flag == SyncMap {

Calls 1

SetMethod · 0.80