mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-02 17:35:18 +00:00
Cleaned up a handful of uglinesses in moving AVM configuration into
Alfresco app configuration, mostly related to getting testing to work smoothly. Also reworked OrphanReaper to be better behaved and nominally more efficient. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3419 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
parent
6692c7a979
commit
4ab5a046c2
@ -1,30 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
|
||||
<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
|
||||
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.internal.ui.antsupport.InternalAntRunner"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="incremental,auto,"/>
|
||||
<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:Repository}"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
|
||||
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="true"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE" value="${working_set:<?xml version="1.0" encoding="UTF-8"?> <launchConfigurationWorkingSet editPageId="org.eclipse.ui.resourceWorkingSetPage" factoryID="org.eclipse.ui.internal.WorkingSetFactory" name="workingSet"> <item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/Repository" type="4"/> </launchConfigurationWorkingSet>}"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_TYPE_ID" value="org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType"/>
|
||||
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_MANUAL_TARGETS" value="compile-jibx,"/>
|
||||
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AUTO_TARGETS" value="compile-jibx,"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_NAME" value="jdk1.5.0_06"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.5.0_02" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry id="org.eclipse.ant.ui.classpathentry.antHome"> <memento default="true"/> </runtimeClasspathEntry> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry id="org.eclipse.ant.ui.classpathentry.extraClasspathEntries"> <memento/> </runtimeClasspathEntry> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/3rd Party/lib/jibx/jibx-run.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/3rd Party/lib/jibx/jibx-bind.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/3rd Party/lib/bcel.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/3rd Party/lib/xpp3.jar" path="3" type="2"/> "/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/Repository/project-build.xml}"/>
|
||||
</launchConfiguration>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
|
||||
<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
|
||||
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.internal.ui.antsupport.InternalAntRunner"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="incremental,auto,"/>
|
||||
<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.launching.macosx.MacOSXType/JVM 1.5"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:Repository}"/>
|
||||
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
|
||||
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="true"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE" value="${working_set:<?xml version="1.0" encoding="UTF-8"?> <launchConfigurationWorkingSet editPageId="org.eclipse.ui.resourceWorkingSetPage" factoryID="org.eclipse.ui.internal.WorkingSetFactory" label="workingSet" name="workingSet"> <item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/Repository" type="4"/> </launchConfigurationWorkingSet>}"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_TYPE_ID" value="org.eclipse.jdt.internal.launching.macosx.MacOSXType"/>
|
||||
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_MANUAL_TARGETS" value="compile-jibx,"/>
|
||||
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AUTO_TARGETS" value="compile-jibx,"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_NAME" value="JVM 1.5"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.5.0_02" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry id="org.eclipse.ant.ui.classpathentry.antHome"> <memento default="true"/> </runtimeClasspathEntry> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/3rd Party/lib/xpp3-1.1.3_8.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry id="org.eclipse.ant.ui.classpathentry.extraClasspathEntries"> <memento/> </runtimeClasspathEntry> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/3rd Party/lib/jibx/jibx-run.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/3rd Party/lib/jibx/jibx-bind.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/3rd Party/lib/bcel.jar" path="3" type="2"/> "/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/Repository/project-build.xml"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/Repository/project-build.xml}"/>
|
||||
</launchConfiguration>
|
||||
|
@ -253,7 +253,7 @@
|
||||
</bean>
|
||||
|
||||
<bean id="orphanReaper" class="org.alfresco.repo.avm.OrphanReaper"
|
||||
init-method="init" destroy-method="shutDown" depends-on="avmService">
|
||||
init-method="init" destroy-method="shutDown" depends-on="AVMService">
|
||||
<property name="inactiveBaseSleep">
|
||||
<value>4000</value>
|
||||
</property>
|
||||
@ -268,7 +268,7 @@
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="avmService" class="org.alfresco.repo.avm.AVMServiceImpl"
|
||||
<bean id="AVMService" class="org.alfresco.repo.avm.AVMServiceImpl"
|
||||
init-method="init">
|
||||
<property name="storage">
|
||||
<value>${avm.storage}</value>
|
||||
|
@ -193,7 +193,7 @@
|
||||
<bean id="orphanReaper" class="org.alfresco.repo.avm.OrphanReaper"
|
||||
init-method="init" destroy-method="shutDown" depends-on="AVMService">
|
||||
<property name="inactiveBaseSleep">
|
||||
<value>4000</value>
|
||||
<value>60000</value>
|
||||
</property>
|
||||
<property name="activeBaseSleep">
|
||||
<value>1000</value>
|
||||
@ -201,6 +201,9 @@
|
||||
<property name="batchSize">
|
||||
<value>50</value>
|
||||
</property>
|
||||
<property name="maxQueueLength">
|
||||
<value>1000</value>
|
||||
</property>
|
||||
<property name="retryingTransaction">
|
||||
<ref bean="retryingTransaction"/>
|
||||
</property>
|
||||
|
@ -12,7 +12,7 @@ hibernate.connection.isolation=4
|
||||
hibernate.default_batch_fetch_size=16
|
||||
hibernate.jdbc.batch_versioned_data=true
|
||||
hibernate.cache.use_second_level_cache=true
|
||||
hibernate.hbm2ddl.auto=create
|
||||
hibernate.hbm2ddl.auto=update
|
||||
# AVM specific properties.
|
||||
avm.storage=build/test-results/storage
|
||||
avm.initialize=true
|
||||
|
@ -39,7 +39,6 @@ public class AVMCrawlTest extends AVMServiceTestBase
|
||||
int m = 4; // How many multiples of content to start with.
|
||||
long runTime = 1200000; // Ten minutes
|
||||
fService.purgeAVMStore("main");
|
||||
fReaper.setInactiveBaseSleep(60000);
|
||||
BulkLoader loader = new BulkLoader();
|
||||
loader.setAvmService(fService);
|
||||
for (int i = 0; i < m; i++)
|
||||
|
@ -55,8 +55,10 @@ public class AVMServiceTestBase extends TestCase
|
||||
*/
|
||||
private long fStartTime;
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see junit.framework.TestCase#setUp()
|
||||
/**
|
||||
* Setup for AVM tests. Note that we set the polling
|
||||
* interval for the reaper to 4 seconds so that tests will
|
||||
* finish reasonably quickly.
|
||||
*/
|
||||
@Override
|
||||
protected void setUp() throws Exception
|
||||
@ -67,8 +69,9 @@ public class AVMServiceTestBase extends TestCase
|
||||
fStartTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see junit.framework.TestCase#tearDown()
|
||||
/**
|
||||
* Cleanup after a test. Purge all stores. Move alf_data
|
||||
* directory aside.
|
||||
*/
|
||||
@Override
|
||||
protected void tearDown() throws Exception
|
||||
|
@ -35,7 +35,6 @@ public class AVMStressTest extends AVMServiceTestBase
|
||||
{
|
||||
try
|
||||
{
|
||||
fReaper.setInactiveBaseSleep(30000);
|
||||
int nCopies = 4;
|
||||
int nThreads = 8;
|
||||
BulkLoader loader = new BulkLoader();
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
package org.alfresco.repo.avm;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
@ -66,6 +67,16 @@ class OrphanReaper implements Runnable
|
||||
*/
|
||||
private Thread fThread;
|
||||
|
||||
/**
|
||||
* The maximum length of the queue.
|
||||
*/
|
||||
private int fQueueLength;
|
||||
|
||||
/**
|
||||
* The linked list containing ids of nodes that are purgable.
|
||||
*/
|
||||
private LinkedList<Long> fPurgeQueue;
|
||||
|
||||
/**
|
||||
* Create one with default parameters.
|
||||
*/
|
||||
@ -74,6 +85,7 @@ class OrphanReaper implements Runnable
|
||||
fInactiveBaseSleep = 30000;
|
||||
fActiveBaseSleep = 1000;
|
||||
fBatchSize = 50;
|
||||
fQueueLength = 1000;
|
||||
fActive = false;
|
||||
fDone = false;
|
||||
}
|
||||
@ -116,6 +128,15 @@ class OrphanReaper implements Runnable
|
||||
fTransaction = transaction;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the maximum size of the queue of purgeable nodes.
|
||||
* @param queueLength The max length.
|
||||
*/
|
||||
public void setMaxQueueLength(int queueLength)
|
||||
{
|
||||
fQueueLength = queueLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start things up after configuration is complete.
|
||||
*/
|
||||
@ -131,7 +152,11 @@ class OrphanReaper implements Runnable
|
||||
*/
|
||||
void shutDown()
|
||||
{
|
||||
fDone = true;
|
||||
synchronized (this)
|
||||
{
|
||||
fDone = true;
|
||||
notify();
|
||||
}
|
||||
try
|
||||
{
|
||||
fThread.join();
|
||||
@ -150,15 +175,18 @@ class OrphanReaper implements Runnable
|
||||
{
|
||||
while (!fDone)
|
||||
{
|
||||
try
|
||||
synchronized (this)
|
||||
{
|
||||
Thread.sleep(fActive ? fActiveBaseSleep : fInactiveBaseSleep);
|
||||
try
|
||||
{
|
||||
wait(fActive? fActiveBaseSleep : fInactiveBaseSleep);
|
||||
}
|
||||
catch (InterruptedException ie)
|
||||
{
|
||||
// Do nothing.
|
||||
}
|
||||
doBatch();
|
||||
}
|
||||
catch (InterruptedException ie)
|
||||
{
|
||||
// Do nothing.
|
||||
}
|
||||
doBatch();
|
||||
}
|
||||
}
|
||||
|
||||
@ -189,15 +217,29 @@ class OrphanReaper implements Runnable
|
||||
{
|
||||
public void perform()
|
||||
{
|
||||
List<AVMNode> nodes = AVMContext.fgInstance.fAVMNodeDAO.getOrphans(fBatchSize);
|
||||
if (nodes.size() == 0)
|
||||
if (fPurgeQueue == null)
|
||||
{
|
||||
fActive = false;
|
||||
return;
|
||||
List<AVMNode> nodes = AVMContext.fgInstance.fAVMNodeDAO.getOrphans(fQueueLength);
|
||||
if (nodes.size() == 0)
|
||||
{
|
||||
fActive = false;
|
||||
return;
|
||||
}
|
||||
fPurgeQueue = new LinkedList<Long>();
|
||||
for (AVMNode node : nodes)
|
||||
{
|
||||
fPurgeQueue.add(node.getId());
|
||||
}
|
||||
}
|
||||
fActive = true;
|
||||
for (AVMNode node : nodes)
|
||||
for (int i = 0; i < fBatchSize; i++)
|
||||
{
|
||||
if (fPurgeQueue.size() == 0)
|
||||
{
|
||||
fPurgeQueue = null;
|
||||
return;
|
||||
}
|
||||
AVMNode node = AVMContext.fgInstance.fAVMNodeDAO.getByID(fPurgeQueue.removeFirst());
|
||||
// Save away the ancestor and merged from fields from this node.
|
||||
HistoryLink hlink = AVMContext.fgInstance.fHistoryLinkDAO.getByDescendent(node);
|
||||
AVMNode ancestor = null;
|
||||
|
@ -49,6 +49,7 @@ class PlainFileNodeImpl extends FileNodeImpl implements PlainFileNode
|
||||
{
|
||||
super(store.getAVMRepository().issueID(), store);
|
||||
fContent = new FileContentImpl(AVMRepository.GetInstance().issueContentID());
|
||||
// AVMContext.fgInstance.fAVMNodeDAO.flush();
|
||||
AVMContext.fgInstance.fAVMNodeDAO.save(this);
|
||||
AVMContext.fgInstance.fAVMNodeDAO.flush();
|
||||
AVMContext.fgInstance.fNewInAVMStoreDAO.save(new NewInAVMStoreImpl(store, this));
|
||||
|
@ -91,7 +91,7 @@
|
||||
</class>
|
||||
<!-- Contents are objects to hang actual bytestreams off. They are explicitly reference
|
||||
counted. -->
|
||||
<class table="contents" name="FileContentImpl" proxy="FileContent"
|
||||
<class table="avm_contents" name="FileContentImpl" proxy="FileContent"
|
||||
optimistic-lock="version">
|
||||
<cache usage="read-write" />
|
||||
<id name="id" column="id" type="long"/>
|
||||
@ -119,7 +119,7 @@
|
||||
column="current_root_id" unique="true" cascade="save-update">
|
||||
</many-to-one>
|
||||
</class>
|
||||
<class name="VersionRootImpl" proxy="VersionRoot" table="version_roots">
|
||||
<class name="VersionRootImpl" proxy="VersionRoot" table="avm_version_roots">
|
||||
<!-- <cache usage="read-write"/> -->
|
||||
<id column="id" type="long">
|
||||
<generator class="native"></generator>
|
||||
@ -139,7 +139,7 @@
|
||||
column="root_id" not-null="true">
|
||||
</many-to-one>
|
||||
</class>
|
||||
<class name="ChildEntryImpl" proxy="ChildEntry" table="child_entries" optimistic-lock="version">
|
||||
<class name="ChildEntryImpl" proxy="ChildEntry" table="avm_child_entries" optimistic-lock="version">
|
||||
<cache usage="read-write"/>
|
||||
<composite-id>
|
||||
<key-property name="name" type="string" column="name">
|
||||
@ -152,7 +152,7 @@
|
||||
not-null="true">
|
||||
</many-to-one>
|
||||
</class>
|
||||
<class table="deleted_children" name="DeletedChildImpl" proxy="DeletedChild">
|
||||
<class table="avm_deleted_children" name="DeletedChildImpl" proxy="DeletedChild">
|
||||
<cache usage="read-write"/>
|
||||
<composite-id>
|
||||
<key-property name="name" column="name" type="string"/>
|
||||
@ -160,13 +160,13 @@
|
||||
column="parent_id"/>
|
||||
</composite-id>
|
||||
</class>
|
||||
<class name="HistoryLinkImpl" proxy="HistoryLink" table="history_links">
|
||||
<class name="HistoryLinkImpl" proxy="HistoryLink" table="avm_history_links">
|
||||
<composite-id>
|
||||
<key-many-to-one name="ancestor" class="AVMNodeImpl" column="ancestor"/>
|
||||
<key-many-to-one name="descendent" class="AVMNodeImpl" column="descendent"/>
|
||||
</composite-id>
|
||||
</class>
|
||||
<class name="MergeLinkImpl" proxy="MergeLink" table="merge_links">
|
||||
<class name="MergeLinkImpl" proxy="MergeLink" table="avm_merge_links">
|
||||
<composite-id>
|
||||
<key-many-to-one name="mfrom" class="AVMNodeImpl" column="mfrom"/>
|
||||
<key-many-to-one name="mto" class="AVMNodeImpl" column="mto"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user