continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r587129 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/store/ continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/ continuum-store/src/main/java/org/apache/ma...
Date Mon, 22 Oct 2007 15:26:53 GMT
Author: evenisse
Date: Mon Oct 22 08:26:52 2007
New Revision: 587129

URL: http://svn.apache.org/viewvc?rev=587129&view=rev
Log:
Use a range to limit the size of build results because we need only the latest two to check
if the state change.

Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
    maven/continuum/trunk/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java
    maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java?rev=587129&r1=587128&r2=587129&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
(original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
Mon Oct 22 08:26:52 2007
@@ -313,6 +313,9 @@
 
     List<BuildResult> getBuildResultsByBuildDefinition( int projectId, int buildDefinitionId
);
 
+    List<BuildResult> getBuildResultsByBuildDefinition( int projectId, int buildDefinitionId,
long startIndex,
+                                                        long endIndex );
+
     Map getBuildResultsInSuccess();
 
     Map getBuildResultsInSuccessByProjectGroupId( int projectGroupId );

Modified: maven/continuum/trunk/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java?rev=587129&r1=587128&r2=587129&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java
(original)
+++ maven/continuum/trunk/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java
Mon Oct 22 08:26:52 2007
@@ -190,7 +190,7 @@
         {
             if ( buildDef != null )
             {
-                builds = store.getBuildResultsByBuildDefinition( project.getId(), buildDef.getId()
);
+                builds = store.getBuildResultsByBuildDefinition( project.getId(), buildDef.getId(),
0, 2 );
 
                 if ( builds.size() < 2 )
                 {

Modified: maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java?rev=587129&r1=587128&r2=587129&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
(original)
+++ maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
Mon Oct 22 08:26:52 2007
@@ -1530,6 +1530,12 @@
 
     public List<BuildResult> getBuildResultsByBuildDefinition( int projectId, int buildDefinitionId
)
     {
+        return getBuildResultsByBuildDefinition( projectId, buildDefinitionId, -1, -1 );
+    }
+
+    public List<BuildResult> getBuildResultsByBuildDefinition( int projectId, int buildDefinitionId,
long startIndex,
+                                                               long endIndex )
+    {
         PersistenceManager pm = getPersistenceManager();
 
         Transaction tx = pm.currentTransaction();
@@ -1541,6 +1547,11 @@
             Extent extent = pm.getExtent( BuildResult.class, true );
 
             Query query = pm.newQuery( extent );
+
+            if ( startIndex >= 0 && endIndex >= 0 )
+            {
+                query.setRange( startIndex, endIndex );
+            }
 
             query.declareParameters( "int projectId, int buildDefinitionId" );
 



Mime
View raw message