apache/hadoop · error · HdfsCompatIllegalArgumentException
suite " + suiteClassName + " suiteName is empty
Error message
suite " + suiteClassName + " suiteName is empty
What it means
Once a custom suite loads, HdfsCompatCommand validates its metadata: getSuiteName() must return a non-null, non-empty name. This error means the class loaded and passed the instanceof check but identifies itself with an empty name, so the tool cannot register, report, or address it.
Solutions
- Return a stable non-empty constant from getSuiteName(), matching the name used in -suite and the configuration key
- Initialize the name as a compile-time constant rather than runtime state
- Rebuild and redeploy the suite jar so the tool loads the fixed class
Example fix
// before
@Override
public String getSuiteName() { return suiteNameField; } // null at runtime
// -> suite ... suiteName is empty
// after
private static final String NAME = "mysuite";
@Override
public String getSuiteName() { return NAME; } Defensive patterns
Strategy: validation
Validate before calling
HdfsCompatSuite s = (HdfsCompatSuite) Class.forName(cls).getConstructor().newInstance();
String name = s.getSuiteName();
if (name == null || name.isEmpty()) {
throw new IllegalArgumentException(cls + ": getSuiteName() must not be null/empty");
} Prevention
- Return a compile-time constant from getSuiteName()
- Add a registration smoke test asserting name and cases are non-empty for every shipped suite
When it happens
Trigger: A custom HdfsCompatSuite implementation whose getSuiteName() returns null, "", or a value derived from an uninitialized field or an unset configuration entry.
Common situations: Suite classes copied from a template where the name constant was never filled in; getSuiteName() reading a value that is only populated in certain constructors; name taken from a resource/property that is missing at runtime.
Related errors
- suite " + suiteClassName + " is empty for both API and SHELL
- cannot get class name for suite " + this.suiteName + "…
- class name " + suiteClassName + " must be an implementation…
- suite " + suiteClassName + " suiteName conflicts with…
- Cannot find any path capability
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/7c72f8432cf83a67.
Report an issue: GitHub.
Appendix: source
Thrown at hadoop-tools/hadoop-compat-bench/src/main/java/org/apache/hadoop/fs/compat/common/HdfsCompatCommand.java:93
String key = "hadoop.compatibility.suite." + this.suiteName + ".classname";
final String suiteClassName = conf.get(key, null);
if ((suiteClassName == null) || suiteClassName.isEmpty()) {
throw new HdfsCompatIllegalArgumentException(
"cannot get class name for suite " + this.suiteName +
", configuration " + key + " is not properly set.");
}
Constructor<?> ctor = suiteClassName.getClass().getConstructor();
ctor.setAccessible(true);
Object suiteObj = ctor.newInstance();
if (suiteObj instanceof HdfsCompatSuite) {
this.suite = (HdfsCompatSuite) suiteObj;
} else {
throw new HdfsCompatIllegalArgumentException(
"class name " + suiteClassName + " must be an" +
" implementation of " + HdfsCompatSuite.class.getName());
}
if (suite.getSuiteName() == null || suite.getSuiteName().isEmpty()) {
throw new HdfsCompatIllegalArgumentException(
"suite " + suiteClassName + " suiteName is empty");
}
for (HdfsCompatSuite defaultSuite : defaultSuites.values()) {
if (suite.getSuiteName().equalsIgnoreCase(defaultSuite.getSuiteName())) {
throw new HdfsCompatIllegalArgumentException(
"suite " + suiteClassName + " suiteName" +
" conflicts with default suite " + defaultSuite.getSuiteName());
}
}
if (!hasApiCase() && !hasShellCase()) {
throw new HdfsCompatIllegalArgumentException(
"suite " + suiteClassName + " is empty for both API and SHELL");
}
}
private boolean hasApiCase() {
return (suite.getApiCases() != null) &&
(suite.getApiCases().length > 0);View on GitHub (pinned to 2add963021)