You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "alerman (via GitHub)" <gi...@apache.org> on 2023/10/25 15:18:13 UTC

[I] Exception message in deprecated Volume Chooser is a lie [accumulo]

alerman opened a new issue, #3892:
URL: https://github.com/apache/accumulo/issues/3892

   **Describe the bug**
   The exception message in VolumeChooser.java (non spi package) states that this method is deprecated and will be removed, however it is throwing an exception. If its throwing an exception, the functionality has already been removed.
   
   **Versions (OS, Maven, Java, and others, as appropriate):**
    - Affected version(s) of this project: [e.g. 1.10.0] 2.x
    - OS: [e.g. CentOS 7.5] All
    - Others:
   
   **To Reproduce**
   Look here: https://github.com/apache/accumulo/blob/de0cf9f739978a04099d43cb0b9f729d0b4a1bab/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeChooser.java#L44-L45
   
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Exception message in deprecated Volume Chooser is a lie [accumulo]

Posted by "EdColeman (via GitHub)" <gi...@apache.org>.
EdColeman commented on issue #3892:
URL: https://github.com/apache/accumulo/issues/3892#issuecomment-1779543767

   It is an interface and that is just providing a default implementation. Is it not the responsibility of the classes that extend it to provide an implementation?
   
   The fact that it throws an UnsupportedOperationException is true.
   The fact that it will be removed in a future version is also true.
   
   If the message was "this operation is not implemented and must be overridden" would be accurate, but sort of redundant with the UnsupportedOperationException itself.  Stating that it will be removed may be help for developers - rather than just implementing the method, maybe they'd choose another path?
   
   The message may not be the most user friendly message, but it is providing accurate information and does not seem to be a bug. The code is functionally correct - unless you think there should be a different default implementation?


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Exception message in deprecated Volume Chooser is a lie [accumulo]

Posted by "ctubbsii (via GitHub)" <gi...@apache.org>.
ctubbsii closed issue #3892: Exception message in deprecated Volume Chooser is a lie
URL: https://github.com/apache/accumulo/issues/3892


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Exception message in deprecated Volume Chooser is a lie [accumulo]

Posted by "ctubbsii (via GitHub)" <gi...@apache.org>.
ctubbsii commented on issue #3892:
URL: https://github.com/apache/accumulo/issues/3892#issuecomment-1862503809

   The exception message is not a lie.
   
   This was done in #1551 and a *lot* of care was taken to make sure that users were minimally impacted. We deprecated the old method, and added a new one that used a Set instead of an array. All of our code used the Set version. We made it a default method to warn exactly once about the deprecation, and then to call the user's implementation for the array version, in case they hadn't updated their implementation. We also made the array version a default method so that new implementations did not need to implement the deprecated method at all, and could choose to only implement its replacement. All the javadocs were updated to point users towards the replacement, and the warning was given to make sure users were notified, but not spammed. Since both methods had default implementations in the interface, the only way you would have gotten the error message is if you created an implementation that did not override either of the two methods. That could have happened with a typo (but that
 's why it's good to use `@Override` annotations, so you can get compile time checks on that). If you overrode the old method, you would also have gotten a compile-time deprecation warning.
   
   Later, before 2.1.0 was actually released, we decided that the whole class should be deprecated. So, we then took great care to make sure that the old interface extended the new one, and we deprecated the entire class. A deprecation javadoc was added which pointed to the new interface, which has only a Set version of the choose method.
   
   We then documented the new SPI, with a link directly to the change to make the VolumeChooser SPI, in our release notes in the "major improvements" section. The VolumeChooser PR was the very first one linked.
   
   So, the only way I can think that a user would be negatively impacted by this is if they did not read the release notes, chose to write a *new* VolumeChooser implementation against the old interface (one written for a previous version would have required the choose method to be implemented), chose to ignore all the deprecation warnings during development of their custom VolumeChooser without reading any of the documentation or following any of the upstream development activity, didn't read any of the javadocs, and then either implemented their own choose method that took a Set and called the old method that took an array, or if they didn't implement either method on the interface at all.
   
   If a user actually got that far, I'm not sure we can do anything else for them. I'm closing this issue. I don't think there's anything more we can do, or should have done.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Exception message in deprecated Volume Chooser is a lie [accumulo]

Posted by "alerman (via GitHub)" <gi...@apache.org>.
alerman commented on issue #3892:
URL: https://github.com/apache/accumulo/issues/3892#issuecomment-1782963674

   @EdColeman  I can't remember the details exactly, but i can tell you with 100% confidence that I hit this error message. I believe I was working on a volume chooser that extended from either the SpaceAware or from the Preferred. This message was hit, running in a test cluster, only after updating the version of accumulo I depended on from 1.x to 2.x.
   
   In this case, a chooser that worked fine in 1.x, now threw exceptions in 2.x which stated that this "would be removed in 3.0". Code that I remember to have been working was now broken. 
   
   Perhaps there is more to it I am not remembering, but regardless the message is not correct. If you dont want to be redundant just remove the message. But I would rather the message say something like "You have hit the default implementation of this method, in a package which has been deprecated. Please see `link to SPI package`"


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org