Example #1
0
func (b Bucket) getConnPools() []*connectionPool {
	if b.connPools != nil {
		return *(*[]*connectionPool)(atomic.LoadPointer(&b.connPools))
	} else {
		return nil
	}
}
Example #2
0
// this version of replaceConnPools will not close the pools that are being reused
func (b *Bucket) replaceConnPools2(with []*connectionPool) {
	for {
		old := atomic.LoadPointer(&b.connPools)
		if atomic.CompareAndSwapPointer(&b.connPools, old, unsafe.Pointer(&with)) {
			if old != nil {
				for _, pool := range *(*[]*connectionPool)(old) {
					if pool != nil && pool.inUse == false {
						pool.Close()
					}
				}
			}
			return
		}
	}
}
Example #3
0
// Nodes returns teh current list of nodes servicing this bucket.
func (b Bucket) Nodes() []Node {
	return *(*[]Node)(atomic.LoadPointer(&b.nodeList))
}
Example #4
0
// VBServerMap returns the current VBucketServerMap.
func (b *Bucket) VBServerMap() *VBucketServerMap {
	return (*VBucketServerMap)(atomic.LoadPointer(&(b.vBucketServerMap)))
}
Example #5
0
func (b Bucket) getConnPools() []*connectionPool {
	return *(*[]*connectionPool)(atomic.LoadPointer(&b.connPools))
}
Example #6
0
// Nodes returns teh current list of nodes servicing this bucket.
func (b Bucket) Nodes() []Node {
	b.nodeListLock.RLock()
	defer b.nodeListLock.RUnlock()
	return *(*[]Node)(atomic.LoadPointer(&b.nodeList))
}