apache/hadoop · error · UnsupportedOperationException
This method is deprecated: use the other addResponseTime
Error message
This method is deprecated: use the other addResponseTime
What it means
RpcScheduler's deprecated four-arg addResponseTime(name, priorityLevel, queueTime, processingTime) is a default method whose only behavior is to throw UnsupportedOperationException, pushing callers to the overload addResponseTime(callName, Schedulable, ProcessingDetails). The javadoc states no Hadoop code calls the old method; you hit it when external code invokes the old signature on a scheduler that (correctly, per the contract) implements only the new overload.
Source
Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/RpcScheduler.java:54
/**
* This method only exists to maintain backwards compatibility with old
* implementations. It will not be called by any Hadoop code, and should not
* be implemented by new implementations.
*
* @param name input name.
* @param priorityLevel input priorityLevel.
* @param queueTime input queueTime.
* @param processingTime input processingTime.
* @throws UnsupportedOperationException
* the requested operation is not supported.
* @deprecated Use
* {@link #addResponseTime(String, Schedulable, ProcessingDetails)} instead.
*/
@Deprecated
@SuppressWarnings("unused")
default void addResponseTime(String name, int priorityLevel, int queueTime,
int processingTime) {
throw new UnsupportedOperationException(
"This method is deprecated: use the other addResponseTime");
}
/**
* Store a processing time value for an RPC call into this scheduler.
*
* @param callName The name of the call.
* @param schedulable The schedulable representing the incoming call.
* @param details The details of processing time.
*/
@SuppressWarnings("deprecation")
default void addResponseTime(String callName, Schedulable schedulable,
ProcessingDetails details) {
// For the sake of backwards compatibility with old implementations of
// this interface, a default implementation is supplied which uses the old
// method. All new implementations MUST override this interface and should
// NOT use the other addResponseTime method.
int queueTime = (int) details.get(ProcessingDetails.Timing.QUEUE,View on GitHub (pinned to 2add963021)
Solutions
- Switch the call site to addResponseTime(callName, schedulable, processingDetails) — the ProcessingDetails instance the server already carries.
- If external code must keep calling the old signature on your custom scheduler, override the deprecated method in your implementation and translate it into your new-style recording.
- Recompile plugin code against the exact deployed Hadoop version so overload resolution matches the running contract.
Example fix
// before
rpcScheduler.addResponseTime(name, priorityLevel, queueTime, processingTime); // UnsupportedOperationException
// after
rpcScheduler.addResponseTime(callName, schedulable, processingDetails);
// if your custom RpcScheduler must keep old callers working:
@Deprecated
@Override
public void addResponseTime(String name, int priorityLevel, int queueTime, int processingTime) {
recordResponseTime(name, queueTime, processingTime); // translate to new-style recording
} Defensive patterns
Strategy: fallback
Prevention
- Implement both overloads in custom RpcScheduler implementations, with the deprecated one translating into the new-style recording.
- Compile scheduler plugins against the exact deployed Hadoop version so overload resolution matches.
- Treat the deprecated four-arg addResponseTime as caller-side dead code — Hadoop never invokes it.
When it happens
Trigger: Calling the deprecated addResponseTime overload directly on a new-style RpcScheduler implementation that does not override it; scheduler plugins or metrics code compiled against the old signature running against a current implementation; note the inverse works — the new default method delegates to the old one for legacy implementations.
Common situations: Hadoop version upgrades where third-party call sites still use the old overload; custom RpcScheduler implementations (custom call-queue backends) tested with old-style harnesses; copy-pasted metrics adapters.
Related errors
- oidName: ${oidName} is not supported.
- Got an IO exception
- Serverside implements {}. The following requested protocol i
- Serverside implements {}. The following requested protocol i
- Can't write: {instance} as {declaredClass}
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/3024b1148ec78326.
Report an issue: GitHub.