aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-12-19 17:08:38 +0000
committerOlivier Lamy <olamy@apache.org>2012-12-19 17:08:38 +0000
commit238ed6ac69f517514c42dfeb4b82ba9f0a2091a1 (patch)
treeddfbacb8dbfa45e3f0bcd25f3a134349e0b65ba3
parent5e85bbe6b8a87f47e8d6202f5326289bc246ad77 (diff)
downloadarchiva-238ed6ac69f517514c42dfeb4b82ba9f0a2091a1.tar.gz
archiva-238ed6ac69f517514c42dfeb4b82ba9f0a2091a1.zip
[MRM-1729] add MetadataRepository#hasMetadataFacet to prevent slow startup time
better fix it looks I missed something :-) git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1423957 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/DefaultRepositoryArchivaTaskScheduler.java17
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/test/tomcat/log4j2-test.xml2
2 files changed, 14 insertions, 5 deletions
diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/DefaultRepositoryArchivaTaskScheduler.java b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/DefaultRepositoryArchivaTaskScheduler.java
index 659ae5e39..0a7891f7d 100644
--- a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/DefaultRepositoryArchivaTaskScheduler.java
+++ b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/DefaultRepositoryArchivaTaskScheduler.java
@@ -56,7 +56,7 @@ import java.util.Set;
/**
* Default implementation of a scheduling component for archiva.
*/
-@Service("archivaTaskScheduler#repository")
+@Service( "archivaTaskScheduler#repository" )
public class DefaultRepositoryArchivaTaskScheduler
implements RepositoryArchivaTaskScheduler, ConfigurationListener
{
@@ -75,7 +75,7 @@ public class DefaultRepositoryArchivaTaskScheduler
*
*/
@Inject
- @Named(value = "taskQueue#repository-scanning")
+ @Named( value = "taskQueue#repository-scanning" )
private TaskQueue repositoryScanningQueue;
/**
@@ -88,7 +88,7 @@ public class DefaultRepositoryArchivaTaskScheduler
*
*/
@Inject
- @Named(value = "repositoryStatisticsManager#default")
+ @Named( value = "repositoryStatisticsManager#default" )
private RepositoryStatisticsManager repositoryStatisticsManager;
/**
@@ -181,7 +181,7 @@ public class DefaultRepositoryArchivaTaskScheduler
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings( "unchecked" )
public boolean isProcessingRepositoryTask( String repositoryId )
{
synchronized ( repositoryScanningQueue )
@@ -309,8 +309,15 @@ public class DefaultRepositoryArchivaTaskScheduler
MetadataRepository metadataRepository )
throws MetadataRepositoryException
{
+ long start = System.currentTimeMillis();
- return repositoryStatisticsManager.getLastStatistics( metadataRepository, repoConfig.getId() ) != null;
+ boolean res = repositoryStatisticsManager.hasStatistics( metadataRepository, repoConfig.getId() );
+
+ long end = System.currentTimeMillis();
+
+ log.debug( "isPreviouslyScanned repo {} {} time: {} ms", repoConfig.getId(), res, ( end - start ) );
+
+ return res;
}
// MRM-848: Pre-configured repository initially appear to be empty
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/test/tomcat/log4j2-test.xml b/archiva-modules/archiva-web/archiva-webapp-js/src/test/tomcat/log4j2-test.xml
index ee5a09b0a..5537a174f 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/test/tomcat/log4j2-test.xml
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/test/tomcat/log4j2-test.xml
@@ -81,6 +81,8 @@
<logger name="org.apache.archiva.metadata.repository.stats.DefaultRepositoryStatisticsManager" level="debug" />
+ <logger name="org.apache.archiva.scheduler.repository.DefaultRepositoryArchivaTaskScheduler" level="debug"/>
+
<root level="info">
<appender-ref ref="console"/>
</root>