Uploaded image for project: 'IGB'
  1. IGB
  2. IGBF-1225

Improve load priority settings for user-supplied data providers

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:

      Description

      All user-added data providers are added with a load priority of -1.
      This is a problem because there is no logic for handling ties when displaying (and using) load priority settings.

        Attachments

          Issue Links

            Activity

            ieclabau Ivory Blakley (Inactive) created issue -
            ieclabau Ivory Blakley (Inactive) made changes -
            Field Original Value New Value
            Link This issue relates to IGBF-1220 [ IGBF-1220 ]
            ieclabau Ivory Blakley (Inactive) made changes -
            Link This issue relates to IGBF-1221 [ IGBF-1221 ]
            ieclabau Ivory Blakley (Inactive) made changes -
            Link This issue relates to IGBF-1219 [ IGBF-1219 ]
            ieclabau Ivory Blakley (Inactive) made changes -
            Rank Ranked higher
            ieclabau Ivory Blakley (Inactive) made changes -
            Summary All new data providers have the same load priority All user-supplied data providers have the same load prior
            ieclabau Ivory Blakley (Inactive) made changes -
            Summary All user-supplied data providers have the same load prior All user-supplied data providers have the same load priority
            Hide
            ieclabau Ivory Blakley (Inactive) added a comment -

            A potential solution:

            There is a sort function for the data providers.
            --Add code to that function to renumber the load priorities after sorting.
            --make sure the sort function is called any time the set is modified and when the set is first called (ie, to populate the table)

            This sort and re-number cycle will usually have no affect, but it will smooth out all of the cases where multiple data providers have the same load priority. If each new user-added data provider is added with a load priority of -1, and the set is immediately sorted and re-numbered, the -1 will become 0 and all other data providers will have subsequent unique consecutive load priority values.

            The only hazard this can make is in the initial loading phase. We must NOT re-number the load priorities until IGB has read all of the data providers into the set.

            Show
            ieclabau Ivory Blakley (Inactive) added a comment - A potential solution: There is a sort function for the data providers. --Add code to that function to renumber the load priorities after sorting. --make sure the sort function is called any time the set is modified and when the set is first called (ie, to populate the table) This sort and re-number cycle will usually have no affect, but it will smooth out all of the cases where multiple data providers have the same load priority. If each new user-added data provider is added with a load priority of -1, and the set is immediately sorted and re-numbered, the -1 will become 0 and all other data providers will have subsequent unique consecutive load priority values. The only hazard this can make is in the initial loading phase. We must NOT re-number the load priorities until IGB has read all of the data providers into the set.
            Hide
            ann.loraine Ann Loraine added a comment - - edited

            Before changing this function, understand at a deep level how the load priority setting is being used (a) to retrieve sequence from the available data providers and (2) modify the user interface.

            Show
            ann.loraine Ann Loraine added a comment - - edited Before changing this function, understand at a deep level how the load priority setting is being used (a) to retrieve sequence from the available data providers and (2) modify the user interface.
            Hide
            ieclabau Ivory Blakley (Inactive) added a comment - - edited

            I think the optimal place to insert the code to re-number load priorities would be in the com.affymetrix.igb.general package in the file:
            DataProviderTableModel.java.

            The new code should probably go in the sortDataSources function. If that function is called overly often (at times when we might not want to re-number the load priorities) then the re-number can be its own function, probably still in that file and it would start by calling the sortDataSources. Before implementing this change, we would need to get a complete view of where sortDataSources is called.

            public void sortDataSources()

            { sortedDataProviders = Lists.newArrayList(DataProviderManager.getAllServers()); Collections.sort(sortedDataProviders, new DataProviderComparator()); ThreadUtils.runOnEventQueue(() -> fireTableDataChanged()); }

            This code is not run until the Data Sources table is opened (so we will probably avoid colliding with the initial start-up period where only some of the data providers have been loaded). Since the Data Sources table is the only place where a user can change the load priority of the data providers, this is an optimal place for code that ensures the functionality of that feature.

            The code that is executed when the up/down buttons are pressed is spelled out in DataProviderManaementGui.java, in the functions initLoadPriorityUpBtn and initLoadPriorityDownBtn respectively. Each of these calls the sortDataSources function.
            So if the re-numbering is part of sort, then its already set to be triggered by these events.

            We also need to make sure the re-numbering code is triggered by the adding or removing a data provider.

            The add function is handled by the AddDataProvider class though a function called addServerButtonActionPerformed. The code to remove a data provider is in the DataProviderManager class in a function called: removeDataProvider.
            Both end with this call:
            eventBus.post(new DataProviderServiceChangeEvent());

            I don't know how this DataProviderServiceChangeEvent object works, but I think it might be helpful. If this is meant to signal that the set of data providers has changed, then we need to find whatever code it triggers and make sure our sort and re-number code in triggered by it. Something like that would be cleaner than adding code to each function to call the sort function.

            Show
            ieclabau Ivory Blakley (Inactive) added a comment - - edited I think the optimal place to insert the code to re-number load priorities would be in the com.affymetrix.igb.general package in the file: DataProviderTableModel.java. The new code should probably go in the sortDataSources function. If that function is called overly often (at times when we might not want to re-number the load priorities) then the re-number can be its own function, probably still in that file and it would start by calling the sortDataSources. Before implementing this change, we would need to get a complete view of where sortDataSources is called. public void sortDataSources() { sortedDataProviders = Lists.newArrayList(DataProviderManager.getAllServers()); Collections.sort(sortedDataProviders, new DataProviderComparator()); ThreadUtils.runOnEventQueue(() -> fireTableDataChanged()); } This code is not run until the Data Sources table is opened (so we will probably avoid colliding with the initial start-up period where only some of the data providers have been loaded). Since the Data Sources table is the only place where a user can change the load priority of the data providers, this is an optimal place for code that ensures the functionality of that feature. The code that is executed when the up/down buttons are pressed is spelled out in DataProviderManaementGui.java, in the functions initLoadPriorityUpBtn and initLoadPriorityDownBtn respectively. Each of these calls the sortDataSources function. So if the re-numbering is part of sort, then its already set to be triggered by these events. We also need to make sure the re-numbering code is triggered by the adding or removing a data provider. The add function is handled by the AddDataProvider class though a function called addServerButtonActionPerformed. The code to remove a data provider is in the DataProviderManager class in a function called: removeDataProvider. Both end with this call: eventBus.post(new DataProviderServiceChangeEvent()); I don't know how this DataProviderServiceChangeEvent object works, but I think it might be helpful. If this is meant to signal that the set of data providers has changed, then we need to find whatever code it triggers and make sure our sort and re-number code in triggered by it. Something like that would be cleaner than adding code to each function to call the sort function.
            ann.loraine Ann Loraine made changes -
            Assignee Ann Loraine [ aloraine ]
            ann.loraine Ann Loraine made changes -
            Summary All user-supplied data providers have the same load priority Improve load priority settings for user-supplied data providers y
            ann.loraine Ann Loraine made changes -
            Summary Improve load priority settings for user-supplied data providers y Improve load priority settings for user-supplied data providers
            ann.loraine Ann Loraine made changes -
            Description All user-added data providers are added with a load priority of -1.
            This is a problem for the system when it tries to change the load priorities. the system expects the load priority to produce an exact order, but if several data providers have the same value, that order is not well defined.
            All user-added data providers are added with a load priority of -1.
            This is a problem because there is no logic for handling ties when displaying (and using) load priority settings.
            ann.loraine Ann Loraine made changes -
            Priority Major [ 3 ] Minor [ 4 ]
            ann.loraine Ann Loraine made changes -
            Labels Advanced
            ann.loraine Ann Loraine made changes -
            Workflow Loraine Lab Workflow [ 17908 ] Fall 2019 Workflow Update [ 18837 ]
            ann.loraine Ann Loraine made changes -
            Workflow Fall 2019 Workflow Update [ 18837 ] Revised Fall 2019 Workflow Update [ 20962 ]
            Status Open [ 1 ] To-Do [ 10305 ]
            ann.loraine Ann Loraine made changes -
            Status To-Do [ 10305 ] In Progress [ 3 ]
            ann.loraine Ann Loraine made changes -
            Status In Progress [ 3 ] Needs 1st Level Review [ 10005 ]
            ann.loraine Ann Loraine made changes -
            Status Needs 1st Level Review [ 10005 ] First Level Review in Progress [ 10301 ]
            ann.loraine Ann Loraine made changes -
            Status First Level Review in Progress [ 10301 ] Ready for Pull Request [ 10304 ]
            ann.loraine Ann Loraine made changes -
            Status Ready for Pull Request [ 10304 ] Pull Request Submitted [ 10101 ]
            ann.loraine Ann Loraine made changes -
            Status Pull Request Submitted [ 10101 ] Reviewing Pull Request [ 10303 ]
            ann.loraine Ann Loraine made changes -
            Status Reviewing Pull Request [ 10303 ] Merged Needs Testing [ 10002 ]
            ann.loraine Ann Loraine made changes -
            Status Merged Needs Testing [ 10002 ] Post-merge Testing In Progress [ 10003 ]
            ann.loraine Ann Loraine made changes -
            Resolution Done [ 10000 ]
            Status Post-merge Testing In Progress [ 10003 ] Closed [ 6 ]
            ann.loraine Ann Loraine made changes -
            Assignee Ann Loraine [ aloraine ]

              People

              • Assignee:
                ann.loraine Ann Loraine
                Reporter:
                ieclabau Ivory Blakley (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: