{"record":{"id":"1ae91af0de7c8541","repo":"apache/hadoop","slug":"the-wrapped-stream-does-not-support-setting-the-dr","errorCode":null,"errorMessage":"the wrapped stream does not support setting the drop-behind caching setting.","messagePattern":"the wrapped stream does not support setting the drop-behind caching setting\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSDataOutputStream.java","lineNumber":156,"sourceCode":"      wrappedStream.flush();\n    }\n  }\n  \n  @Override  // Syncable\n  public void hsync() throws IOException {\n    if (wrappedStream instanceof Syncable) {\n      ((Syncable)wrappedStream).hsync();\n    } else {\n      wrappedStream.flush();\n    }\n  }\n\n  @Override\n  public void setDropBehind(Boolean dropBehind) throws IOException {\n    try {\n      ((CanSetDropBehind)wrappedStream).setDropBehind(dropBehind);\n    } catch (ClassCastException e) {\n      throw new UnsupportedOperationException(\"the wrapped stream does \" +\n          \"not support setting the drop-behind caching setting.\");\n    }\n  }\n\n  /**\n   * Get the IO Statistics of the nested stream, falling back to\n   * empty statistics if the stream does not implement the interface\n   * {@link IOStatisticsSource}.\n   * @return an IOStatistics instance.\n   */\n  @Override\n  public IOStatistics getIOStatistics() {\n    return IOStatisticsSupport.retrieveIOStatistics(wrappedStream);\n  }\n\n  /**\n   * Invoke {@code abort()} on the wrapped stream if it\n   * is Abortable, otherwise raise an","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSDataOutputStream.java#L138-L174","documentation":"Error \"the wrapped stream does not support setting the drop-behind caching setting.\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSDataOutputStream.java:156 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Only set drop-behind on output streams whose wrapped stream supports it.","Guard with a capability check and skip the setting when unsupported."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}