Beispiel #1
0
// constructor of storage server
func NewStorageserver(master string, numnodes int, portnum int, nodeid uint32) *Storageserver {
	ss := &Storageserver{storage.NewTribMap(), newLeaseMap(), newCacheMap(),
		nil, make(map[uint32]*serverData), numnodes,
		storageproto.Client{"", nodeid}, sync.NewCond(&sync.Mutex{}), master}
	return ss
}
Beispiel #2
0
func newCacheMap() *CacheMap { // constructor of cache map
	cm := &CacheMap{cache: storage.NewTribMap(), cacheInfo: make(map[string]*cacheData)}
	return cm
}