mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
fix(kinesis): handle minimum partition key hash (#2950)
* fix(kinesis): handle minimum partition key hash * fix(kinesis): preserve negative hash shard routing
This commit is contained in:
1 parent
82ee3605c8
commit
30b8f88467
2 files changed
+48
-1
No files matched your search
@@ -766,7 +766,7 @@ public class KinesisService implements ResourceProvider {
|
||||
|
||||
private KinesisShard selectShard(KinesisStream stream, String partitionKey) {
|
||||
// Simple hash-based shard selection among ALL shards, then resolve to open one
|
||||
int index = Math.abs(partitionKey.hashCode()) % stream.getShards().size();
|
||||
int index = (int) (Math.abs((long) partitionKey.hashCode()) % stream.getShards().size());
|
||||
KinesisShard shard = stream.getShards().get(index);
|
||||
|
||||
// If closed, find the first open child (simplified)
|
||||
|
||||
Reference in new issue
Block a user