Opening an encrypted HDFS file returns a chain of wrapped input streams:
If an application such as Impala or HBase calls HdfsDataInputStream#unbuffer, FSDataInputStream#unbuffer will be called:
If the in class does not implement CanUnbuffer, UOE will be thrown. If the application is not careful, tons of UOEs will show up in logs.
In comparison, opening an non-encrypted HDFS file returns this chain:
DFSInputStream implements CanUnbuffer.
It is good for CryptoInputStream to implement CanUnbuffer for 2 reasons:
- Release buffer, cache, or any other resource when instructed
- Able to call its wrapped DFSInputStream unbuffer
- Avoid the UOE described above. Applications may not handle the UOE very well.