• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2022 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto2";
16
17package icing.lib;
18
19import "icing/proto/schema.proto";
20import "icing/proto/status.proto";
21import "icing/proto/storage.proto";
22
23option java_package = "com.google.android.icing.proto";
24option java_multiple_files = true;
25option objc_class_prefix = "ICNG";
26
27message LogSeverity {
28  enum Code {
29    VERBOSE = 0;
30    // Unable to use DEBUG at this time because it breaks YTM's iOS tests
31    // cs/?q=%22-DDEBUG%3D1%22%20f:%2FYoutubeMusic%20f:blueprint&ssfr=1
32    DBG = 1;
33    INFO = 2;
34    WARNING = 3;
35    ERROR = 4;
36    FATAL = 5;
37  }
38}
39
40message DebugInfoVerbosity {
41  enum Code {
42    // Simplest debug information.
43    BASIC = 0;
44    // More detailed debug information as indicated in the field documentation
45    // below.
46    DETAILED = 1;
47  }
48}
49
50// Next tag: 4
51message IndexDebugInfoProto {
52  // Storage information of the index.
53  optional IndexStorageInfoProto index_storage_info = 1;
54
55  // A formatted string containing the following information:
56  // lexicon_info: Information about the main lexicon
57  // last_added_document_id: Last added document id
58  // flash_index_storage_info: If verbosity = DETAILED, return information about
59  //                           the posting list storage
60  //
61  // No direct contents from user-provided documents will ever appear in this
62  // string.
63  optional string main_index_info = 2;
64
65  // A formatted string containing the following information:
66  // curr_size: Current number of hits
67  // hit_buffer_size: The maximum possible number of hits
68  // last_added_document_id: Last added document id
69  // searchable_end: The first position in the hit buffer that is not sorted
70  //                 yet, or curr_size if all hits are sorted
71  // index_crc: The most recent checksum of the lite index, by calling
72  //            LiteIndex::ComputeChecksum()
73  // lexicon_info: Information about the lite lexicon
74  //
75  // No direct contents from user-provided documents will ever appear in this
76  // string.
77  optional string lite_index_info = 3;
78}
79
80// Next tag: 4
81message DocumentDebugInfoProto {
82  // Storage information of the document store.
83  optional DocumentStorageInfoProto document_storage_info = 1;
84
85  // The most recent checksum of the document store, by calling
86  // DocumentStore::ComputeChecksum().
87  optional uint32 crc = 2;
88
89  message CorpusInfo {
90    optional string namespace = 1;
91    optional string schema = 2;
92    optional uint32 total_documents = 3;
93    optional uint32 total_token = 4;
94  }
95
96  // If verbosity = DETAILED, return the total number of documents and tokens in
97  // each (namespace, schema type) pair.
98  // Note that deleted and expired documents are skipped in the output.
99  repeated CorpusInfo corpus_info = 3;
100}
101
102// Next tag: 3
103message SchemaDebugInfoProto {
104  // Copy of the SchemaProto if it has been set in the schema store.
105  // Modifying this does not affect the Schema that IcingSearchEngine holds.
106  optional SchemaProto schema = 1;
107
108  // The most recent checksum of the schema store, by calling
109  // SchemaStore::ComputeChecksum().
110  optional uint32 crc = 2;
111}
112
113// Next tag: 4
114message DebugInfoProto {
115  // Debug information of the index.
116  optional IndexDebugInfoProto index_info = 1;
117
118  // Debug information of the document store.
119  optional DocumentDebugInfoProto document_info = 2;
120
121  // Debug information of the schema store.
122  optional SchemaDebugInfoProto schema_info = 3;
123}
124
125// Next tag: 3
126message DebugInfoResultProto {
127  // Status code can be one of:
128  //   OK
129  //   FAILED_PRECONDITION if IcingSearchEngine has not been initialized yet
130  //   INTERNAL on IO errors, crc compute error.
131  //
132  // See status.proto for more details.
133  optional StatusProto status = 1;
134
135  // Debug information for Icing.
136  optional DebugInfoProto debug_info = 2;
137}
138