From 1c5eb6d44c34f4636f43679f795ba8cf71b3d494 Mon Sep 17 00:00:00 2001 From: Andrew Hind Date: Mon, 13 Oct 2014 20:52:27 +0000 Subject: [PATCH] Fixes for ACE-3077 BM-0013: SOLR GC performance Fixed content tracker to limit concurrent commits. Fixed delete to use "id" - better then delete by query which requires NRT reload Fixed TX and Changeset in index detection 1) only check if it can be in the index based on timestamp 2) cache that should cover last hour recheck git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@87960 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../org/alfresco/repository/solr/solr.lib.ftl | 4 +++- .../repo/web/scripts/solr/NodesGet.java | 22 ++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/solr/solr.lib.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/solr/solr.lib.ftl index 617575e9fb..f4b3063f7c 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/repository/solr/solr.lib.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/repository/solr/solr.lib.ftl @@ -51,7 +51,9 @@ "id": ${node.id?c}, "nodeRef": "${node.nodeRef}", "txnId": ${node.txnId?c}, - "status": "<#if node.deleted>d<#else>u" + "status": "<#if node.deleted>d<#else>u", + "aclId": ${node.aclId?c}, + "tenant": "${node.tenant}" } diff --git a/source/java/org/alfresco/repo/web/scripts/solr/NodesGet.java b/source/java/org/alfresco/repo/web/scripts/solr/NodesGet.java index 4ae04be500..af3f5872ea 100644 --- a/source/java/org/alfresco/repo/web/scripts/solr/NodesGet.java +++ b/source/java/org/alfresco/repo/web/scripts/solr/NodesGet.java @@ -217,13 +217,17 @@ public class NodesGet extends DeclarativeWebScript private final Long txnId; private final boolean isDeleted; private final String nodeRef; + private final String tenant; + private final Long aclId; - public NodeRecord(Node node, QNameDAO qnameDAO) + public NodeRecord(Node node, QNameDAO qnameDAO, TenantService tenantService) { this.id = node.getId(); this.txnId = node.getTransaction().getId(); this.isDeleted = node.getNodeStatus(qnameDAO).isDeleted(); this.nodeRef = node.getNodeRef().toString(); + this.tenant = tenantService.getDomain(node.getNodeRef().getStoreRef().getIdentifier()); + this.aclId = node.getAclId(); } public Long getId() @@ -245,6 +249,18 @@ public class NodesGet extends DeclarativeWebScript { return nodeRef; } + + public String getTenant() + { + return tenant; + } + + public Long getAclId() + { + return aclId; + } + + } /** @@ -281,12 +297,12 @@ public class NodesGet extends DeclarativeWebScript StoreRef baseStoreRef = new StoreRef(tenantStoreRef.getProtocol(), tenantService.getBaseName(tenantStoreRef.getIdentifier(), true)); if (storeRef.equals(baseStoreRef)) { - nodes.add(new NodeRecord(node, qnameDAO)); + nodes.add(new NodeRecord(node, qnameDAO, tenantService)); } } else { - nodes.add(new NodeRecord(node, qnameDAO)); + nodes.add(new NodeRecord(node, qnameDAO, tenantService)); } // continue - get next node