activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1294883 - /activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Sink.scala
Date Tue, 28 Feb 2012 22:56:50 GMT
Author: chirino
Date: Tue Feb 28 22:56:50 2012
New Revision: 1294883

URL: http://svn.apache.org/viewvc?rev=1294883&view=rev
Log:
Switch to a simple java linked list.

Modified:
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Sink.scala

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Sink.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Sink.scala?rev=1294883&r1=1294882&r2=1294883&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Sink.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Sink.scala
Tue Feb 28 22:56:50 2012
@@ -116,7 +116,7 @@ class OverflowSink[T](val downstream:Sin
 
   var refiller:Runnable = NOOP
 
-  var overflow = collection.mutable.Queue[T]()
+  val overflow = new LinkedList[T]()
 
   def overflowed = !overflow.isEmpty
 
@@ -128,10 +128,10 @@ class OverflowSink[T](val downstream:Sin
 
   protected def drain:Unit = {
     while( overflowed ) {
-      if( !downstream.offer(overflow.front) ) {
+      if( !downstream.offer(overflow.peekFirst()) ) {
         return
       } else {
-        onDelivered(overflow.dequeue)
+        onDelivered(overflow.removeFirst())
       }
     }
     // request a refill once the overflow is empty...
@@ -144,7 +144,7 @@ class OverflowSink[T](val downstream:Sin
    */
   def offer(value:T) = {
     if( overflowed || !downstream.offer(value)) {
-      overflow.enqueue(value)
+      overflow.addLast(value)
     } else {
       onDelivered(value)
     }



Mime
View raw message