MCPcopy
hub / github.com/olric-data/olric / fetchRoutingTable

Method fetchRoutingTable

cluster_iterator.go:282–295  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

280}
281
282func (i *ClusterIterator) fetchRoutingTable() error {
283 routingTable, err := i.clusterClient.RoutingTable(i.ctx)
284 if err != nil {
285 return err
286 }
287
288 i.routingTableMtx.Lock()
289 defer i.routingTableMtx.Unlock()
290
291 // Partition count is a constant, actually. It has to be greater than zero.
292 i.partitionCount = uint64(len(routingTable))
293 i.routingTable = routingTable
294 return nil
295}
296
297// Close stops the iteration and releases allocated resources.
298func (i *ClusterIterator) Close() {

Callers 2

ScanMethod · 0.95

Calls 3

RoutingTableMethod · 0.65
LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected