mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
Search-77, seperating configuration of thread pools to 3 key trackers
This commit is contained in:
+33
@@ -75,6 +75,39 @@ public class DefaultTrackerPoolFactory implements TrackerPoolFactory
|
||||
threadPriority = Integer.parseInt(p.getProperty("alfresco.threadPriority", "5"));
|
||||
threadDaemon = Boolean.parseBoolean(p.getProperty("alfresco.threadDaemon", "true"));
|
||||
workQueueSize = Integer.parseInt(p.getProperty("alfresco.workQueueSize", "-1"));
|
||||
if(trackerName != null && !trackerName.isEmpty())
|
||||
{
|
||||
switch (trackerName)
|
||||
{
|
||||
case "AclTracker":
|
||||
corePoolSize = Integer.parseInt(p.getProperty("alfresco.acl.tracker.corePoolSize", "4"));
|
||||
maximumPoolSize = Integer.parseInt(p.getProperty("alfresco.acl.tracker.maximumPoolSize", "10"));
|
||||
keepAliveTime = Integer.parseInt(p.getProperty("alfresco.acl.tracker.keepAliveTime", "120"));
|
||||
threadPriority = Integer.parseInt(p.getProperty("alfresco.acl.tracker.threadPriority", "6"));
|
||||
threadDaemon = Boolean.parseBoolean(p.getProperty("alfresco.acl.tracker.threadDaemon", "true"));
|
||||
workQueueSize = Integer.parseInt(p.getProperty("alfresco.acl.tracker.workQueueSize", "-1"));
|
||||
break;
|
||||
case "ContentTracker":
|
||||
corePoolSize = Integer.parseInt(p.getProperty("alfresco.content.tracker.corePoolSize", "12"));
|
||||
maximumPoolSize = Integer.parseInt(p.getProperty("alfresco.content.tracker.maximumPoolSize", "-1"));
|
||||
keepAliveTime = Integer.parseInt(p.getProperty("alfresco.content.tracker.keepAliveTime", "120"));
|
||||
threadPriority = Integer.parseInt(p.getProperty("alfresco.content.tracker.threadPriority", "4"));
|
||||
threadDaemon = Boolean.parseBoolean(p.getProperty("alfresco.content.tracker.threadDaemon", "true"));
|
||||
workQueueSize = Integer.parseInt(p.getProperty("alfresco.content.tracker.workQueueSize", "-1"));
|
||||
break;
|
||||
case "MetadataTracker":
|
||||
corePoolSize = Integer.parseInt(p.getProperty("alfresco.metadata.tracker.corePoolSize", "5"));
|
||||
maximumPoolSize = Integer.parseInt(p.getProperty("alfresco.metadata.tracker.maximumPoolSize", "-1"));
|
||||
keepAliveTime = Integer.parseInt(p.getProperty("alfresco.metadata.tracker.keepAliveTime", "120"));
|
||||
threadPriority = Integer.parseInt(p.getProperty("alfresco.metadata.tracker.threadPriority", "5"));
|
||||
threadDaemon = Boolean.parseBoolean(p.getProperty("alfresco.metadata.tracker.threadDaemon", "true"));
|
||||
workQueueSize = Integer.parseInt(p.getProperty("alfresco.metadata.tracker.workQueueSize", "-1"));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
poolName = "SolrTrackingPool-" + coreName + "-" + trackerName + "-";
|
||||
|
||||
|
||||
+25
-2
@@ -50,18 +50,41 @@ alfresco.encryption.ssl.truststore.provider=
|
||||
alfresco.encryption.ssl.truststore.location=ssl.repo.client.truststore
|
||||
alfresco.encryption.ssl.truststore.passwordFileLocation=ssl-truststore-passwords.properties
|
||||
|
||||
# Tracking
|
||||
# Default Tracker
|
||||
alfresco.corePoolSize=8
|
||||
alfresco.maximumPoolSize=-1
|
||||
alfresco.keepAliveTime=120
|
||||
alfresco.threadPriority=5
|
||||
alfresco.threadDaemon=true
|
||||
alfresco.workQueueSize=-1
|
||||
#Track configuration
|
||||
#ACL tracker configuration
|
||||
alfresco.acl.tracker.cron=0/15 * * * * ? *
|
||||
alfresco.acl.tracker.corePoolSize=4
|
||||
alfresco.acl.tracker.maximumPoolSize=10
|
||||
alfresco.acl.tracker.keepAliveTime=120
|
||||
alfresco.acl.tracker.threadPriority=6
|
||||
alfresco.acl.tracker.threadDaemon=true
|
||||
alfresco.acl.tracker.workQueueSize=-1
|
||||
#Content tracker config
|
||||
alfresco.content.tracker.cron=0/15 * * * * ? *
|
||||
alfresco.content.tracker.corePoolSize=12
|
||||
alfresco.content.tracker.maximumPoolSize=-1
|
||||
alfresco.content.tracker.keepAliveTime=120
|
||||
alfresco.content.tracker.threadPriority=4
|
||||
alfresco.content.tracker.threadDaemon=true
|
||||
alfresco.content.tracker.workQueueSize=-1
|
||||
#Metadata tracker config
|
||||
alfresco.metadata.tracker.cron=0/15 * * * * ? *
|
||||
alfresco.metadata.tracker.corePoolSize=5
|
||||
alfresco.metadata.tracker.maximumPoolSize=-1
|
||||
alfresco.metadata.tracker.keepAliveTime=120
|
||||
alfresco.metadata.tracker.threadPriority=5
|
||||
alfresco.metadata.tracker.threadDaemon=true
|
||||
alfresco.metadata.tracker.workQueueSize=-1
|
||||
#Cascade tracker config
|
||||
alfresco.cascade.tracker.cron=0/15 * * * * ? *
|
||||
|
||||
|
||||
alfresco.commit.tracker.cron=0/15 * * * * ? *
|
||||
alfresco.model.tracker.cron=0/15 * * * * ? *
|
||||
alfresco.commitInterval=2000
|
||||
|
||||
+9
-1
@@ -38,7 +38,15 @@ import org.alfresco.repo.search.adaptor.lucene.QueryConstants;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.solr.AbstractAlfrescoSolrTests;
|
||||
import org.alfresco.solr.client.*;
|
||||
import org.alfresco.solr.client.Acl;
|
||||
import org.alfresco.solr.client.AclChangeSet;
|
||||
import org.alfresco.solr.client.AclReaders;
|
||||
import org.alfresco.solr.client.ContentPropertyValue;
|
||||
import org.alfresco.solr.client.Node;
|
||||
import org.alfresco.solr.client.NodeMetaData;
|
||||
import org.alfresco.solr.client.SOLRAPIQueueClient;
|
||||
import org.alfresco.solr.client.StringPropertyValue;
|
||||
import org.alfresco.solr.client.Transaction;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.lucene.index.Term;
|
||||
|
||||
+74
-1
@@ -42,7 +42,7 @@ public class DefaultTrackerPoolFactoryTest
|
||||
public void setup()
|
||||
{
|
||||
poolFactory = null; // Ensure we don't accidentally reuse between runs.
|
||||
properties = new Properties();
|
||||
properties = new Properties();
|
||||
}
|
||||
@After
|
||||
public void teardown()
|
||||
@@ -78,4 +78,77 @@ public class DefaultTrackerPoolFactoryTest
|
||||
assertEquals(40, tpe.getMaximumPoolSize());
|
||||
assertEquals(200, tpe.getKeepAliveTime(TimeUnit.SECONDS));
|
||||
}
|
||||
@Test
|
||||
public void testAclDefaultProperties()
|
||||
{
|
||||
poolFactory = new DefaultTrackerPoolFactory(properties, "TheCore", "AclTracker");
|
||||
|
||||
tpe = poolFactory.create();
|
||||
|
||||
assertEquals(4, tpe.getCorePoolSize());
|
||||
assertEquals(10, tpe.getMaximumPoolSize());
|
||||
assertEquals(120, tpe.getKeepAliveTime(TimeUnit.SECONDS));
|
||||
}
|
||||
@Test
|
||||
public void testAclProperties()
|
||||
{
|
||||
properties.put("alfresco.acl.tracker.corePoolSize", "30");
|
||||
properties.put("alfresco.acl.tracker.maximumPoolSize", "40");
|
||||
properties.put("alfresco.acl.tracker.keepAliveTime", "200");
|
||||
poolFactory = new DefaultTrackerPoolFactory(properties, "TheCore", "AclTracker");
|
||||
tpe = poolFactory.create();
|
||||
|
||||
assertEquals(30, tpe.getCorePoolSize());
|
||||
assertEquals(40, tpe.getMaximumPoolSize());
|
||||
assertEquals(200, tpe.getKeepAliveTime(TimeUnit.SECONDS));
|
||||
}
|
||||
@Test
|
||||
public void testContentDefaultProperties()
|
||||
{
|
||||
poolFactory = new DefaultTrackerPoolFactory(properties, "TheCore", "ContentTracker");
|
||||
|
||||
tpe = poolFactory.create();
|
||||
|
||||
assertEquals(12, tpe.getCorePoolSize());
|
||||
assertEquals(12, tpe.getMaximumPoolSize());
|
||||
assertEquals(120, tpe.getKeepAliveTime(TimeUnit.SECONDS));
|
||||
}
|
||||
@Test
|
||||
public void testContentProperties()
|
||||
{
|
||||
properties.put("alfresco.content.tracker.corePoolSize", "100");
|
||||
properties.put("alfresco.content.tracker.maximumPoolSize", "140");
|
||||
properties.put("alfresco.content.tracker.keepAliveTime", "201");
|
||||
poolFactory = new DefaultTrackerPoolFactory(properties, "TheCore", "ContentTracker");
|
||||
tpe = poolFactory.create();
|
||||
|
||||
assertEquals(100, tpe.getCorePoolSize());
|
||||
assertEquals(140, tpe.getMaximumPoolSize());
|
||||
assertEquals(201, tpe.getKeepAliveTime(TimeUnit.SECONDS));
|
||||
}
|
||||
@Test
|
||||
public void testMetaDataDefaultProperties()
|
||||
{
|
||||
poolFactory = new DefaultTrackerPoolFactory(properties, "TheCore", "MetadataTracker");
|
||||
|
||||
tpe = poolFactory.create();
|
||||
|
||||
assertEquals(5, tpe.getCorePoolSize());
|
||||
assertEquals(5, tpe.getMaximumPoolSize());
|
||||
assertEquals(120, tpe.getKeepAliveTime(TimeUnit.SECONDS));
|
||||
}
|
||||
@Test
|
||||
public void testMetaDataProperties()
|
||||
{
|
||||
properties.put("alfresco.metadata.tracker.corePoolSize", "100");
|
||||
properties.put("alfresco.metadata.tracker.maximumPoolSize", "140");
|
||||
properties.put("alfresco.metadata.tracker.keepAliveTime", "201");
|
||||
poolFactory = new DefaultTrackerPoolFactory(properties, "TheCore", "MetadataTracker");
|
||||
|
||||
tpe = poolFactory.create();
|
||||
|
||||
assertEquals(100, tpe.getCorePoolSize());
|
||||
assertEquals(140, tpe.getMaximumPoolSize());
|
||||
assertEquals(201, tpe.getKeepAliveTime(TimeUnit.SECONDS));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user