private < R > R tryTwice ( Supplier < R > action ) { try { return action . get ( ) ; } catch ( UnknownIndexException e ) { waitForIndexToBeStable ( ) ; try { return action . get ( ) ; } catch ( UnknownIndexException e1 ) { throw new MolgenisDataException ( format ( "Error executing query, index for entity type '%s' with id '%s' does not exist" , getEntityType ( ) . getLabel ( ) , getEntityType ( ) . getId ( ) ) ) ; } } }
Executes an action on an index that may be unstable .