nebula-java
nebula-java copied to clipboard
The storage leader address for the partition of metaManager cache does not look correct
对应代码:https://github.com/vesoft-inc/nebula-java/blob/3518faa8444c1f590fba92d7f7c66946ad696852/client/src/main/java/com/vesoft/nebula/client/meta/MetaManager.java#L114
GetPartsAllocReq返回的分区信息无法确定哪个host是leader吧?代码取了第一个,对比 ListHosts 返回的 LeaderParts,第一个并不是 Leader Host。我是参考这里的 https://github.com/vesoft-inc/nebula-common/blob/master/src/common/clients/meta/MetaClient.cpp#L3189
另外 StorageClient 目前只有 scanXXX 接口,有无计划补全剩下的接口?
对应代码:
https://github.com/vesoft-inc/nebula-java/blob/3518faa8444c1f590fba92d7f7c66946ad696852/client/src/main/java/com/vesoft/nebula/client/meta/MetaManager.java#L114
GetPartsAllocReq返回的分区信息无法确定哪个host是leader吧?代码取了第一个,对比 ListHosts 返回的 LeaderParts,第一个并不是 Leader Host。我是参考这里的 https://github.com/vesoft-inc/nebula-common/blob/master/src/common/clients/meta/MetaClient.cpp#L3189
另外 StorageClient 目前只有 scanXXX 接口,有无计划补全剩下的接口?
- GetPartsAlloc just returns the hosts of part, we cann't know which one is the leaser host. The leader host is generated by caller's retry. If the host is not leader, then the response will has
LEADER_CHANGEerror code, and the true leader will be contained in response. Refer https://github.com/vesoft-inc/nebula-java/blob/3518faa8444c1f590fba92d7f7c66946ad696852/client/src/main/java/com/vesoft/nebula/client/storage/scan/ScanVertexResultIterator.java#L177 - For now, we don't have plan to support more operation interfaces. Thanks for your attention.
Oh, I see. Why not use ListHosts to get the right storage leaser host of part in initialization like cpp client to reduce one possible failed request? Because of compatibility?
Oh, I see. Why not use ListHosts to get the right storage leaser host of part in initialization like cpp client to reduce one possible failed request? Because of compatibility?
Yeah, it's a meaning point. When develop the scan process, we use the habitual positive thinking to get part's hosts. And you're right, using listHosts will be more effective.