Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
populate time fields for connectors on return #2922
populate time fields for connectors on return #2922
Changes from 6 commits
a545bf8
8c006de
fc18739
c606ffa
15aa958
7f06d73
481f5c2
d858a7b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why only HttpConnector? Can't we just check
connector.getLastUpdateTime() != null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't want to bloat the connector interface with a getter as it already has two getters. Also AbstractConnector has the time fields not the connector interface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if
getLastUpdateTime
is null? Don't we want to update those values also?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the concern if we just add
connector.setLastUpdateTime(Instant.now());
without any checks?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO the updates should be built-in (but overridable) defaults on the AbstractConnector. May not need a setter for it as it should generally done automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @dhrubo-os, @dbwiddis
This method will update connectors when it does this my theory is that deserializes the connector from an index and constructs the HTTPConnector object when this happens it is very hard to control the update fields (on instantiation).
If we decide to add the time fields in the abstract Connector constructor we have a problem between old connectors and new ones. This results in a unexpected bug when connectors that didn't have these fields get brought to life; every subsequent update on the connector makes the time fields a new number every time.
Now if we wanted old connectors to not have the time fields (what our users expect when they update a old connector) they wont see the time fields because this method checks if an update should work on time only if they have the field. When a connector thats been created with the code change, they will see time fields and will update accordingly well.
Please let me know if you are still confused I would be happy to explain more in depth :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's generally frowned on to use star imports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, yeah will fix that