Interface CryptoStreamUtils.BaseErrorHandler

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
CryptoStreamUtils.ErrorHandlingReadableChannel
Enclosing class:
CryptoStreamUtils

public static interface CryptoStreamUtils.BaseErrorHandler extends Closeable
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

    Modifier and Type
    Method
    Description
    The encrypted stream that may get into an unhealthy state.
    void
     
    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.
    <T> T
    safeCall(scala.Function0<T> fn)
     
  • Method Details

    • cipherStream

      Closeable cipherStream()
      The encrypted stream that may get into an unhealthy state.
    • close

      void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • 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)