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,21 @@ public class KNNSettings {
371
373
NodeScope
372
374
);
373
375
376
+ /**
377
+ * Index level setting to control whether remote index build is enabled or not.
378
+ */
379
+ public static final Setting <Boolean > KNN_INDEX_REMOTE_VECTOR_BUILD_SETTING = Setting .boolSetting (
380
+ KNN_INDEX_REMOTE_VECTOR_BUILD ,
381
+ false ,
382
+ Dynamic ,
383
+ IndexScope
384
+ );
385
+
386
+ /**
387
+ * Cluster level setting which indicates the repository that the remote index build should write to.
388
+ */
389
+ public static final Setting <String > KNN_REMOTE_VECTOR_REPO_SETTING = Setting .simpleString (KNN_REMOTE_VECTOR_REPO , Dynamic , NodeScope );
390
+
374
391
/**
375
392
* Dynamic settings
376
393
*/
@@ -525,6 +542,14 @@ private Setting<?> getSetting(String key) {
525
542
return KNN_DERIVED_SOURCE_ENABLED_SETTING ;
526
543
}
527
544
545
+ if (KNN_INDEX_REMOTE_VECTOR_BUILD .equals (key )) {
546
+ return KNN_INDEX_REMOTE_VECTOR_BUILD_SETTING ;
547
+ }
548
+
549
+ if (KNN_REMOTE_VECTOR_REPO .equals (key )) {
550
+ return KNN_REMOTE_VECTOR_REPO_SETTING ;
551
+ }
552
+
528
553
throw new IllegalArgumentException ("Cannot find setting by key [" + key + "]" );
529
554
}
530
555
@@ -550,7 +575,9 @@ public List<Setting<?>> getSettings() {
550
575
QUANTIZATION_STATE_CACHE_SIZE_LIMIT_SETTING ,
551
576
QUANTIZATION_STATE_CACHE_EXPIRY_TIME_MINUTES_SETTING ,
552
577
KNN_DISK_VECTOR_SHARD_LEVEL_RESCORING_DISABLED_SETTING ,
553
- KNN_DERIVED_SOURCE_ENABLED_SETTING
578
+ KNN_DERIVED_SOURCE_ENABLED_SETTING ,
579
+ KNN_INDEX_REMOTE_VECTOR_BUILD_SETTING ,
580
+ KNN_REMOTE_VECTOR_REPO_SETTING
554
581
);
555
582
return Stream .concat (settings .stream (), Stream .concat (getFeatureFlags ().stream (), dynamicCacheSettings .values ().stream ()))
556
583
.collect (Collectors .toList ());
0 commit comments