forked from hugegraph/hugegraph-sync
refact: enhance cache invalidation of the partition -> leader shard in ClientCache (#2588)
This commit is contained in:
parent
bd83741f24
commit
85e096698a
|
|
@ -275,6 +275,7 @@ public class ClientCache {
|
|||
groups = new ConcurrentHashMap<>();
|
||||
stores = new ConcurrentHashMap<>();
|
||||
caches = new ConcurrentHashMap<>();
|
||||
initialized.set(false);
|
||||
}
|
||||
|
||||
public Shard getLeader(int partitionId) {
|
||||
|
|
|
|||
|
|
@ -461,7 +461,9 @@ public class PDClient {
|
|||
*/
|
||||
public KVPair<Metapb.Partition, Metapb.Shard> getPartition(String graphName, byte[] key) throws
|
||||
PDException {
|
||||
KVPair<Metapb.Partition, Metapb.Shard> partShard = cache.getPartitionByKey(graphName, key);
|
||||
|
||||
KVPair<Metapb.Partition, Metapb.Shard> partShard =
|
||||
this.getPartitionByCode(graphName, PartitionUtils.calcHashcode(key));
|
||||
partShard = getKvPair(graphName, key, partShard);
|
||||
return partShard;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue