alex-plekhanov commented on code in PR #12674:
URL: https://github.com/apache/ignite/pull/12674#discussion_r2744868303
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/metastorage/persistence/DistributedMetaStorageImpl.java:
##########
@@ -324,12 +324,17 @@ public void inMemoryReadyForRead() {
/** */
private void registerSystemView() {
- ctx.systemView().registerView(DISTRIBUTED_METASTORE_VIEW,
DISTRIBUTED_METASTORE_VIEW_DESC,
- new MetastorageViewWalker(), () -> {
+ ctx.systemView().registerFiltrableView(DISTRIBUTED_METASTORE_VIEW,
DISTRIBUTED_METASTORE_VIEW_DESC,
+ new MetastorageViewWalker(), filter -> {
+ String name =
(String)filter.get(MetastorageViewWalker.NAME_FILTER);
+
+ if (name == null)
+ name = "";
+
try {
List<MetastorageView> data = new ArrayList<>();
- iterate("", (key, val) -> data.add(new
MetastorageView(key, val == null || !val.getClass().isArray()
+ iterate(name, (key, val) -> data.add(new
MetastorageView(key, val == null || !val.getClass().isArray()
Review Comment:
We never state that `filter` is for exact match. So, formally, we are not
violating the contract. It can be exect value, for some views, it can be prefix
for another. In SQL, where contract required that filtering return exact value
- there is post filtration based on condition after lookup by filter. So
filtering it's a good way to narrow the scope.
1. I don't know, but I think it's possible.
2. I'm not sure anyone is using iterators direcly, views filtration are made
usually using SQL, in SQL this is not an issue. But ok, I think we can fix it
and make behaviour the same for different views.
Fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]