GithubHelp home page GithubHelp logo

Comments (6)

aozarov avatar aozarov commented on July 29, 2024

Yes, the intent was for one to override getJobDisplayName for returning a value which is different from the default. From a user perspective a Job is immutable but this setter violates that (and in an inconsistent way - only going to have an effect upon Job submission). Also, by overriding (vs setter) one could make the value more "dynamic".

from appengine-pipelines.

billy1380 avatar billy1380 commented on July 29, 2024

In theory what you are saying is correct; in practice I have 10s of jobs/job classes. For all of them I have to override getJobDisplayName that requires me to add a member variable called name to each, then add a setter and/or a constructor to set that name for the job on creation.

Now that sounds tedious, right... I should have a parent class that I inherit from which has that behaviour, except that I am mandated by the framework to inherit from Job. The alternative is for me to Have a set of superclasses called something like NamedJob or something that extends each of the 6 types of Job<>.

As for the immutability of the Job, again that should be true, however, every change of status that requires the persistence of a job instance re-saves the display name. So even though I have no intention of changing the display names of jobs, the design does not reflect that requirement at least not when it comes to the display name.

from appengine-pipelines.

aozarov avatar aozarov commented on July 29, 2024

I don't think any change of job status (or retries) re-persist the job instance. Job information such as status is handled/saved-by JobRecord and the instance is saved by JobInstanceRecord. The former gets updated between invocations and status change but (AFAIK) not the latter.
Also, one should consider calls to setDisplayName on a JobRefernce after job was submitted...
I understand your pain but feel that for a typical use-case overriding (a method or a base-class) would be sufficient. I think the correct approach for providing a better support for display-name would be to provide it as a JobSetting (save it similar to other JobSetting values and use it instead of getClass().getName() if JobRecord has a value for it).

from appengine-pipelines.

billy1380 avatar billy1380 commented on July 29, 2024

I really like the job setting idea. It fits really well. I will have a play and see what I can come up with. Any recommendations? Feel free to close/reject the previous pull request.

from appengine-pipelines.

aozarov avatar aozarov commented on July 29, 2024

No recommendation. Follow the path of existing JobSetting handling (shouldn't be too bad).

from appengine-pipelines.

billy1380 avatar billy1380 commented on July 29, 2024

:) Thank you

from appengine-pipelines.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.