public void init ( boolean fromBackup ) { if ( ! fromBackup && store . isEnabled ( ) ) { Set < Long > keys = store . loadAllKeys ( ) ; if ( keys != null ) { long maxId = - 1 ; for ( Long key : keys ) { QueueItem item = new QueueItem ( this , key , null ) ; getItemQueue ( ) . offer ( item ) ; maxId = Math . max ( maxId , key ) ; } idGenerator = maxId + 1 ; } } }
Initializes the item queue with items from the queue store if the store is enabled and if item queue is not being initialized as a part of a backup operation . If the item queue is being initialized as a part of a backup operation then the operation is in charge of adding items to a queue and the items are not loaded from a queue store .