AVM DAO refactor - fix child entry name pattern match (+ missing test), also orphan reaper max limit

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16145 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2009-09-08 12:58:46 +00:00
parent efda84932f
commit efb73c6e4c
11 changed files with 1067 additions and 1010 deletions

View File

@@ -1,14 +1,33 @@
/*
* Copyright (C) 2005-2009 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.repo.avm;
import java.util.List;
import java.util.SortedMap;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
import org.alfresco.service.cmr.avmsync.AVMDifference;
import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.cmr.search.ResultSet;
import org.alfresco.service.cmr.search.SearchService;
import org.alfresco.util.GUID;
public class AVMChildNamePatternMatchPerformanceTest extends AVMServiceTestBase

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2008 Alfresco Software Limited.
* Copyright (C) 2005-2009 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -40,7 +40,7 @@ public class AVMTestSuite extends TestSuite
public static Test suite()
{
TestSuite suite = new TestSuite();
suite.addTestSuite(AVMNodeConverterTest.class);
suite.addTestSuite(AVMExpiredContentTest.class);
suite.addTestSuite(FileNameValidatorTest.class);
@@ -61,6 +61,7 @@ public class AVMTestSuite extends TestSuite
suite.addTestSuite(PurgeTestP.class);
suite.addTestSuite(SimultaneousLoadTest.class);
suite.addTestSuite(AVMDiffPerformanceTest.class);
suite.addTestSuite(AVMChildNamePatternMatchPerformanceTest.class);
return suite;
}

View File

@@ -244,8 +244,7 @@ class AVMNodeDAOIbatis extends HibernateDaoSupport implements AVMNodeDAO
*/
public List<AVMNode> getOrphans(int batchSize)
{
// TODO - limit to batch size
List<AVMNodeEntity> nodeEntities = AVMDAOs.Instance().newAVMNodeDAO.getNodeOrphans();
List<AVMNodeEntity> nodeEntities = AVMDAOs.Instance().newAVMNodeDAO.getNodeOrphans(batchSize);
if (nodeEntities == null)
{

View File

@@ -65,9 +65,7 @@ class ChildEntryDAOIbatis implements ChildEntryDAO
*/
public List<ChildEntry> getByParent(DirectoryNode parent, String childNamePattern)
{
// TODO - add option for childNamePattern
List<AVMChildEntryEntity> childEntryEntities = AVMDAOs.Instance().newAVMNodeLinksDAO.getChildEntriesByParent(parent.getId());
List<AVMChildEntryEntity> childEntryEntities = AVMDAOs.Instance().newAVMNodeLinksDAO.getChildEntriesByParent(parent.getId(), childNamePattern);
List<ChildEntry> result = new ArrayList<ChildEntry>(childEntryEntities.size());
for (AVMChildEntryEntity childEntryEntity : childEntryEntities)