I'm trying to understand the restrictions on creating multiple QueryConditions on a single reader. The docs say: "Two query conditions that have the same query_expression
will require unique query condition content filters if their query_paramters
differ. Query conditions that differ only in their state masks will share the same query condition content filter."
I'm making QueryConditions that use the same query_expression, but have different query_parameters. How do I create unique "query condition content filters"? I have a data reader shared by multiple threads. Each thread is interested in a separate subset of the data and I'm using QueryConditions to partition the data. When a thread wants to read, it'll create a query condition using the same query expression, but different query parameter. I'm finding I can only create a handful (maybe ~5) QueryConditions before creation of QueryConditions starts failing.
What is the best way to go about this?
Thanks!
You are encountering the reader reasource limit DDS_DataReaderResourceLimitsQosPolicy::max_query_condition_filters, which controls the allocation limits for Query Condition filters. The default value is 4, so failing at 5 is expected. You can set this limit as high as 32.
Setting this limit higher should help your initial problem.
That did it. Thanks!
What is the solution to this problem without increasing
max_query_condition_filters
?The manual states "more than 32 QueryConditions may be created per DataReader, if they are different mask-combinations of the same content filter.".
Does it mean, for example that I can set
query_expression = "id = %0"
and pass id values inquery_parameters
and it will all use just one conditioning filter?