comply with coding style
This commit is contained in:
parent
fa3fd729d1
commit
92ca7aee12
1 changed files with 4 additions and 3 deletions
|
|
@ -122,9 +122,10 @@ class Stream(BaseModel):
|
||||||
self.tags = {}
|
self.tags = {}
|
||||||
|
|
||||||
step = 2**128 // shard_count
|
step = 2**128 // shard_count
|
||||||
for index, start, end in itertools.chain(
|
hash_ranges = itertools.chain(map(lambda i: (i, i * step, (i + 1) * step),
|
||||||
map(lambda i: (i, i*step, (i+1) * step), range(shard_count - 1)),
|
range(shard_count - 1)),
|
||||||
[(shard_count - 1, (shard_count -1) * step, 2**128)]):
|
[(shard_count - 1, (shard_count - 1) * step, 2**128)])
|
||||||
|
for index, start, end in hash_ranges:
|
||||||
|
|
||||||
shard = Shard(index, start, end)
|
shard = Shard(index, start, end)
|
||||||
self.shards[shard.shard_id] = shard
|
self.shards[shard.shard_id] = shard
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue