byte [ ] popOne ( ) throws GeneratorException { try { return idStack . pop ( ) ; } catch ( NoSuchElementException e ) { // Cached stack is empty, load up a fresh stack. idStack . addAll ( generator . batch ( batchSize ) ) ; return popOne ( ) ; } }
Grab a single ID from the stack . If the stack is empty load up a new batch from the wrapped generator .