void insertIndex(IProgressMonitor monitor, GenericRelation r, int boundLength, Collection<Object[]> documentsData)
throws CorruptIndexException, IOException, DatabaseException {
- Collection<Object> keyValues = new ArrayList<Object>();
+ Collection<Object> keyValues = new ArrayList<>();
for(Object[] data : documentsData) {
keyValues.add(data[1]);
}
//cache.commit();
}
-
+
+ @Override
+ void removeIndex(IProgressMonitor monitor) throws DatabaseException, CorruptIndexException, IOException {
+ super.removeIndex(monitor);
+ cache.removeIndex(monitor);
+ }
+
@Override
void removeIndex(IProgressMonitor monitor, GenericRelation r, RequestProcessor processor, String key, Collection<Object> keyValues) throws DatabaseException,CorruptIndexException, IOException {
- Collection<Object[]> documentsData = new ArrayList<Object[]>();
+ Collection<Object[]> documentsData = new ArrayList<>();
Pair<String,String>[] fields = r.getFields();
List<Map<String, Object>> results = super.doSearch(monitor, processor, search, maxResultCount);
if(cache == null) {
- cache = new HashMap<String,List<Map<String,Object>>>();
+ cache = new HashMap<>();
mem.persistentCache.put(key, cache);
}
List<Resource> results = super.doSearchResources(monitor, processor, search, maxResultCount);
if(cache == null) {
- cache = new HashMap<String,List<Resource>>();
+ cache = new HashMap<>();
mem.persistentCacheResources.put(key, cache);
}
List<Map<String,Object>> persistent = persistentCachedSearch(monitor, processor, search, maxResultCount);
List<Map<String,Object>> cached = cache.doSearch(monitor, processor, search, maxResultCount);
- ArrayList<Map<String,Object>> result = new ArrayList<Map<String,Object>>();
+ ArrayList<Map<String,Object>> result = new ArrayList<>();
for(Map<String,Object> m : persistent) {
Resource r = (Resource)m.get("Resource");
List<Resource> persistent = persistentCachedSearchResources(monitor, processor, search, maxResultCount);
List<Resource> cached = cache.doSearchResources(monitor, processor, search, maxResultCount);
- ArrayList<Resource> result = new ArrayList<Resource>();
+ ArrayList<Resource> result = new ArrayList<>();
for(Resource r : persistent) {
if(!cache.changed.contains(r.getResourceId())) {
result.add(r);
if(!os.isEmpty()) {
- ArrayList<Object> replaceKeys = new ArrayList<Object>();
- ArrayList<Object[]> replaceValues = new ArrayList<Object[]>();
- ArrayList<Object> removeKeys = new ArrayList<Object>();
+ ArrayList<Object> replaceKeys = new ArrayList<>();
+ ArrayList<Object[]> replaceValues = new ArrayList<>();
+ ArrayList<Object> removeKeys = new ArrayList<>();
for(Object[] o : os) {
Long parent = (Long)o[0];
Long key = (Long)o[1];