Commit Graph

8 Commits

Author SHA1 Message Date
wanghao 7aa2522e3d Support query queues with count
Zaqar will support query queues with 'with_count' to
return the amount of the queues. This will help users to
quickly get the exact total number of queues which they own.

Change-Id: I1d2cdc802ecd76c01671cd5660ae79dd39505d43
Implements: blueprint query-queues-with-count
Signed-off-by: wanghao <sxmatch1986@gmail.com>
2020-01-10 14:52:10 +08:00
wanghao b4c395c79a Support query filter in queue.
This patch will support to query queues filtered by
name and metadata in mongodb backend.

Other backends will support in following patchs.

Co-Authored-By: gecong <ge.cong@zte.com.cn>
Change-Id: I5fc6a5959e5d94942aebce9cedb22666e5577cb8
Partial-implements: blueprint queue-filter-support
2018-04-13 14:53:43 +08:00
Mike Bayer 8c374b1e7f Use oslo_db for create_engine
The use of plain SQLAlchemy create_engine in Zaqar bypasses
lots of oslo_db features that are associated with its
version of create_engine, some useful and some critical.

Among favorable behaviors that are added:

* The SQLite PRAGMA FOREIGN KEYS call is abstracted into the
  sqlite_fk flag
* The engine is given a pessimistic "ping" event, which emits
  a "SELECT 1" upon connection checkout which will then recycle
  the connection if the backing database is no longer connected.
  As we are using a connection pool, if the database has been
  restarted, or in the case of MySQL a default timeout of eight
  hours idle has passed, existing pooled connections will be stale.
  Upcoming SQLAlchemy 1.2 includes this feature as a simple flag
  but for now, oslo_db implements the event listener as directed
  by SQLA docs
* The errors raised by the DBAPI, and then wrapped by SQLAlchemy,
  are further sub-classified.  In particular, Zaqar seems to use
  a lot of IntegrityError catches to detect duplicate entry and
  foreign key constraint conditions.  oslo_db parses these out on
  a per-database-basis into individual DBDuplicateEntry,
  DBReferenceError, and other error classes, allowing Zaqar to
  respond specifically to the sub-class of IntegrityError or
  allow it to propagate if the condition is unhandled.
* checks for MySQL SQL_MODE and best practice driver (pymysql)
  will emit warnings if these conditions are not met.
* Gets Zaqar ready for further oslo.db integration and guides
  new features into oslo_db, including a potential "mysql timezone"
  setting

Change-Id: I16c3ed89e006e132bbd0295be1dfd0b561b2037c
Resolves-bug: https://bugs.launchpad.net/tripleo/+bug/1691951
2017-06-12 21:29:11 -04:00
Flavio Percoco 47b8453d8b Restore sqlalchemy unit tests
Bring back the sqlalchemy unittests and fix all the bugs required to
make the tests pass.

Closes-bug: #1490450
Change-Id: Ibfa1a3ff372ce3e4a98a532798113013d3c1dec1
2015-09-02 00:02:57 +02:00
Fei Long Wang b03cceec2f Fix GET queue metadata for sqlalchemy
When using sql as the management plane and get queue, user
will run into 503 error since we're using self.driver.get,
but unfortunately, there is no get() method in sqlalchemy's
ControlDriver. This patch fixes the issue by using run()
instead of get().

Closes-Bug: #1489701

Change-Id: I064e123eae3617861804092f4f7a1b194a5ec136
2015-08-28 16:13:25 +12:00
Shaifali Agrawal c3a5718775 Remove QueueController from data to control plane
To separate data and control plane of storage layer;
Moving queue_controller from data to controll plane.
Trying to shift the QueueController object in Control plane.
For this new MessageQueueHandler class is also added inside storage/x/messages.py
And the newly added handler is added to the entry point.

Implements: blueprint split-data-and-control-plane
Co-Author: Flavio Percoco<flavio@redhat.com>

Change-Id: I8a167d6ed8e54c98b077b9ea56e68b4e8d5b0291
2015-04-02 19:22:38 +02:00
Flavio Percoco 6ae5372629 Wrap abstract method with base methods
In order to be able to move some validations and general checks, that are
currently done in the transport, down to the storage layer, we need to
wrap the methods being overloaded with other methods that are defined in
the base class. This will allow us to add logic before and after the
actual method call if needed.

This is the first patch of a series of patches that will update all the
storage controllers.

Partial-blueprint: expose-storage-capabilities
Change-Id: Iff42e3b775ed63661bc69fc1925242ff0e574e46
2014-12-12 15:06:25 +01:00
Fei Long Wang 166abfd303 Refactor code structure for notification
Given we are going to implement notification, so the 'queues'
package is not suitable for current scope of zaqar. This
patch will remove the 'queues' package.

Partially implements: blueprint notifications

Change-Id: I6984f31f4bd1e646b585c45c088ed239b58587c4
2014-12-09 16:19:42 +13:00