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: 15 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 // Number of namespaces seen from the current documents. 104 // 105 // TODO(cassiewang): This isn't technically needed anymore since clients can 106 // get this number from namespace_storage_info. Consider removing this. 107 optional int32 num_namespaces = 13; 108 109 // Storage information of each namespace. 110 repeated NamespaceStorageInfoProto namespace_storage_info = 14; 111} 112 113// Next tag: 5 114message SchemaStoreStorageInfoProto { 115 // Size of the schema store in bytes. Will be set to -1 if an IO error is 116 // encountered while calculating this field. 117 optional int64 schema_store_size = 1; 118 119 // Total number of schema types. 120 optional int32 num_schema_types = 2; 121 122 // Total number of all sections across all types 123 optional int32 num_total_sections = 3; 124 125 // Total number of types at the current section limit. 126 optional int32 num_schema_types_sections_exhausted = 4; 127} 128 129// Next tag: 9 130message IndexStorageInfoProto { 131 // Total size of the index in bytes. Will be set to -1 if an IO error is 132 // encountered while calculating this field. 133 optional int64 index_size = 1; 134 135 // Size of the lite index lexicon in bytes. Will be set to -1 if an IO error 136 // is encountered while calculating this field. 137 optional int64 lite_index_lexicon_size = 2; 138 139 // Size of the lite index hit buffer in bytes. Will be set to -1 if an IO 140 // error is encountered while calculating this field. 141 optional int64 lite_index_hit_buffer_size = 3; 142 143 // Size of the main index lexicon in bytes. Will be set to -1 if an IO error 144 // is encountered while calculating this field. 145 optional int64 main_index_lexicon_size = 4; 146 147 // Size of the main index storage in bytes. Will be set to -1 if an IO error 148 // is encountered while calculating this field. 149 optional int64 main_index_storage_size = 5; 150 151 // Size of one main index block in bytes. 152 optional int64 main_index_block_size = 6; 153 154 // Number of main index blocks. 155 optional int32 num_blocks = 7; 156 157 // Percentage of the main index blocks that are free, assuming 158 // allocated blocks are fully used. 159 optional float min_free_fraction = 8; 160} 161 162// Next tag: 5 163message StorageInfoProto { 164 // Total size of Icing’s storage in bytes. Will be set to -1 if an IO error is 165 // encountered while calculating this field. 166 optional int64 total_storage_size = 1; 167 168 // Storage information of the document store. 169 optional DocumentStorageInfoProto document_storage_info = 2; 170 171 // Storage information of the schema store. 172 optional SchemaStoreStorageInfoProto schema_store_storage_info = 3; 173 174 // Storage information of the index. 175 optional IndexStorageInfoProto index_storage_info = 4; 176} 177 178// Next tag: 3 179message StorageInfoResultProto { 180 // Status code can be one of: 181 // OK 182 // FAILED_PRECONDITION 183 // 184 // See status.proto for more details. 185 optional StatusProto status = 1; 186 187 // Storage information of Icing. 188 optional StorageInfoProto storage_info = 2; 189} 190