Skip to content

Conversation

@olegz
Copy link
Contributor

@olegz olegz commented Nov 13, 2015

…nance repository

  • Ensured that failures derived form correlating Document to its actual provenance event do fail the entire query and produce partial results with warning messages
  • Refactored DocsReader.read() operation.
  • Added test to validate two conditions where the such failures could occur

…nance repository

- Ensured that failures derived form correlating Document to its actual provenance event do fail the entire query and produce partial results with warning messages
- Refactored DocsReader.read() operation.
- Added test to validate two conditions where the such failures could occur
Copy link
Contributor

Choose a reason for hiding this comment

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

Removing this public method is a breaking change. Recommend deprecating.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Considering that this class does not appear to be intended as public API I still believe it is the right thing to do since the constructor argument isn't used.
In fact, need to look if we can make this class package private.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should consult the versioning guide to see if it addresses how to handle this. We need to be very explicit about which parts of the codebase are public and designed for extension versus those which the community should be free to evolve . if the guide doesn't cover this case let's solve it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm like 95% with @olegz on this. I believe it is implausible that someone would be calling this method and likely needed a comment that it was public for some other reason than it was a public API. That 5% not with @olegz is adding deprecation tag adds a tiny smidge of tech debt, which would be swept up when we investigate all the deprecated methods for 1.0.0

Copy link
Contributor

Choose a reason for hiding this comment

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

We have designed flexibility in for a reason. Deprecation is appropriate for the public portions of code designed for extension and/or modification. For everything else let's be sure it is clear and documented what is fair game for the community to evolve. If it isn't clear then we should err on the side of deprecation then make it clear. We need to have agility behind the curtain.

Copy link
Contributor

Choose a reason for hiding this comment

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

100% agree. Other projects use annotations to warn folks of risk when using public methods that aren't extension points (e.g. @PublicForTests or @experimental), but I'd settle for a comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree that depreciation is the right thing to do in general cases like this. But given that the project is pre-1.0 and obvious intent of this class not being a public API I felt removing it would be ok. Still do but will honor the majority opinion and will deprecate.

Copy link
Contributor

Choose a reason for hiding this comment

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

oleg i was entirely in agreement with how you had it for this case (removal). Tony was only 5% in disagreement. Of those that weighed in you have 195% support ;-)

Copy link
Member

Choose a reason for hiding this comment

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

I think there has been a "handshake agreement" on the nature of the framework code versus the extension developer facing API. Having said that, I was not able to find any documentation that indicates that is the case. As a result, I think I am a similar 95/5 split as Tony. As a result, I think the "right" thing given the circumstances is to tag it up as Deprecated and remove at 1.x. However, I think it's likely a fair assumption that this is clear. Either way, we need to get the handshake agreement in a tangible form some place. I'll make a ticket and please add on/enhance as needed.

Copy link
Contributor

Choose a reason for hiding this comment

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

@apiri The versioning scheme is defined at https://cwiki.apache.org/confluence/display/NIFI/Version+Scheme - it essentially says that all extension points that adhere to API version X.Y.* must also work in version X.(Y+1).*. I.e., minor changes will not break backward compatibility of extension point API or those objects that can be reached by extension points via the API.

@apiri
Copy link
Member

apiri commented Nov 15, 2015

Grabbed the PR locally and scoped it out. Nothing substantive to add beyond those comments here already. Performed some querying of a locally running instance with the new patch applied and didn't notice any tremendous performance impacts. Will continue to run as this patch goes through it's final paces.

- made DocReader package private
- polished logic in read(..) method to avoid escaping the loop
- added call to sorting logic in LuceneUtil.groupDocsByStorageFileName(..) to ensure that previous behavior and assumptions in read(..) methodd are preserved
- other minor polishing
@olegz
Copy link
Contributor Author

olegz commented Nov 16, 2015

@trkurc @joewitt @apiri
Guys, please see the latest commit. Didn't squash it, so its easier to read and see what's been addressed. In summary:

  1. Since based on the latest comment from Joe it appears that we all agree that DocReader is not really public, i kept the dead constructor out and also made DocReader package private.
  2. Based on Tony's point added Document sorting logic back. At least it will ensure that previous behavior is maintained.
    See commit message for more details

@trkurc
Copy link
Contributor

trkurc commented Nov 16, 2015

I'm mostly okay with package private. On the off chance someone was using this API it will be marginally more challenging to adapt to this change, but is possible.

@markap14
Copy link
Contributor

@trkurc Personally, I have exactly 0 qualms about changing it to package private. If I choose to take some random util class from a release of Apache Tomcat, for example, and depended on it, I should certainly not be surprised if that class changes from release to release (including incremental releases) - I don't think this is any different.

@asfgit asfgit merged commit 15880f9 into apache:master Nov 17, 2015
@olegz olegz deleted the NIFI-748 branch April 5, 2016 12:34
mattyb149 pushed a commit to mattyb149/nifi that referenced this pull request Dec 9, 2020
This closes apache#123.

Signed-off-by: Aldrin Piri <aldrin@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants