2929import org .apache .lucene .store .IOContext ;
3030import org .apache .lucene .store .IndexInput ;
3131import org .apache .lucene .store .IndexOutput ;
32- import org .apache .lucene .util .IOUtils ;
3332import org .apache .lucene .util .InfoStream ;
3433import org .apache .lucene .util .VectorUtil ;
34+ import org .elasticsearch .core .IOUtils ;
35+ import org .elasticsearch .core .SuppressForbidden ;
3536
3637import java .io .IOException ;
3738import java .io .UncheckedIOException ;
@@ -250,6 +251,7 @@ static IVFVectorsReader getIVFReader(KnnVectorsReader vectorsReader, String fiel
250251 }
251252
252253 @ Override
254+ @ SuppressForbidden (reason = "require usage of Lucene's IOUtils#deleteFilesIgnoringExceptions(...)" )
253255 public final void mergeOneField (FieldInfo fieldInfo , MergeState mergeState ) throws IOException {
254256 rawVectorDelegate .mergeOneField (fieldInfo , mergeState );
255257 if (fieldInfo .getVectorEncoding ().equals (VectorEncoding .FLOAT32 )) {
@@ -267,7 +269,7 @@ public final void mergeOneField(FieldInfo fieldInfo, MergeState mergeState) thro
267269 success = true ;
268270 } finally {
269271 if (success == false && name != null ) {
270- IOUtils .deleteFilesIgnoringExceptions (mergeState .segmentInfo .dir , name );
272+ org . apache . lucene . util . IOUtils .deleteFilesIgnoringExceptions (mergeState .segmentInfo .dir , name );
271273 }
272274 }
273275 float [] globalCentroid = new float [fieldInfo .getVectorDimension ()];
@@ -318,7 +320,7 @@ public final void mergeOneField(FieldInfo fieldInfo, MergeState mergeState) thro
318320 } finally {
319321 if (success == false && centroidTempName != null ) {
320322 IOUtils .closeWhileHandlingException (centroidTemp );
321- IOUtils .deleteFilesIgnoringExceptions (mergeState .segmentInfo .dir , centroidTempName );
323+ org . apache . lucene . util . IOUtils .deleteFilesIgnoringExceptions (mergeState .segmentInfo .dir , centroidTempName );
322324 }
323325 }
324326 try {
@@ -356,11 +358,10 @@ public final void mergeOneField(FieldInfo fieldInfo, MergeState mergeState) thro
356358 writeMeta (fieldInfo , centroidOffset , centroidLength , offsets , globalCentroid );
357359 }
358360 } finally {
359- IOUtils .deleteFilesIgnoringExceptions (mergeState .segmentInfo .dir , name );
360- IOUtils .deleteFilesIgnoringExceptions (mergeState .segmentInfo .dir , centroidTempName );
361+ org .apache .lucene .util .IOUtils .deleteFilesIgnoringExceptions (mergeState .segmentInfo .dir , name , centroidTempName );
361362 }
362363 } finally {
363- IOUtils .deleteFilesIgnoringExceptions (mergeState .segmentInfo .dir , name );
364+ org . apache . lucene . util . IOUtils .deleteFilesIgnoringExceptions (mergeState .segmentInfo .dir , name );
364365 }
365366 }
366367 }
0 commit comments