Package org.apache.hadoop.hbase.ipc
Class ShadedPrefixUtil
java.lang.Object
org.apache.hadoop.hbase.ipc.ShadedPrefixUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ShadedPrefixUtilprivate static final org.slf4j.Logger(package private) static final Stringprivate final ConcurrentHashMap<String,String> Cache from original class name to its resolved (shaded or original) equivalent.private final StringThe shaded equivalent of "org.apache.hadoop.hbase", or null if not in a shaded environment. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) StringapplyShading(String className) Maps an original HBase class name to its shaded equivalent by replacing the "org.apache.hadoop.hbase" prefix with the detected shaded base package.private StringcomputeResolvedName(String originalName) static ShadedPrefixUtil(package private) String(package private) static ShadedPrefixUtilnewInstance(String currentPackageName) (package private) StringresolveShading(String originalName) Returns the effective class name for the given original HBase class name.
-
Field Details
-
LOG
-
ORIGINAL_BASE
-
INSTANCE
-
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
-
ShadedPrefixUtil
-
-
Method Details
-
newInstance
-
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. UseresolveShading(String)when class existence must be verified. -
resolveShading
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
-
getInstance
-