Minor refactoring for HashPartitionService
This commit is contained in:
parent
9e408cd6f3
commit
0812149524
@ -526,10 +526,7 @@ public class HashPartitionService implements PartitionService {
|
||||
servers = responsible;
|
||||
}
|
||||
|
||||
int hash = hashFunction.newHasher()
|
||||
.putLong(tenantId.getId().getMostSignificantBits())
|
||||
.putLong(tenantId.getId().getLeastSignificantBits())
|
||||
.hash().asInt();
|
||||
int hash = hash(tenantId.getId());
|
||||
return servers.get(Math.abs((hash + partition) % servers.size()));
|
||||
} else {
|
||||
return servers.get(partition % servers.size());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user