Package org.apache.spark.security
Interface CryptoStreamUtils.BaseErrorHandler
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
CryptoStreamUtils.ErrorHandlingReadableChannel
- Enclosing class:
- CryptoStreamUtils
SPARK-25535. The commons-crypto library will throw InternalError if something goes
wrong, and leave bad state behind in the Java wrappers, so it's not safe to use them
afterwards. This wrapper detects that situation and avoids further calls into the
commons-crypto code, while still allowing the underlying streams to be closed.
This should be removed once CRYPTO-141 is fixed (and Spark upgrades its commons-crypto dependency).
-
Method Summary
-
Method Details
-
cipherStream
Closeable cipherStream()The encrypted stream that may get into an unhealthy state. -
close
void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
original
Closeable original()The underlying stream that is being wrapped by the encrypted stream, so that it can be closed even if there's an error in the crypto layer.- Returns:
- (undocumented)
-
safeCall
<T> T safeCall(scala.Function0<T> fn)
-