public void checkAndRetry ( final Iterable < ? extends T > iterable , final LongIterable values ) throws IOException { final RandomGenerator random = new XoRoShiRo128PlusRandomGenerator ( ) ; int duplicates = 0 ; for ( ; ; ) try { check ( ) ; break ; } catch ( final DuplicateException e ) { if ( duplicates ++ > 3 ) throw new IllegalArgumentException ( "The input list contains duplicates" ) ; LOGGER . warn ( "Found duplicate. Recomputing triples..." ) ; reset ( random . nextLong ( ) ) ; addAll ( iterable . iterator ( ) , values . iterator ( ) ) ; } checkedForDuplicates = true ; }
Checks that this store has no duplicate triples and try to rebuild if this fails to happen .