Files
gerrit/java
Patrick Hiesel 0d6a1b311a Make AndSource and OrSource lazy
Our index system is implemented lazyly. This works by decoupling sending
queries from reading results. Queries are dispatched by calling
DataSource#read. This returns a ResultSet. Results are then read by
calling #toList or #iterator on the ResultSet. The gap inbetween allows
for Gerrit to continue processing (e.g. by sending more queries) and
then block only when results are truely needed.

This system also parallelizes the case when multiple queries are sent to
any queries REST endpoint, such as QueryChanges.

Unfortuantely, AndSource and OrSource were implemented with a small flaw
that annuled aforementioned mechanism. This is bad because AndSource is
used for enforcing visibility, which we do on pretty much every query.

This commit fixes that and adds a test to ensure we are not regressing.

Change-Id: I3b6ef8caf7fe6998f3823ba1c2f247e2c37ce693
2019-05-23 15:13:56 +02:00
..
2019-05-08 07:33:21 -07:00