mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
OpenCMIS server: significant query performance improvements
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29606 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -22,6 +22,7 @@ import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.alfresco.opencmis.dictionary.CMISDictionaryService;
|
||||
import org.alfresco.opencmis.dictionary.CMISPropertyAccessor;
|
||||
import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper;
|
||||
import org.alfresco.repo.audit.extractor.AbstractDataExtractor;
|
||||
import org.alfresco.service.cmr.model.FileInfo;
|
||||
@@ -61,7 +62,8 @@ public class CMISChangeLogDataExtractor extends AbstractDataExtractor
|
||||
HashMap<String, Serializable> result = new HashMap<String, Serializable>(5);
|
||||
result.put(KEY_NODE_REF, nodeRef);
|
||||
// Support version nodes by recording the object ID
|
||||
result.put(KEY_OBJECT_ID, type.getPropertyById(PropertyIds.OBJECT_ID).getPropertyAccessor().getValue(nodeRef));
|
||||
CMISPropertyAccessor accessor = type.getPropertyById(PropertyIds.OBJECT_ID).getPropertyAccessor();
|
||||
result.put(KEY_OBJECT_ID, accessor.getValue(accessor.createNodeInfo(nodeRef)));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@@ -107,12 +107,12 @@ public abstract class AbstractProperty implements CMISPropertyAccessor
|
||||
|
||||
protected abstract Serializable getValueInternal(CMISNodeInfo nodeInfo);
|
||||
|
||||
protected CMISNodeInfo createNodeInfo(NodeRef nodeRef)
|
||||
public CMISNodeInfo createNodeInfo(NodeRef nodeRef)
|
||||
{
|
||||
return connector.createNodeInfo(nodeRef);
|
||||
}
|
||||
|
||||
protected CMISNodeInfo createNodeInfo(AssociationRef assocRef)
|
||||
public CMISNodeInfo createNodeInfo(AssociationRef assocRef)
|
||||
{
|
||||
return connector.createNodeInfo(assocRef);
|
||||
}
|
||||
|
@@ -29,6 +29,7 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.opencmis.dictionary.CMISDictionaryService;
|
||||
import org.alfresco.opencmis.dictionary.CMISNodeInfo;
|
||||
import org.alfresco.repo.search.impl.querymodel.Query;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
@@ -49,6 +50,8 @@ public class CMISResultSet implements ResultSetSPI<CMISResultSetRow, CMISResultS
|
||||
|
||||
private Map<String, ResultSet> wrapped;
|
||||
|
||||
private Map<NodeRef, CMISNodeInfo> nodeInfos;
|
||||
|
||||
private LimitBy limitBy;
|
||||
|
||||
CMISQueryOptions options;
|
||||
@@ -72,6 +75,7 @@ public class CMISResultSet implements ResultSetSPI<CMISResultSetRow, CMISResultS
|
||||
this.query = query;
|
||||
this.cmisDictionaryService = cmisDictionaryService;
|
||||
this.alfrescoDictionaryService = alfrescoDictionaryService;
|
||||
this.nodeInfos = new HashMap<NodeRef, CMISNodeInfo>();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -111,7 +115,7 @@ public class CMISResultSet implements ResultSetSPI<CMISResultSetRow, CMISResultS
|
||||
*/
|
||||
public CMISResultSetRow getRow(int i)
|
||||
{
|
||||
return new CMISResultSetRow(this, i, getScores(i), nodeService, getNodeRefs(i), query, cmisDictionaryService);
|
||||
return new CMISResultSetRow(this, i, getScores(i), nodeService, getNodeRefs(i), nodeInfos, query, cmisDictionaryService);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -23,6 +23,7 @@ import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.opencmis.dictionary.CMISDictionaryService;
|
||||
import org.alfresco.opencmis.dictionary.CMISNodeInfo;
|
||||
import org.alfresco.repo.search.impl.querymodel.Column;
|
||||
import org.alfresco.repo.search.impl.querymodel.PropertyArgument;
|
||||
import org.alfresco.repo.search.impl.querymodel.Query;
|
||||
@@ -56,12 +57,15 @@ public class CMISResultSetRow implements ResultSetRow
|
||||
|
||||
private Map<String, NodeRef> nodeRefs;
|
||||
|
||||
private Map<NodeRef, CMISNodeInfo> nodeInfos;
|
||||
|
||||
private Query query;
|
||||
|
||||
private CMISDictionaryService cmisDictionaryService;
|
||||
|
||||
public CMISResultSetRow(CMISResultSet resultSet, int index, Map<String, Float> scores, NodeService nodeService,
|
||||
Map<String, NodeRef> nodeRefs, Query query, CMISDictionaryService cmisDictionaryService)
|
||||
Map<String, NodeRef> nodeRefs, Map<NodeRef, CMISNodeInfo> nodeInfos, Query query,
|
||||
CMISDictionaryService cmisDictionaryService)
|
||||
{
|
||||
this.resultSet = resultSet;
|
||||
this.index = index;
|
||||
@@ -70,6 +74,7 @@ public class CMISResultSetRow implements ResultSetRow
|
||||
this.nodeRefs = nodeRefs;
|
||||
this.query = query;
|
||||
this.cmisDictionaryService = cmisDictionaryService;
|
||||
this.nodeInfos = nodeInfos;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -158,6 +163,7 @@ public class CMISResultSetRow implements ResultSetRow
|
||||
CmisFunctionEvaluationContext context = new CmisFunctionEvaluationContext();
|
||||
context.setCmisDictionaryService(cmisDictionaryService);
|
||||
context.setNodeRefs(nodeRefs);
|
||||
context.setNodeInfos(nodeInfos);
|
||||
context.setNodeService(nodeService);
|
||||
context.setScores(scores);
|
||||
context.setScore(getScore());
|
||||
|
Reference in New Issue
Block a user