Make ExecutionInfo compatible with any Request type

Description

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.

Environment

None

Pull Requests

None

Status

Assignee

Alexandre Dutra

Reporter

Alexandre Dutra

Labels

None

PM Priority

None

Reproduced in

None

Affects versions

None

Fix versions

Pull Request

None

Doc Impact

None

Size

None

External issue ID

None

External issue ID

None

Priority

Major
Configure