Currently ExecutionInfo exposes a Statement<?> getStatement() method. This makes this interface unsuitable for reporting execution info for requests of other types.
One example of this is graph queries. GraphStatement does not inherit from Statement. As a consequence, a separate interface, GraphExecutionInfo, had to be created, and GraphResultSet returns a GraphExecutionInfo instead of ExecutionInfo. However, if the graph query execution fails, the client gets a DriverException. But this class only exposes a ExecutionInfo getExecutionInfo() method which will return null for any kind of request other than Statement.
I suggest the following:
1. In ExecutionInfo add a new default method getRequest and deprecate getStatement:
2. Modify DefaultExecutionInfo accordingly, it should store a Request object internally.
3. Modify CqlRequestHandler accordingly.
Then in the DSE driver we would deprecate GraphExecutionInfo and use ExecutionInfo consistently.