ctubbsii commented on issue #1889: URL: https://github.com/apache/accumulo/issues/1889#issuecomment-769881303
Since this was re-opened, I will reply to the points that were made: > 1) its public The fact that the method is public says nothing about whether the arguments can be null, and in the absence of documentation (javadoc, annotations, etc.), the behavior is not defined. The behavior didn't break... a user's invalid assumption was broken. However, in this case, the API is clearly designed to be called by Accumulo, which always provides an concrete environment. It isn't designed for the user to call init themselves, never mind pass null. Rather, it is designed for a user to implement an initialization *given* an environment (which Accumulo provides, and is never null). So, given the design that Accumulo provides the argument, it's not surprising that we didn't document requirements for the argument for the user to pass, but we can address that with updated javadoc in SortedKeyValueIterator, if necessary. Other than testing, I have not seen a use case articulated for a user calling init themselves, and for testing, one should simulate what Accumulo might provide with a mock environment. If there is a use case, I'd have to understand it better before suggesting a solution beyond updating the javadoc. > 2) this worked in 1.9.x and it is a behavior change in a minor release. I'm not so sure it did work in 1.9. The use of the environment to check the scope of the major compaction was added in 1.6.5 and 1.7.1 to fix a serious bug. See https://issues.apache.org/jira/browse/ACCUMULO-2232 . The code may have been re-ordered more recently to manifest itself earlier, but the expectation that the environment be non-null has been baked into this method's implementation for a very long time. Even if it did work in 1.9, it was only because of an invalid user assumption that it was safe to call the method themselves with a null argument. Accumulo's own behavior has not changed, because it always provided a non-null environment. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
