private static boolean isAdaptiveException ( Throwable t ) { if ( t instanceof FrameTooLongException ) { return true ; } if ( t instanceof NoHostAvailableException ) { // If the issue on every host is adaptive then the exception is adaptive Collection < Throwable > hostExceptions = ( ( NoHostAvailableException ) t ) . getErrors ( ) . values ( ) ; return ! hostExceptions . isEmpty ( ) && hostExceptions . stream ( ) . allMatch ( AdaptiveResultSet :: isAdaptiveException ) ; } return false ; }
Returns true if the exception is one which indicates that the frame size may be too large false otherwise .