Use OOP for db api

Registered by li,chen

We would like to use more OOP in more parts of rally.

For db API :
https://github.com/stackforge/rally/blob/master/rally/db/api.py.

We would like to have abstract class with abstract methods instead of a bunch of methods.

Steps to achieve this goal:

1. In the implementation:
    https://github.com/stackforge/rally/blob/master/rally/db/sqlalchemy/api.py.

    Create from these methods class:
    https://github.com/stackforge/rally/blob/master/rally/db/sqlalchemy/api.py#L63-L317
    "class Connection(object): " and all these methods

    And fix this line:
    https://github.com/stackforge/rally/blob/master/rally/db/sqlalchemy/api.py#L60
    return Connection()

    This should work out of box

2. Remove the import line in:
    https://github.com/stackforge/rally/blob/master/rally/db/__init__.py

    Things need to be done:
    a.
    b
    c.

    The reason to do this:
    a.
    b.
    c.

=================== obsolete content =============================
We can make 1 class and put all these methods as an abstract .

And in the implementation:
https://github.com/stackforge/rally/blob/master/rally/db/sqlalchemy/api.py.
It should be actually subclass of this interface.

The whole change would be separated into two steps:

1. create class and put only these methods :
      https://github.com/stackforge/rally/blob/master/rally/db/api.py#L50-L62
      And, in implementation do the same.

2. put all methods into the class

=================== obsolete content =============================

Blueprint information

Status:
Complete
Approver:
Boris Pavlovic
Priority:
Medium
Drafter:
li,chen
Direction:
Approved
Assignee:
li,chen
Definition:
Approved
Series goal:
None
Implementation:
Implemented
Milestone target:
None
Started by
Boris Pavlovic
Completed by
Boris Pavlovic

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/use-oop-for-db-api,n,z

Addressed by: https://review.openstack.org/85974
    Create class "Connection" for sqlalchemy.api

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.