// Path: hazeltask-core/src/main/java/com/hazeltask/core/concurrent/collections/tracked/ITrackedQueue.java
// public interface ITrackedQueue<E> extends Queue<E> {
//     public Long getOldestItemTime();
//     public Long getLastAddedTime();
//     public Long getLastRemovedTime();
// }


import java.util.Collection;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
import com.google.common.base.Predicate;
import com.hazeltask.core.concurrent.collections.tracked.ITrackedQueue;
package com.hazeltask.core.concurrent.collections.grouped;




public interface IGroupedQueue<E extends Groupable<G>, G> extends BlockingQueue<E>{

    public abstract Long getOldestQueueTime();

    public abstract int drainTo(G partition, Collection<? super E> toCollection);

    public abstract int drainTo(G partition, Collection<? super E> toCollection, int max);

    public Collection<G> getGroups();
    
    public Map<G, Integer> getGroupSizes(Predicate<G> predicate);
    
// Path: hazeltask-core/src/main/java/com/hazeltask/core/concurrent/collections/tracked/ITrackedQueue.java
// public interface ITrackedQueue<E> extends Queue<E> {
//     public Long getOldestItemTime();
//     public Long getLastAddedTime();
//     public Long getLastRemovedTime();
// }


// Path: hazeltask-core/src/main/java/com/hazeltask/core/concurrent/collections/grouped/IGroupedQueue.java
import java.util.Collection;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
import com.google.common.base.Predicate;
import com.hazeltask.core.concurrent.collections.tracked.ITrackedQueue;

package com.hazeltask.core.concurrent.collections.grouped;




public interface IGroupedQueue<E extends Groupable<G>, G> extends BlockingQueue<E>{

    public abstract Long getOldestQueueTime();

    public abstract int drainTo(G partition, Collection<? super E> toCollection);

    public abstract int drainTo(G partition, Collection<? super E> toCollection, int max);

    public Collection<G> getGroups();
    
    public Map<G, Integer> getGroupSizes(Predicate<G> predicate);
    
    public ITrackedQueue<E> getQueueByGroup(G group);