Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Resolved
-
3.0.0-alpha3
-
None
Description
Problem
There are use cases that suppose retrieving configuration entities by id. For example retrieving table by id. The only option now is to get all tables with further iteration that will check whether a table id matches expected one. Things get worse if it's required to get table by id from remote node, e.g.
private boolean isTableConfigured(IgniteUuid id) { NamedListView<TableView> directTablesCfg = ((DirectConfigurationProperty<NamedListView<TableView>>)tablesCfg.tables()).directValue(); // TODO: IGNITE-15721 Need to review this approach after the ticket would be fixed. // Probably, it won't be required getting configuration of all tables from Metastor. for (String name : directTablesCfg.namedListKeys()) { ExtendedTableView tView = (ExtendedTableView)directTablesCfg.get(name); if (tView != null && id.equals(IgniteUuid.fromString(tView.id()))) return true; } return false; }
It worth to mention that sometimes, for example in use case mentioned above, exact data aren't needed, cause only fact of data absence is important. In other words It'll be great not only to have ability to retrieve tables, columns, indexes and other named list items by id (in addition to retrieving by name) but also check whether required entity exists or not. Both local and direct use cases are important.
Attachments
Issue Links
- links to