diff options
author | Tim Barron <tjbarron@google.com> | 2022-04-12 14:30:14 -0700 |
---|---|---|
committer | Tim Barron <tjbarron@google.com> | 2022-04-12 14:36:38 -0700 |
commit | d5c9ae94052a0f2f1b9ddec9dbbe502bc4f11d54 (patch) | |
tree | 90b929dc92d5874b5c15caca064401196ab4fc65 /proto | |
parent | beff93fe1f5165aeeb871d9711963aa1846299ae (diff) | |
download | icing-d5c9ae94052a0f2f1b9ddec9dbbe502bc4f11d54.tar.gz |
Sync from upstream.
======================================================================
Refactor DocumentStore::Initialize to improve readability of document store recovery.
======================================================================
Remove non-NDK API usages of ICU4C in libicing.
======================================================================
Move IcuDataFileHelper to the testing directory since it is a test-only util.
======================================================================
Support dump function for DocumentStore
======================================================================
Switch to use PRead rather than MMap in the proto log.
======================================================================
Support dump function for main/lite index and lexicon
======================================================================
Fix LiteIndex::AppendHits
======================================================================
Enable and fix DocumentStoreTest.LoadScoreCacheAndInitializeSuccessfully
======================================================================
Fix MainIndex::GetStorageInfo.
======================================================================
Fix icing-search-engine_fuzz_test by making IcuLanguageSegmenterIterator::Advance non-recursive.
======================================================================
Allow to return additional information for deleted documents in DeleteByQuery
======================================================================
Using enum class in Token::Type for better type safety.
======================================================================
Bug: 158089703
Bug: 185845269
Bug: 209071710
Bug: 211785521
Bug: 218413237
Bug: 223549255
Change-Id: Id2786047ab279734bdd2aee883e82607b6a0e403
Diffstat (limited to 'proto')
-rw-r--r-- | proto/icing/proto/debug.proto | 112 | ||||
-rw-r--r-- | proto/icing/proto/document.proto | 15 | ||||
-rw-r--r-- | proto/icing/proto/logging.proto | 3 |
3 files changed, 129 insertions, 1 deletions
diff --git a/proto/icing/proto/debug.proto b/proto/icing/proto/debug.proto new file mode 100644 index 0000000..3f07539 --- /dev/null +++ b/proto/icing/proto/debug.proto @@ -0,0 +1,112 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto2"; + +package icing.lib; + +import "icing/proto/status.proto"; +import "icing/proto/storage.proto"; + +option java_package = "com.google.android.icing.proto"; +option java_multiple_files = true; +option objc_class_prefix = "ICNG"; + +// Next tag: 4 +message IndexDebugInfoProto { + // Storage information of the index. + optional IndexStorageInfoProto index_storage_info = 1; + + message MainIndexDebugInfoProto { + // Information about the main lexicon. + // TODO(b/222349894) Convert the string output to a protocol buffer instead. + optional string lexicon_info = 1; + + // Last added document id. + optional uint32 last_added_document_id = 2; + + // If verbosity > 0, return information about the posting list storage. + // TODO(b/222349894) Convert the string output to a protocol buffer instead. + optional string flash_index_storage_info = 3; + } + optional MainIndexDebugInfoProto main_index_info = 2; + + message LiteIndexDebugInfoProto { + // Current number of hits. + optional uint32 curr_size = 1; + + // The maximum possible number of hits. + optional uint32 hit_buffer_size = 2; + + // Last added document id. + optional uint32 last_added_document_id = 3; + + // The first position in the hit buffer that is not sorted yet, + // or curr_size if all hits are sorted. + optional uint32 searchable_end = 4; + + // The most recent checksum of the lite index, by calling + // LiteIndex::ComputeChecksum(). + optional uint32 index_crc = 5; + + // Information about the lite lexicon. + // TODO(b/222349894) Convert the string output to a protocol buffer instead. + optional string lexicon_info = 6; + } + optional LiteIndexDebugInfoProto lite_index_info = 3; +} + +// Next tag: 4 +message DocumentDebugInfoProto { + // Storage information of the document store. + optional DocumentStorageInfoProto document_storage_info = 1; + + // The most recent checksum of the document store, by calling + // DocumentStore::ComputeChecksum(). + optional uint32 crc = 2; + + message CorpusInfo { + optional string namespace = 1; + optional string schema = 2; + optional uint32 total_documents = 3; + optional uint32 total_token = 4; + } + + // If verbosity > 0, return the total number of documents and tokens in each + // (namespace, schema type) pair. + // Note that deleted and expired documents are skipped in the output. + repeated CorpusInfo corpus_info = 3; +} + +// Next tag: 3 +message DebugInfoProto { + // Debug information of the index. + optional IndexDebugInfoProto index_info = 1; + + // Debug information of the document store. + optional DocumentDebugInfoProto document_info = 2; +} + +// Next tag: 3 +message DebugInfoResultProto { + // Status code can be one of: + // OK + // FAILED_PRECONDITION + // + // See status.proto for more details. + optional StatusProto status = 1; + + // Debug information for Icing. + optional DebugInfoProto debug_info = 2; +} diff --git a/proto/icing/proto/document.proto b/proto/icing/proto/document.proto index 2e8321b..1a501e7 100644 --- a/proto/icing/proto/document.proto +++ b/proto/icing/proto/document.proto @@ -209,7 +209,7 @@ message DeleteBySchemaTypeResultProto { } // Result of a call to IcingSearchEngine.DeleteByQuery -// Next tag: 4 +// Next tag: 5 message DeleteByQueryResultProto { // Status code can be one of: // OK @@ -226,5 +226,18 @@ message DeleteByQueryResultProto { // Stats for delete execution performance. optional DeleteByQueryStatsProto delete_by_query_stats = 3; + // Used by DeleteByQueryResultProto to return information about deleted + // documents. + message DocumentGroupInfo { + optional string namespace = 1; + optional string schema = 2; + repeated string uris = 3; + } + + // Additional return message that shows the uris of the deleted documents, if + // users set return_deleted_document_info to true. + // The result is grouped by the corresponding namespace and type. + repeated DocumentGroupInfo deleted_documents = 4; + reserved 2; } diff --git a/proto/icing/proto/logging.proto b/proto/icing/proto/logging.proto index 2f1f271..0a7c4a6 100644 --- a/proto/icing/proto/logging.proto +++ b/proto/icing/proto/logging.proto @@ -46,6 +46,9 @@ message InitializeStatsProto { // Random I/O errors. IO_ERROR = 4; + + // The document log is using legacy format. + LEGACY_DOCUMENT_LOG_FORMAT = 5; } // Possible recovery causes for document store: |