Implement indexing into Apache Druid #1

Closed
m wants to merge 263 commits from druid into master
1 changed files with 13 additions and 1 deletions
Showing only changes of commit 14967f662c - Show all commits

View File

@ -60,6 +60,14 @@ def getChanFree(net, new):
return False
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):
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))
return
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:
needed = relay - len(getActiveRelays(net))
debug(f"keepChannels() coverAll asking to provision {needed} relays for {net} relay:{relay}")