mirror of
https://github.com/Alfresco/SearchServices.git
synced 2025-09-17 14:21:20 +00:00
76927: Merged PLATFORM1 (5.0/Cloud) to HEAD-BUG-FIX (5.0/Cloud) 67096: Merged BRANCHES/DEV/aowian/plat1_solr4 to BRANCHES/DEV/PLATFORM1 BRANCHES/DEV/PLATFORM1: 65032: ACE-916: Carve out tracking from SOLR 1.4 - Initial checkin. Does not compile 65034: ACE-916: Carve out tracking from SOLR 1.4 - Another checkin. Does not compile 65036: ACE-916: Carve out tracking from SOLR 1.4 - Another checkin. Does not compile - Added InformationServer interface 65393: ACE-916: Carve out tracking from SOLR 1.4 - Another checkin. Does not compile 65963: ACE-916: Carve out tracking from SOLR 1.4 - Changed references of toDocument method to LegacySolrInformationServer 65988: ACE-916: Carve out tracking from SOLR 1.4 - Created individual classes and got CoreTracker and LegacySolrInformationServer to compile 66090: ACE-916: Carve out tracking from SOLR 1.4 - Getting closer to no red 66091: ACE-916: Carve out tracking from SOLR 1.4 - Getting closer to no red 66092: ACE-916: Carve out tracking from SOLR 1.4 - Getting closer to no red 66847: ACE-916: Carve out tracking from SOLR 1.4 - Updated eclipse .project files to include SONAR nature - Updated solr4 pom to use different port - Added adapter for solr data object in SOLR Client, therefore introducing dependency on legacy jars while keeping the main client code version agnostic - TODO: Finish making Tracker API work in client project, and explore moving trackers into client project 66863: ACE-916: Carve out tracking from SOLR 1.4 - Moved Tracker, TrackerStats, etc into Client project, and abstracted some data objects. - TODO: Deal with AlfrescoSolrDataModel 66926: ACE-916: Carve out tracking from SOLR 1.4 - Removed some classes that had already been moved - TODO: Deal with AlfrescoSolrDataModel 66957: ACE-916: Carve out tracking from SOLR 1.4 - Moved adapters into legacy solr project and removed client project's dependency on legacy jars. - TODO: Deal with AlfrescoSolrDataModel 66959: ACE-916: Carve out tracking from SOLR 1.4 - Moved AlfrescoSolrDataModel to InformationServer and exposed needed APIs - Finally, the red is gone, and the code compiles. 67027: ACE-916: Carve out tracking from SOLR 1.4 - Removed unused import 67028: ACE-916: Carve out tracking from SOLR 1.4 - Merged PLATFORM1 to aowian/plat1_solr4 67029: ACE-916: Carve out tracking from SOLR 1.4 - Merged PLATFORM1 to aowian/plat1_solr4 67076: ACE-916: Carve out tracking from SOLR 1.4 - Reverse merged from aowian/plat1_solr4 to aowian/plat1_solr4 at -67028 67090: ACE-916: Carve out tracking from SOLR 1.4 - Merged PLATFORM1 at 67076 to aowian/plat1_solr4 67093: ACE-916: Carve out tracking from SOLR 1.4 - Merged PLATFORM1 at 67085 to aowian/plat1_solr4 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@77771 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
61 lines
1.0 KiB
Java
61 lines
1.0 KiB
Java
|
|
package org.alfresco.solr;
|
|
|
|
import java.util.Iterator;
|
|
import java.util.concurrent.LinkedBlockingDeque;
|
|
|
|
public class BoundedDeque<T> implements Iterable<T>
|
|
{
|
|
private LinkedBlockingDeque<T> deque;
|
|
|
|
private int max = 10;
|
|
|
|
public BoundedDeque(int max)
|
|
{
|
|
this.max = max;
|
|
setDeque(new LinkedBlockingDeque<T>());
|
|
}
|
|
|
|
/**
|
|
* @return
|
|
*/
|
|
public int size()
|
|
{
|
|
return getDeque().size();
|
|
}
|
|
|
|
public void add(T add)
|
|
{
|
|
while (getDeque().size() > (max - 1))
|
|
{
|
|
getDeque().removeLast();
|
|
}
|
|
getDeque().addFirst(add);
|
|
}
|
|
|
|
public T getLast()
|
|
{
|
|
return getDeque().getFirst();
|
|
}
|
|
|
|
/*
|
|
* (non-Javadoc)
|
|
* @see java.lang.Iterable#iterator()
|
|
*/
|
|
@Override
|
|
public Iterator<T> iterator()
|
|
{
|
|
return getDeque().iterator();
|
|
}
|
|
|
|
public LinkedBlockingDeque<T> getDeque()
|
|
{
|
|
return deque;
|
|
}
|
|
|
|
public void setDeque(LinkedBlockingDeque<T> deque)
|
|
{
|
|
this.deque = deque;
|
|
}
|
|
|
|
} |