Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timer for saved searches #7152

Merged
merged 4 commits into from Aug 6, 2020

Conversation

rtreacy
Copy link
Contributor

@rtreacy rtreacy commented Jul 31, 2020

The timer method wraps the makeLinksForAllSavedSearches in a no-param method returning void with the @schedule annotation.
The timer is sheduled to run once a week on Sunday at 12:30 AM. If we decide a different schedule is better in general, we
should adjust thiis in the code before release. In special cases the schedule can be modified using and ejb-jar.xml file
of the form(for ex Tuesday 2:30 PM) :




SavedSearchServiceBean
edu.harvard.iq.dataverse.search.savedsearch.SavedSearchServiceBean
Stateless


30
14
Tue


makeLinksForAllSavedSearchesTimer




What this PR does / why we need it:

Which issue(s) this PR closes:

Closes #6910

Special notes for your reviewer:

Suggestions on how to test this:

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

Is there a release notes update needed for this change?:

Additional documentation:

The timer method wraps the makeLinksForAllSavedSearches in a no-param method returning void with the @schedule annotation.
The timer is sheduled to run once a week on Sunday at 12:30 AM. If we decide a different schedule is better in general, we
should adjust thiis in the code before release. In special cases the schedule can be modified using and ejb-jar.xml file
of the form(for ex Tuesday 2:30 PM) :

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns = "http://java.sun.com/xml/ns/javaee"
         version = "3.1"
         xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd">
    <enterprise-beans>
        <session>
            <ejb-name>SavedSearchServiceBean</ejb-name>
            <ejb-class>edu.harvard.iq.dataverse.search.savedsearch.SavedSearchServiceBean</ejb-class>
            <session-type>Stateless</session-type>
            <timer>
                <schedule>
                    <minute>30</minute>
                    <hour>14</hour>
                    <day-of-week>Tue</day-of-week>
                </schedule>
                <timeout-method>
                    <method-name>makeLinksForAllSavedSearchesTimer</method-name>
                </timeout-method>
            </timer>
        </session>
    </enterprise-beans>
</ejb-jar>
@coveralls
Copy link

coveralls commented Jul 31, 2020

Coverage Status

Coverage decreased (-0.06%) to 19.544% when pulling f6e3d0f on rtreacy:6910-timer-for-saved-searches into 78527a2 on IQSS:develop.

Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love how small and elegant the code is but we'll want some documentation for how to change the time and date (and about this new timer in general).

Here's what I would suggest:

  • Put your XML config file in doc/sphinx-guides/source/_static/admin
  • Edit doc/sphinx-guides/source/admin/timers.rst and use "download" syntax you see in doc/sphinx-guides/source/admin/make-data-count.rst like this:
Download :download:`counter-processor-config.yaml <../_static/admin/counter-processor-config.yaml>` 

@pdurbin pdurbin moved this from Code Review 🦁 to IQSS Team - In Progress 💻 in IQSS/dataverse (TO BE RETIRED / DELETED in favor of project 34) Aug 4, 2020
…ss error prone than alpha text) -"0" instead of "Sun"

added documentation in timers.rst, including how to reconfigure timer schedule  (caveat reconfiguring should be a one-off, tracking ejb-jar.xml files opens a can of worms IMHO). Added a sample ejb-jar file
@rtreacy rtreacy moved this from IQSS Team - In Progress 💻 to Code Review 🦁 in IQSS/dataverse (TO BE RETIRED / DELETED in favor of project 34) Aug 5, 2020
@pdurbin pdurbin assigned pdurbin and unassigned rtreacy Aug 5, 2020
- made sample file downloadable
- removed line from API Guide about cron job (not needed now)
- linked pages about Saved Search to each other
- typos, formatting
Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rtreacy overall this is looking good but I have some documentation suggestion, which I put in this pull request: rtreacy#1

When I heard that the timer is configurable, I didn't realize we'd be asking people to recompile Dataverse. Most of our users won't bother with this but I think it's good that we're heading off the question, "Is it possible to reschedule the timer?"

I'll assign this to you to check out the pull request above. You can take as much or as little of it as you want. This is what I was going for:

  • made sample file downloadable
  • removed line from API Guide about cron job (not needed now)
  • linked pages about Saved Search to each other
  • typos, formatting

@pdurbin pdurbin assigned rtreacy and unassigned pdurbin Aug 5, 2020
@qqmyers
Copy link
Member

qqmyers commented Aug 5, 2020

Is it true that you have to rebuild, or can you just drop the ejb file into the dir after the war is unpacked? (and restart payara I assume). That would be something many installations could handle.

@djbrooke djbrooke moved this from Code Review 🦁 to IQSS Team - In Progress 💻 in IQSS/dataverse (TO BE RETIRED / DELETED in favor of project 34) Aug 6, 2020
@djbrooke djbrooke moved this from IQSS Team - In Progress 💻 to Code Review 🦁 in IQSS/dataverse (TO BE RETIRED / DELETED in favor of project 34) Aug 6, 2020
@pdurbin pdurbin self-assigned this Aug 6, 2020
IQSS/dataverse (TO BE RETIRED / DELETED in favor of project 34) automation moved this from Code Review 🦁 to QA 🔎✅ Aug 6, 2020
Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good as of f6e3d0f.

@pdurbin pdurbin removed their assignment Aug 6, 2020
@pdurbin
Copy link
Member

pdurbin commented Aug 6, 2020

@qqmyers I don't know but I think what we have here is sufficient for our needs. I expect most installations won't bother changing it. Here are some resources I looked at:

@kcondon kcondon self-assigned this Aug 6, 2020
@kcondon
Copy link
Contributor

kcondon commented Aug 6, 2020

The precompiled Sunday 12:30am time works as expected. Did not test the configurable time, need to compile it. Dropping it in an already deployed app doesn't work.

@kcondon kcondon merged commit 1e42e41 into IQSS:develop Aug 6, 2020
IQSS/dataverse (TO BE RETIRED / DELETED in favor of project 34) automation moved this from QA 🔎✅ to Done 🚀 Aug 6, 2020
@pdurbin
Copy link
Member

pdurbin commented Aug 6, 2020

Dropping it in an already deployed app doesn't work.

Thanks for testing this, @kcondon

@rtreacy
Copy link
Contributor Author

rtreacy commented Aug 6, 2020

If putting in documentation about reconfiguring is going to cause people to reconfigure because we say it can be done, I think we should remove the documentation

@rtreacy rtreacy deleted the 6910-timer-for-saved-searches branch August 6, 2020 19:40
@djbrooke djbrooke added this to the Dataverse 5 milestone Aug 7, 2020
@pdurbin pdurbin mentioned this pull request Mar 23, 2023
@pdurbin pdurbin changed the title Add timer for saved searches #6910 Add timer for saved searches Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Add a timer for running saved searches
6 participants