aboutsummaryrefslogtreecommitdiff
path: root/icing/index/main/posting-list-hit-serializer.h
diff options
context:
space:
mode:
authorTerry Wang <tytytyww@google.com>2023-12-05 03:51:39 -0800
committerTerry Wang <tytytyww@google.com>2023-12-05 19:19:07 +0000
commitd33a748e3f9b31414d86fa6c8bad24f01ecc8dab (patch)
tree9892cbbd0fb247ce252a38f258e33741ca025a45 /icing/index/main/posting-list-hit-serializer.h
parent0dc4989937a21812e793cee451d80feb09e6b181 (diff)
parent185356a15e7a16a0a86d331ea1c87ee42f8c4844 (diff)
downloadicing-d33a748e3f9b31414d86fa6c8bad24f01ecc8dab.tar.gz
Merge remote-tracking branch 'goog/androidx-platform-dev'
* goog/androidx-platform-dev: Update Icing from upstream. Update Icing from upstream. Update Icing from upstream. Descriptions: ======================================================================== Add @UsedByNative annotations to native* methods in IcingSearchEngineImpl. ======================================================================== [Icing][version 3] Bump kVersion to 3 ======================================================================== Make lite index magic dependent on `IcingSearchEngineOptions::build_property_existence_metadata_hits` ======================================================================== Add a flag in IcingSearchEngineOptions to control whether to build property existence metadata hits ======================================================================== Support `hasProperty(property_path)` in the advanced query language ======================================================================== Add PropertyExistenceIndexingHandler to index property existence metadata hit ======================================================================== [JoinIndex Improvement][11/x] Add IcingSearchEngine initialization unit test for switching join index ======================================================================== [JoinIndex Improvement][10/x] Change/Add IcingSearchEngine unit tests ======================================================================== [JoinIndex Improvement][9/x] Integrate QualifiedIdJoinIndexImplV2 with IcingSearchEngine ======================================================================== [JoinIndex Improvement][8/x] Integrate QualifiedIdJoinIndexImplV2 with JoinProcessor ======================================================================== [JoinIndex Improvement][8/x] Integrate QualifiedIdJoinIndexImplV2 with QualifiedIdJoinIndexingHandler ======================================================================== [JoinIndex Improvement][7/x] Create QualifiedIdJoinIndex interface ======================================================================== [JoinIndex Improvement][6.1/x] Unit test (Optimize) ======================================================================== [JoinIndex Improvement][6.0/x] Unit test (General, Put, GetIterator) ======================================================================== [JoinIndex Improvement][5.3/x] Implement Optimize ======================================================================== Remove accents from Greek letters in normalizer ======================================================================== Make arm emulator tests build-only. ======================================================================== [JoinIndex Improvement][5.2/x] Implement GetIterator ======================================================================== [JoinIndex Improvement][5.1/x] Implement Put ======================================================================== [JoinIndex Improvement][5.0/x] Branch QualifiedIdJoinIndex to QualifiedIdJoinIndexImplV2 ======================================================================== [JoinIndex Improvement][4/x] Implement PostingListJoinDataAccessor ======================================================================== [JoinIndex Improvement][3/x] Implement PostingListJoinDataSerializer and DocumentIdToJoinInfo data type ======================================================================== [JoinIndex Improvement][2/x] Create NamespaceFingerprintIdentifier ======================================================================== [JoinIndex Improvement][1/x] Implement namespace_id_old_to_new in Compaction ======================================================================== Update test to also handle ICU 74 segmentation rules. ======================================================================== [Icing][Expand QueryStats][3/x] Add new fields into QueryStats (1) ======================================================================== [Icing][Expand QueryStats][2/x] Refactor QueryStatsProto ======================================================================== [Icing][Expand QueryStats][1/x] Publish DocHitInfoIterator CallStats ======================================================================== Add additional property filter tests ======================================================================== Deprecate hit_intersect_section_ids_mask in DocHitInfoIterator ======================================================================== Change default requires_full_emulation to False for portable_cc_test (third_party/icing/testing) ======================================================================== Cleanup Set requires_full_emulation to True for selective tests ======================================================================== Fix monkey test failures ======================================================================== Complete monkey test logic to change schema during monkey test runtime ======================================================================== Refactor monkey test to prepare for schema update ======================================================================== Fix the schema bug found by monkey test with seed 2551429844 ======================================================================== Move set query stats to the very top of InternalSearch() ======================================================================== Apply section restriction only on leaf nodes ======================================================================== [6/n] Fix callsites in Icing that forgot to check libtextclassifier3::Status (Advanced query parser) ======================================================================== [5/n] Fix callsites in Icing that forgot to check libtextclassifier3::Status (PersistentHashMap) ======================================================================== [4/n] Fix callsites in Icing that forgot to check libtextclassifier3::Status (PostingListIntegerIndexSerializer) ======================================================================== [3/n] Fix callsites in Icing that forgot to check libtextclassifier3::Status (PostingListHitSerializer) ======================================================================== [2/n] Fix callsites in Icing that forgot to check libtextclassifier3::Status (Posting list storage) ======================================================================== [1/n] Fix callsites in Icing that forgot to check libtextclassifier3::Status (Non-functional changes) ======================================================================== Decouple section restriction data from iterators ======================================================================== Fix the crash when a schema type gets more indexable properties than allowed ======================================================================== Add a checker to verify the property data type matches the schema. ======================================================================== Change global std::string in i18n-utils to constexpr std::string_view. ======================================================================== Adjust LiteIndex sort at indexing check conditions. ======================================================================== Fix the build error in aosp/2856025 ======================================================================== Bug: 305098009 Bug: 291130542 Bug: 275121148 Bug: 303239901 Bug: 301116242 Bug: 299321977 Bug: 300135897 Bug: 297549761 Bug: 309826655 Bug: 296349369 Bug: 302192690 Bug: 302609704 Bug: 301566713 Bug: 296938196 Change-Id: I957abd9da83e30106dac188677415bd68f64185b Merged-In: I957abd9da83e30106dac188677415bd68f64185b
Diffstat (limited to 'icing/index/main/posting-list-hit-serializer.h')
-rw-r--r--icing/index/main/posting-list-hit-serializer.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/icing/index/main/posting-list-hit-serializer.h b/icing/index/main/posting-list-hit-serializer.h
index 975b05a..2986d9c 100644
--- a/icing/index/main/posting-list-hit-serializer.h
+++ b/icing/index/main/posting-list-hit-serializer.h
@@ -23,6 +23,7 @@
#include "icing/file/posting_list/posting-list-common.h"
#include "icing/file/posting_list/posting-list-used.h"
#include "icing/index/hit/hit.h"
+#include "icing/util/status-macros.h"
namespace icing {
namespace lib {
@@ -72,8 +73,9 @@ class PostingListHitSerializer : public PostingListSerializer {
// keep_prepended is true, whatever could be prepended is kept, otherwise the
// posting list is left in its original state.
template <class T, Hit (*GetHit)(const T&)>
- uint32_t PrependHitArray(PostingListUsed* posting_list_used, const T* array,
- uint32_t num_hits, bool keep_prepended) const;
+ libtextclassifier3::StatusOr<uint32_t> PrependHitArray(
+ PostingListUsed* posting_list_used, const T* array, uint32_t num_hits,
+ bool keep_prepended) const;
// Retrieves the hits stored in the posting list.
//
@@ -312,9 +314,10 @@ class PostingListHitSerializer : public PostingListSerializer {
// Inlined functions. Implementation details below. Avert eyes!
template <class T, Hit (*GetHit)(const T&)>
-uint32_t PostingListHitSerializer::PrependHitArray(
- PostingListUsed* posting_list_used, const T* array, uint32_t num_hits,
- bool keep_prepended) const {
+libtextclassifier3::StatusOr<uint32_t>
+PostingListHitSerializer::PrependHitArray(PostingListUsed* posting_list_used,
+ const T* array, uint32_t num_hits,
+ bool keep_prepended) const {
if (!IsPostingListValid(posting_list_used)) {
return 0;
}
@@ -331,7 +334,7 @@ uint32_t PostingListHitSerializer::PrependHitArray(
// before. PopFrontHits guarantees that it will remove all 'i' hits so long
// as there are at least 'i' hits in the posting list, which we know there
// are.
- PopFrontHits(posting_list_used, /*num_hits=*/i);
+ ICING_RETURN_IF_ERROR(PopFrontHits(posting_list_used, /*num_hits=*/i));
}
return i;
}