xp
xp copied to clipboard
NodeId and NodePath are excess in NodeVersion fetching methods
To refactor and deprecate.
Methods like:
NodeService.getByIdAndVersionId NodeStorageService.get NodeStorageService.getNode NodeStorageService.getVersion
Classes like: GetNodeByIdAndVersionIdCommand
Reasons:
After work on #9205 it became evident that a few methods with NodeVersion
parameter also require NodeId
that is only used for ES routing. Routing is worthless when there is only one shard per index - like in our case. (exception is parent/child index, when parent is not known, but we can use ANY routing, it will still land on the same single shard)
- Sometimes
NodeId
is not known and methods that need to call such method do a worthless query trying to guess correct NodeId. -
NodeStorageService.get
andNodeStorageService.getNode
are very similar, butget
also requests branchService, to construct a bogus node with "previous" data but some fields overridden with "current" values. It is confusing, especially because method is called "get" and may be used incorrectly.
NodeService.getByIdAndVersionId
should still require NodeId (on high level we need to be sure NodeVersion has correct NodeId)
The rest of the methods will be cleaned up in #9930