MCPcopy
hub / github.com/etcd-io/etcd / LockWriteOps

Method LockWriteOps

client/v3/leasing/cache.go:85–107  ·  view source on GitHub ↗
(ops []v3.Op)

Source from the content-addressed store, hash-verified

83}
84
85func (lc *leaseCache) LockWriteOps(ops []v3.Op) (ret []chan<- struct{}) {
86 for _, op := range ops {
87 if op.IsGet() {
88 continue
89 }
90 key := string(op.KeyBytes())
91 if end := string(op.RangeBytes()); end == "" {
92 if wc, _ := lc.Lock(key); wc != nil {
93 ret = append(ret, wc)
94 }
95 } else {
96 for k := range lc.entries {
97 if !inRange(k, key, end) {
98 continue
99 }
100 if wc, _ := lc.Lock(k); wc != nil {
101 ret = append(ret, wc)
102 }
103 }
104 }
105 }
106 return ret
107}
108
109func (lc *leaseCache) NotifyOps(ops []v3.Op) (wcs []<-chan struct{}) {
110 for _, op := range ops {

Callers 1

serverTxnMethod · 0.80

Calls 5

LockMethod · 0.95
inRangeFunction · 0.85
IsGetMethod · 0.80
RangeBytesMethod · 0.80
KeyBytesMethod · 0.45

Tested by

no test coverage detected