1// Copyright 2021 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/status.proto"; 20 21option java_package = "com.google.android.icing.proto"; 22option java_multiple_files = true; 23option objc_class_prefix = "ICNG"; 24 25// TODO(b/305098009): fix byte size vs size naming issue. 26 27// Next tag: 10 28message NamespaceStorageInfoProto { 29 // Name of the namespace 30 optional string namespace = 1; 31 32 // Number of alive documents in this namespace. 33 optional int32 num_alive_documents = 2; 34 35 // NOTE: We don't have stats on number of deleted documents in a namespace 36 // since we completely erase all data on a document when it's deleted. And we 37 // can't figure out which namespace it belonged to. 38 39 // Number of expired documents in this namespace. 40 optional int32 num_expired_documents = 3; 41 42 // LINT.IfChange(namespace_storage_info_usage_types) 43 // Number of alive documents that have a UsageReport.usage_type reported 44 optional int32 num_alive_documents_usage_type1 = 4; 45 optional int32 num_alive_documents_usage_type2 = 5; 46 optional int32 num_alive_documents_usage_type3 = 6; 47 48 // Number of expired documents that have a UsageReport.usage_type reported 49 optional int32 num_expired_documents_usage_type1 = 7; 50 optional int32 num_expired_documents_usage_type2 = 8; 51 optional int32 num_expired_documents_usage_type3 = 9; 52 // LINT.ThenChange() 53} 54 55// Next tag: 16 56message DocumentStorageInfoProto { 57 // Total number of alive documents. 58 optional int32 num_alive_documents = 1; 59 60 // Total number of deleted documents. 61 optional int32 num_deleted_documents = 2; 62 63 // Total number of expired documents. 64 optional int32 num_expired_documents = 3; 65 66 // Total size of the document store in bytes. Will be set to -1 if an IO error 67 // is encountered while calculating this field. 68 optional int64 document_store_size = 4; 69 70 // Total size of the ground truth in bytes. The ground truth may 71 // include deleted or expired documents. Will be set to -1 if an IO error is 72 // encountered while calculating this field. 73 optional int64 document_log_size = 5; 74 75 // Size of the key mapper in bytes. Will be set to -1 if an IO error is 76 // encountered while calculating this field. 77 optional int64 key_mapper_size = 6; 78 79 // Size of the document id mapper in bytes. Will be set to -1 if an IO error 80 // is encountered while calculating this field. 81 optional int64 document_id_mapper_size = 7; 82 83 // Size of the score cache in bytes. Will be set to -1 if an IO error is 84 // encountered while calculating this field. 85 optional int64 score_cache_size = 8; 86 87 // Size of the filter cache in bytes. Will be set to -1 if an IO error is 88 // encountered while calculating this field. 89 optional int64 filter_cache_size = 9; 90 91 // Size of the corpus mapper in bytes. Will be set to -1 if an IO error is 92 // encountered while calculating this field. 93 optional int64 corpus_mapper_size = 10; 94 95 // Size of the corpus score cache in bytes. Will be set to -1 if an IO error 96 // is encountered while calculating this field. 97 optional int64 corpus_score_cache_size = 11; 98 99 // Size of the namespace id mapper in bytes. Will be set to -1 if an IO error 100 // is encountered while calculating this field. 101 optional int64 namespace_id_mapper_size = 12; 102 103 // Size of the scorable properties cache in bytes. Will be set to -1 if an IO 104 // error is encountered while calculating this field. 105 optional int64 scorable_property_cache_size = 15; 106 107 // Number of namespaces seen from the current documents. 108 // 109 // TODO(cassiewang): This isn't technically needed anymore since clients can 110 // get this number from namespace_storage_info. Consider removing this. 111 optional int32 num_namespaces = 13; 112 113 // Storage information of each namespace. 114 repeated NamespaceStorageInfoProto namespace_storage_info = 14; 115} 116 117// Next tag: 5 118message SchemaStoreStorageInfoProto { 119 // Size of the schema store in bytes. Will be set to -1 if an IO error is 120 // encountered while calculating this field. 121 optional int64 schema_store_size = 1; 122 123 // Total number of schema types. 124 optional int32 num_schema_types = 2; 125 126 // Total number of all sections across all types 127 optional int32 num_total_sections = 3; 128 129 // Total number of types at the current section limit. 130 optional int32 num_schema_types_sections_exhausted = 4; 131} 132 133// Next tag: 9 134message IndexStorageInfoProto { 135 // Total size of the index in bytes. Will be set to -1 if an IO error is 136 // encountered while calculating this field. 137 optional int64 index_size = 1; 138 139 // Size of the lite index lexicon in bytes. Will be set to -1 if an IO error 140 // is encountered while calculating this field. 141 optional int64 lite_index_lexicon_size = 2; 142 143 // Size of the lite index hit buffer in bytes. Will be set to -1 if an IO 144 // error is encountered while calculating this field. 145 optional int64 lite_index_hit_buffer_size = 3; 146 147 // Size of the main index lexicon in bytes. Will be set to -1 if an IO error 148 // is encountered while calculating this field. 149 optional int64 main_index_lexicon_size = 4; 150 151 // Size of the main index storage in bytes. Will be set to -1 if an IO error 152 // is encountered while calculating this field. 153 optional int64 main_index_storage_size = 5; 154 155 // Size of one main index block in bytes. 156 optional int64 main_index_block_size = 6; 157 158 // Number of main index blocks. 159 optional int32 num_blocks = 7; 160 161 // Percentage of the main index blocks that are free, assuming 162 // allocated blocks are fully used. 163 optional float min_free_fraction = 8; 164} 165 166// Next tag: 5 167message NamespaceBlobStorageInfoProto { 168 // The namespace name of who own the blobs. 169 optional string namespace = 1; 170 171 // If Icing manages blob files, this field will be the total size of blobs 172 // storage of this namespace in bytes. Otherwise, this field will be unset. 173 optional int64 blob_size = 2; 174 175 // If Icing manages blob files, this field will be the total number of blobs 176 // of this namespace. Otherwise, this field will be unset. 177 optional int32 num_blobs = 3; 178 179 // If Icing does not manage blob files, this field will be the list of blob 180 // file names in this namespace. Otherwise, this field will be empty. 181 repeated string blob_file_names = 4; 182} 183 184// Next tag: 6 185message StorageInfoProto { 186 // Total size of Icing’s storage in bytes. Will be set to -1 if an IO error is 187 // encountered while calculating this field. 188 optional int64 total_storage_size = 1; 189 190 // Storage information of the document store. 191 optional DocumentStorageInfoProto document_storage_info = 2; 192 193 // Storage information of the schema store. 194 optional SchemaStoreStorageInfoProto schema_store_storage_info = 3; 195 196 // Storage information of the index. 197 optional IndexStorageInfoProto index_storage_info = 4; 198 199 // Storage information of the BlobStore. 200 repeated NamespaceBlobStorageInfoProto namespace_blob_storage_info = 5; 201} 202 203// Next tag: 3 204message StorageInfoResultProto { 205 // Status code can be one of: 206 // OK 207 // FAILED_PRECONDITION 208 // 209 // See status.proto for more details. 210 optional StatusProto status = 1; 211 212 // Storage information of Icing. 213 optional StorageInfoProto storage_info = 2; 214} 215