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