-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Keep the shard ids sorted for logging and api (#147)
* Use SortedMap for in-memory shard state * Use BitSet for assignments and unassignments * Specify SortedMap for shards * Revert and sort on log * Deduplicate sorting of shards, use implementation that works on 2.12 * Format GraphQLApi file
- Loading branch information
Showing
4 changed files
with
22 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
package com.devsisters | ||
|
||
import scala.collection.mutable | ||
|
||
package object shardcake { | ||
type ShardId = Int | ||
type EpochMillis = Long | ||
|
||
private[shardcake] def renderShardIds(ids: Iterable[ShardId]): String = | ||
ids | ||
.foldLeft(mutable.BitSet.empty)(_ += _) | ||
.mkString("[", ", ", "]") | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters