Implement indexing into Apache Druid #1
|
@ -60,6 +60,14 @@ def getChanFree(net, new):
|
||||||
return False
|
return False
|
||||||
return (chanfree, chanlimits.pop())
|
return (chanfree, chanlimits.pop())
|
||||||
|
|
||||||
|
def getTotalChans(net):
|
||||||
|
total = 0
|
||||||
|
for i in getActiveRelays(net):
|
||||||
|
name = net + str(i)
|
||||||
|
if name in main.IRCPool.keys():
|
||||||
|
total += len(main.IRCPool[name].channels)
|
||||||
|
return total
|
||||||
|
|
||||||
|
|
||||||
def emptyChanAllocate(net, flist, new):
|
def emptyChanAllocate(net, flist, new):
|
||||||
chanfree = getChanFree(net, new)
|
chanfree = getChanFree(net, new)
|
||||||
|
@ -161,7 +169,11 @@ def keepChannels(net, listinfo, mean, sigrelay, relay, chanlimit):
|
||||||
error("Network %s is too big to cover: %i relays required" % (net, sigrelay))
|
error("Network %s is too big to cover: %i relays required" % (net, sigrelay))
|
||||||
return
|
return
|
||||||
num_instances = len(getActiveRelays(net))
|
num_instances = len(getActiveRelays(net))
|
||||||
max_chans = chanlimit * num_instances
|
debug(f"keepChannels() {net} instances:{num_instances} chanlimit:{chanlimit}")
|
||||||
|
chan_slots_used = getTotalChans(net)
|
||||||
|
debug(f"keepChannels() slots_used:{chan_slots_used}")
|
||||||
|
max_chans = (chanlimit * num_instances) - chan_slots_used
|
||||||
|
debug(f"keepChannels() max_chans:{max_chans}")
|
||||||
if coverAll:
|
if coverAll:
|
||||||
needed = relay - len(getActiveRelays(net))
|
needed = relay - len(getActiveRelays(net))
|
||||||
debug(f"keepChannels() coverAll asking to provision {needed} relays for {net} relay:{relay}")
|
debug(f"keepChannels() coverAll asking to provision {needed} relays for {net} relay:{relay}")
|
||||||
|
|
Loading…
Reference in New Issue