diff options
Diffstat (limited to 'icing/icing-search-engine.h')
-rw-r--r-- | icing/icing-search-engine.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/icing/icing-search-engine.h b/icing/icing-search-engine.h index 4192169..1a5d130 100644 --- a/icing/icing-search-engine.h +++ b/icing/icing-search-engine.h @@ -567,6 +567,30 @@ class IcingSearchEngine { InitializeStatsProto* initialize_stats) ICING_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + // Implementation of IcingSearchEngine::Search that only grabs the overall + // read-lock, allowing for parallel non-exclusive operations. + // This implementation is used if search_spec.use_read_only_search is true. + SearchResultProto SearchLockedShared(const SearchSpecProto& search_spec, + const ScoringSpecProto& scoring_spec, + const ResultSpecProto& result_spec) + ICING_LOCKS_EXCLUDED(mutex_); + + // Implementation of IcingSearchEngine::Search that requires the overall + // write lock. No other operations of any kind can be executed in parallel if + // this version is used. + // This implementation is used if search_spec.use_read_only_search is false. + SearchResultProto SearchLockedExclusive(const SearchSpecProto& search_spec, + const ScoringSpecProto& scoring_spec, + const ResultSpecProto& result_spec) + ICING_LOCKS_EXCLUDED(mutex_); + + // Helper method for the actual work to Search. We need this separate + // method to manage locking for Search. + SearchResultProto InternalSearch(const SearchSpecProto& search_spec, + const ScoringSpecProto& scoring_spec, + const ResultSpecProto& result_spec) + ICING_SHARED_LOCKS_REQUIRED(mutex_); + // Processes query and scores according to the specs. It is a helper function // (called by Search) to process and score normal query and the nested child // query for join search. |