We used to do this years ago at my company. You have to find the various ProtobufUtil and RemoteException related classes, wherever the remote classname string is parsed from a protobuf into a Class. You need to push some custom code to rewrite the strings there. I think there were two or three spots where we shimmed in that code. I don't have any more specifics than that, because it was a while ago.
I don't think there are currently plans to add support for shaded class names, but it's an open source project so you're more than welcome to create a JIRA and even contribute to it. I don't think it's too hard of a task. On Mon, Sep 9, 2024 at 8:15 AM Minwoo Kang <its.minwoo.k...@gmail.com> wrote: > Hello, community > > I am creating an in-house library using the HBase client library and > distributing it so that other users can use it. > To prevent conflicts with the user library, we shaded the HBase package. > (For example, org.apahce.hadoop.hbase... -> > good.company.org.apahce.hadoop.hbase...) > > However, there is one problem here. > When an error occurs on the HBase server, it passes the class name to the > client. > The client, which receives the error class name from the server, attempts > to create an error object with that class name. > However, because the error class is shaded, the client cannot find the > appropriate error class received from the server. > > There is a problem where the client does not find the appropriate error > class and mistakenly determines it to be a DoNotRetryIOException, even > though it should be retried. > > To solve this problem, I am considering forcing the shading package prefix > when creating an object from the class received from the server in the > HBase client. > (For example, if the error class name received from the server is > org.apache.hadoop.hbase.regionserver.RegionServerStoppedException, I am > considering making it also find > > good.company.org.apache.hadoop.hbase.regionserver.RegionServerStoppedException.) > > Is there a nicer way to do this than the method mentioned above? > I wonder if there are any plans to add support features for shade users in > HBase. > (For example, a feature that allows the client to find the shaded class > name when creating an object from the class name received from the server.) > > Kind Regards >