public Queue < SessionSchedulable > createSessionQueue ( ScheduleComparator comparator ) { int initCapacity = snapshotSessions . size ( ) == 0 ? 1 : snapshotSessions . size ( ) ; Queue < SessionSchedulable > sessionQueue = new PriorityQueue < SessionSchedulable > ( initCapacity , comparator ) ; sessionQueue . addAll ( snapshotSessions ) ; return sessionQueue ; }
Get the queue of sessions in the pool sorted by comparator