1 /* 2 * Copyright 2023 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.server.appsearch.external.localstorage; 18 19 20 /** 21 * Icing options for AppSearch local-storage. Note, these values are not necessarily the defaults 22 * set in {@link com.google.android.icing.proto.IcingSearchEngineOptions} proto. 23 */ 24 public class LocalStorageIcingOptionsConfig implements IcingOptionsConfig { 25 @Override getMaxTokenLength()26 public int getMaxTokenLength() { 27 return DEFAULT_MAX_TOKEN_LENGTH; 28 } 29 30 @Override getIndexMergeSize()31 public int getIndexMergeSize() { 32 return DEFAULT_INDEX_MERGE_SIZE; 33 } 34 35 @Override getDocumentStoreNamespaceIdFingerprint()36 public boolean getDocumentStoreNamespaceIdFingerprint() { 37 return true; 38 } 39 40 @Override getOptimizeRebuildIndexThreshold()41 public float getOptimizeRebuildIndexThreshold() { 42 return 0.9f; 43 } 44 45 @Override getCompressionLevel()46 public int getCompressionLevel() { 47 return DEFAULT_COMPRESSION_LEVEL; 48 } 49 50 @Override getAllowCircularSchemaDefinitions()51 public boolean getAllowCircularSchemaDefinitions() { 52 return true; 53 } 54 55 @Override getUseReadOnlySearch()56 public boolean getUseReadOnlySearch() { 57 return true; 58 } 59 60 @Override getUsePreMappingWithFileBackedVector()61 public boolean getUsePreMappingWithFileBackedVector() { 62 return false; 63 } 64 65 @Override getUsePersistentHashMap()66 public boolean getUsePersistentHashMap() { 67 return true; 68 } 69 70 @Override getMaxPageBytesLimit()71 public int getMaxPageBytesLimit() { 72 return DEFAULT_MAX_PAGE_BYTES_LIMIT; 73 } 74 75 @Override getIntegerIndexBucketSplitThreshold()76 public int getIntegerIndexBucketSplitThreshold() { 77 return DEFAULT_INTEGER_INDEX_BUCKET_SPLIT_THRESHOLD; 78 } 79 80 @Override getLiteIndexSortAtIndexing()81 public boolean getLiteIndexSortAtIndexing() { 82 return DEFAULT_LITE_INDEX_SORT_AT_INDEXING; 83 } 84 85 @Override getLiteIndexSortSize()86 public int getLiteIndexSortSize() { 87 return DEFAULT_LITE_INDEX_SORT_SIZE; 88 } 89 90 @Override getUseNewQualifiedIdJoinIndex()91 public boolean getUseNewQualifiedIdJoinIndex() { 92 return DEFAULT_USE_NEW_QUALIFIED_ID_JOIN_INDEX; 93 } 94 95 @Override getBuildPropertyExistenceMetadataHits()96 public boolean getBuildPropertyExistenceMetadataHits() { 97 return true; 98 } 99 100 @Override getOrphanBlobTimeToLiveMs()101 public long getOrphanBlobTimeToLiveMs() { 102 return DEFAULT_ORPHAN_BLOB_TIME_TO_LIVE_MS; 103 } 104 } 105