41
41
42
42
import static java .util .stream .Collectors .toUnmodifiableMap ;
43
43
import static org .opensearch .common .settings .Setting .Property .Dynamic ;
44
+ import static org .opensearch .common .settings .Setting .Property .Final ;
44
45
import static org .opensearch .common .settings .Setting .Property .IndexScope ;
45
46
import static org .opensearch .common .settings .Setting .Property .NodeScope ;
46
- import static org .opensearch .common .settings .Setting .Property .Final ;
47
47
import static org .opensearch .common .settings .Setting .Property .UnmodifiableOnRestore ;
48
48
import static org .opensearch .common .unit .MemorySizeValue .parseBytesSizeValueOrHeapRatio ;
49
49
import static org .opensearch .core .common .unit .ByteSizeValue .parseBytesSizeValue ;
@@ -94,6 +94,8 @@ public class KNNSettings {
94
94
public static final String KNN_FAISS_AVX512_SPR_DISABLED = "knn.faiss.avx512_spr.disabled" ;
95
95
public static final String KNN_DISK_VECTOR_SHARD_LEVEL_RESCORING_DISABLED = "index.knn.disk.vector.shard_level_rescoring_disabled" ;
96
96
public static final String KNN_DERIVED_SOURCE_ENABLED = "index.knn.derived_source.enabled" ;
97
+ public static final String KNN_INDEX_REMOTE_VECTOR_BUILD = "index.knn.remote_index_build.enabled" ;
98
+ public static final String KNN_REMOTE_VECTOR_REPO = "knn.remote_index_build.vector_repo" ;
97
99
98
100
/**
99
101
* Default setting values
@@ -371,6 +373,15 @@ public class KNNSettings {
371
373
NodeScope
372
374
);
373
375
376
+ public static final Setting <Boolean > KNN_INDEX_REMOTE_VECTOR_BUILD_SETTING = Setting .boolSetting (
377
+ KNN_INDEX_REMOTE_VECTOR_BUILD ,
378
+ false ,
379
+ Dynamic ,
380
+ IndexScope
381
+ );
382
+
383
+ public static final Setting <String > KNN_REMOTE_VECTOR_REPO_SETTING = Setting .simpleString (KNN_REMOTE_VECTOR_REPO , Dynamic , NodeScope );
384
+
374
385
/**
375
386
* Dynamic settings
376
387
*/
@@ -525,6 +536,14 @@ private Setting<?> getSetting(String key) {
525
536
return KNN_DERIVED_SOURCE_ENABLED_SETTING ;
526
537
}
527
538
539
+ if (KNN_INDEX_REMOTE_VECTOR_BUILD .equals (key )) {
540
+ return KNN_INDEX_REMOTE_VECTOR_BUILD_SETTING ;
541
+ }
542
+
543
+ if (KNN_REMOTE_VECTOR_REPO .equals (key )) {
544
+ return KNN_REMOTE_VECTOR_REPO_SETTING ;
545
+ }
546
+
528
547
throw new IllegalArgumentException ("Cannot find setting by key [" + key + "]" );
529
548
}
530
549
@@ -550,7 +569,9 @@ public List<Setting<?>> getSettings() {
550
569
QUANTIZATION_STATE_CACHE_SIZE_LIMIT_SETTING ,
551
570
QUANTIZATION_STATE_CACHE_EXPIRY_TIME_MINUTES_SETTING ,
552
571
KNN_DISK_VECTOR_SHARD_LEVEL_RESCORING_DISABLED_SETTING ,
553
- KNN_DERIVED_SOURCE_ENABLED_SETTING
572
+ KNN_DERIVED_SOURCE_ENABLED_SETTING ,
573
+ KNN_INDEX_REMOTE_VECTOR_BUILD_SETTING ,
574
+ KNN_REMOTE_VECTOR_REPO_SETTING
554
575
);
555
576
return Stream .concat (settings .stream (), Stream .concat (getFeatureFlags ().stream (), dynamicCacheSettings .values ().stream ()))
556
577
.collect (Collectors .toList ());
0 commit comments