Class ShadedPrefixUtil

java.lang.Object
org.apache.hadoop.hbase.ipc.ShadedPrefixUtil

final class ShadedPrefixUtil extends Object
  • Field Details

    • LOG

      private static final org.slf4j.Logger LOG
    • ORIGINAL_BASE

      static final String ORIGINAL_BASE
    • INSTANCE

      private static final ShadedPrefixUtil INSTANCE
    • shadedBase

      private final String shadedBase
      The shaded equivalent of "org.apache.hadoop.hbase", or null if not in a shaded environment.
      • Prefix-prepend shading (e.g., current package "a.b.c.org.apache.hadoop.hbase.ipc"): "a.b.c.org.apache.hadoop.hbase"
      • Full-replacement shading (e.g., current package "shaded.hbase1.ipc"): "shaded.hbase1"
    • resolvedClassNames

      Cache from original class name to its resolved (shaded or original) equivalent.
  • Constructor Details

  • Method Details

    • newInstance

      static ShadedPrefixUtil newInstance(String currentPackageName)
    • getShadedBase

    • applyShading

      Maps an original HBase class name to its shaded equivalent by replacing the "org.apache.hadoop.hbase" prefix with the detected shaded base package. Returns the original class name unchanged if not in a shaded environment or if the class name does not start with the original HBase package. Note: this is a pure string transformation with no class loading. Use resolveShading(String) when class existence must be verified.
    • resolveShading

      String resolveShading(String originalName)
      Returns the effective class name for the given original HBase class name. Prefers the shaded class name when it can be loaded, and falls back to the original when the shaded class is not available (e.g., when exception classes are intentionally excluded from shading). The result is cached so that Class.forName is invoked at most once per distinct class name.
    • computeResolvedName

      private String computeResolvedName(String originalName)
    • getInstance

      public static ShadedPrefixUtil getInstance()