Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-15721

Effective way of retrieving ​​tables by id.

    XMLWordPrintableJSON

Details

    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

          Activity

            People

              ktkalenko@gridgain.com Kirill Tkalenko
              alapin Alexander Lapin
              Semyon Danilov Semyon Danilov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 20m
                  2h 20m