Add pagination parameter to the database backends of storage

Put all parameters for pagination into class named pagination,
add this paramter to the interface of the database driver.
For now, the methods support pagination query include
get_resources, get_meters, get_alarms.
For get_samples function, because it has parameter limit now,
which should be include in pagination class, it is hard to
add the pagination query in this patch(it involves API codes).
We will add that in another patch.

Pagination parameter includes the following members:
1) 'limit': maximum number of items to return.
2) 'primary_sort_dir': sort direction of primary key.
2) 'marker_value': value of the primary key to identify the last
    item of the previous page.
3) 'sort_keys': array of attributes user pass in except the primary key.
4) 'sort_dirs': per-column array of sort_dirs, corresponding to sort_keys.

We update the prototype of sqlalchemy, hbase, mongodb
db2 and logging storage backend.
Pagination query for mongodb is merged already, we need to
reverse it first.

It is part of bp/paginate-db-search.

Implements blueprint paginate-db-search

Change-Id: I6eedcd728427f4ab20f575aa10675822301fd472
Merge "Add pagination parameter to the database backends of storage"