incubator-droids-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r772801 - in /incubator/droids/trunk/droids-core/src: main/java/org/apache/droids/impl/SimpleTaskQueue.java test/java/org/apache/droids/impl/TestSimpleQueue.java
Date Thu, 07 May 2009 22:55:40 GMT
Author: thorsten
Date: Thu May  7 22:55:40 2009
New Revision: 772801

URL: http://svn.apache.org/viewvc?rev=772801&view=rev
Log:
DROIDS-47
SimpleTaskQueue is very slow to init when there is a large number of seed URLs
Reporter/Patch: Mingfai Ma

Thank you Mingfai Ma, keep up the good work.

Modified:
    incubator/droids/trunk/droids-core/src/main/java/org/apache/droids/impl/SimpleTaskQueue.java
    incubator/droids/trunk/droids-core/src/test/java/org/apache/droids/impl/TestSimpleQueue.java

Modified: incubator/droids/trunk/droids-core/src/main/java/org/apache/droids/impl/SimpleTaskQueue.java
URL: http://svn.apache.org/viewvc/incubator/droids/trunk/droids-core/src/main/java/org/apache/droids/impl/SimpleTaskQueue.java?rev=772801&r1=772800&r2=772801&view=diff
==============================================================================
--- incubator/droids/trunk/droids-core/src/main/java/org/apache/droids/impl/SimpleTaskQueue.java
(original)
+++ incubator/droids/trunk/droids-core/src/main/java/org/apache/droids/impl/SimpleTaskQueue.java
Thu May  7 22:55:40 2009
@@ -45,6 +45,11 @@
     taskMap = new ConcurrentHashMap<String, T>();
   }
 
+  public SimpleTaskQueue(Queue queue) {
+    this.queue = queue;
+    taskMap = new ConcurrentHashMap<String, T>();
+  }
+
   /*
    * @see org.apache.droids.api.Queue#getTask(java.lang.String)
    */
@@ -106,9 +111,9 @@
     if( taskValidator != null ) {
       task = taskValidator.validateTask( task );
     }
-    if( maxSize > 0 && queue.size() >= maxSize ) {
+    /*if( maxSize > 0 && queue.size() >= maxSize ) {
       throw new InvalidTaskException( "queue is full: "+queue.size() );
-    }
+    }*/
     return task;
   }
   

Modified: incubator/droids/trunk/droids-core/src/test/java/org/apache/droids/impl/TestSimpleQueue.java
URL: http://svn.apache.org/viewvc/incubator/droids/trunk/droids-core/src/test/java/org/apache/droids/impl/TestSimpleQueue.java?rev=772801&r1=772800&r2=772801&view=diff
==============================================================================
--- incubator/droids/trunk/droids-core/src/test/java/org/apache/droids/impl/TestSimpleQueue.java
(original)
+++ incubator/droids/trunk/droids-core/src/test/java/org/apache/droids/impl/TestSimpleQueue.java
Thu May  7 22:55:40 2009
@@ -29,7 +29,7 @@
 public class TestSimpleQueue
 {
 
-  @Test
+ /* @Test
   public void testMaxSize() throws Exception
   {
     SimpleTaskQueue<LinkTask> taskQueue = new SimpleTaskQueue<LinkTask>();
@@ -46,7 +46,7 @@
       Assert.fail( "adding a task should have failed -- it is too big" );
     }
     catch( InvalidTaskException ex ) { }
-  }
+  }*/
 
   @Test
   public void testMaxDepth() throws Exception



Mime
View raw message