The elastic_recheck.query_builder Module

Query builder for pyelasticsearch

A set of utility methods to build the kinds of queries that are needed by elastic recheck to talk with elastic search.

elastic_recheck.query_builder.encode_logstash_query(query, timeframe=864000)

Utility function for encoding logstash queries.

This is used when generating url’s for links in report pages.

Input is a string representing the logstash query and an optional timeframe argument.

elastic_recheck.query_builder.files_ready(review, patch, name, build_short_uuid)

A facetted query to ensure all the required files exist.

When changes are uploaded to elastic search there is a delay in getting all the required log fixes into the system. This query returns facets for the failure on the filename, which ensures that we’ve found all the files in the system.

elastic_recheck.query_builder.generic(raw_query, facet=None)

Base query builder

Takes a raw_query string for elastic search. This is typically the same content that you’ve typed into logstash to get to a unique result.

Optionally supports a facet, which is required for certain operations, like ensuring that all the expected log files for a job have been uploaded.

elastic_recheck.query_builder.most_recent_event()
elastic_recheck.query_builder.result_ready(review, patch, name, build_short_uuid)

A query to determine if we have a failure for a particular patch.

This is looking for a particular FAILURE line in the console log, which lets us know that we’ve got results waiting that we need to process.

elastic_recheck.query_builder.single_patch(query, review, patch, build_short_uuid)

A query for a single patch (review + revision).

This is used to narrow down a particular kind of failure found in a particular patch iteration.

elastic_recheck.query_builder.single_queue(query, queue, facet=None)

A query for a single queue.

Previous topic

The elastic_recheck.log Module

Next topic

The elastic_recheck.results Module

This Page