|
29 | 29 | import java.util.List;
|
30 | 30 | import java.util.function.Function;
|
31 | 31 |
|
| 32 | +import static org.hamcrest.Matchers.containsString; |
32 | 33 | import static org.hamcrest.Matchers.equalTo;
|
33 | 34 | import static org.hamcrest.Matchers.startsWith;
|
34 | 35 |
|
@@ -112,6 +113,33 @@ public void testFFOff() {
|
112 | 113 | assertNull(format);
|
113 | 114 | }
|
114 | 115 |
|
| 116 | + public void testFFOffIndexSettingNotSupported() { |
| 117 | + assumeFalse("GPU_FORMAT feature flag disabled", GPUPlugin.GPU_FORMAT.isEnabled()); |
| 118 | + IllegalArgumentException exception = expectThrows( |
| 119 | + IllegalArgumentException.class, |
| 120 | + () -> createIndex( |
| 121 | + "index1", |
| 122 | + Settings.builder().put(GPUPlugin.VECTORS_INDEXING_USE_GPU_SETTING.getKey(), GPUPlugin.GpuMode.TRUE).build() |
| 123 | + ) |
| 124 | + ); |
| 125 | + assertThat(exception.getMessage(), containsString("unknown setting [index.vectors.indexing.use_gpu]")); |
| 126 | + } |
| 127 | + |
| 128 | + public void testFFOffGPUFormatNull() { |
| 129 | + assumeFalse("GPU_FORMAT feature flag disabled", GPUPlugin.GPU_FORMAT.isEnabled()); |
| 130 | + TestCuVSServiceProvider.mockedGPUInfoProvider = SUPPORTED_GPU_PROVIDER; |
| 131 | + |
| 132 | + GPUPlugin gpuPlugin = internalCluster().getInstance(GPUPlugin.class); |
| 133 | + VectorsFormatProvider vectorsFormatProvider = gpuPlugin.getVectorsFormatProvider(); |
| 134 | + |
| 135 | + createIndex("index1", Settings.EMPTY); |
| 136 | + IndexSettings settings = getIndexSettings(); |
| 137 | + final var indexOptions = DenseVectorFieldTypeTests.randomGpuSupportedIndexOptions(); |
| 138 | + |
| 139 | + var format = vectorsFormatProvider.getKnnVectorsFormat(settings, indexOptions); |
| 140 | + assertNull(format); |
| 141 | + } |
| 142 | + |
115 | 143 | public void testIndexSettingOnIndexTypeSupportedGPUSupported() {
|
116 | 144 | assumeTrue("GPU_FORMAT feature flag enabled", GPUPlugin.GPU_FORMAT.isEnabled());
|
117 | 145 | TestCuVSServiceProvider.mockedGPUInfoProvider = SUPPORTED_GPU_PROVIDER;
|
|
0 commit comments