You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2010/07/07 06:18:33 UTC

svn commit: r961200 - in /activemq/sandbox/activemq-apollo-actor: activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/ activemq-hawtdb/target/generated-sources/proto/org/apache/activemq/broker/store/hawtdb/ activemq-stomp/src/main/sc...

Author: chirino
Date: Wed Jul  7 04:18:33 2010
New Revision: 961200

URL: http://svn.apache.org/viewvc?rev=961200&view=rev
Log:
cleaning up so that stuff compiles.

Added:
    activemq/sandbox/activemq-apollo-actor/activemq-web/src/test/scala/org/apache/activemq/apollo/web/FileConfigStoreTest.scala
      - copied, changed from r961199, activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/apache/activemq/apollo/web/FileConfigStoreTest.scala
Removed:
    activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/target/generated-sources/proto/org/apache/activemq/broker/store/hawtdb/HawtDBMemoryPool.scala
    activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/apache/activemq/apollo/web/FileConfigStoreTest.scala
Modified:
    activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/HawtDBClient.scala
    activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/HawtDBMemoryPoolSPI.scala
    activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/Helpers.scala
    activemq/sandbox/activemq-apollo-actor/activemq-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompWireFormat.scala
    activemq/sandbox/activemq-apollo-actor/activemq-web/pom.xml

Modified: activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/HawtDBClient.scala
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/HawtDBClient.scala?rev=961200&r1=961199&r2=961200&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/HawtDBClient.scala (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/HawtDBClient.scala Wed Jul  7 04:18:33 2010
@@ -67,7 +67,6 @@ class HawtDBClient(hawtDBStore: HawtDBSt
   def dispatchQueue = hawtDBStore.dispatchQueue
 
 
-  private val directFileFactory = new PageFileFactory()
   private val indexFileFactory = new TxPageFileFactory()
   private var journal: Journal = null
 
@@ -106,8 +105,6 @@ class HawtDBClient(hawtDBStore: HawtDBSt
 
   private def failIfDatabaseIsLocked = config.failIfLocked
 
-  private def directFile = directFileFactory.getPageFile
-
   private def indexFile = indexFileFactory.getTxPageFile()
 
 
@@ -177,11 +174,6 @@ class HawtDBClient(hawtDBStore: HawtDBSt
       }
       journal.start
 
-      directFileFactory.setFile(new File(directory, "direct"));
-      directFileFactory.setHeaderSize(0);
-      directFileFactory.setPageSize(1024)
-      directFileFactory.open
-
       indexFileFactory.setFile(new File(directory, "db"))
       indexFileFactory.setDrainOnClose(false)
       indexFileFactory.setSync(true)
@@ -204,7 +196,6 @@ class HawtDBClient(hawtDBStore: HawtDBSt
             rootBean.setDataFileRefIndexPage(alloc(DATA_FILE_REF_INDEX_FACTORY))
             rootBean.setMessageRefsIndexPage(alloc(MESSAGE_REFS_INDEX_FACTORY))
             rootBean.setSubscriptionIndexPage(alloc(SUBSCRIPTIONS_INDEX_FACTORY))
-            rootBean.setDirectIndexPage(alloc(DIRECT_INDEX_FACTORY))
             storedRootBuffer = rootBean.freeze
             helper.storeRootBean
 
@@ -222,20 +213,6 @@ class HawtDBClient(hawtDBStore: HawtDBSt
 
       recover(onComplete)
 
-      // update the allocated free list in the direct file
-      // by unfreeing the items contained in the direct index.
-      withTx { tx =>
-        val helper = new TxHelper(tx)
-        import JavaConversions._
-        import helper._
-
-        directIndex.iterator.foreach { entry =>
-          val record = entry.getValue
-          val page_count: Int = directFile.pages(record.getSize)
-          directFile.allocator.unfree(record.getPage, page_count)
-        }
-      }
-
       // Schedule periodic jobs.. they keep executing while schedule_version remains the same.
       scheduleCleanup(schedule_version.get())
       scheduleFlush(schedule_version.get())
@@ -249,8 +226,6 @@ class HawtDBClient(hawtDBStore: HawtDBSt
     lockFile.unlock
   }
 
-  val last_direct_key = new AtomicLong
-
   def addQueue(record: QueueRecord, callback:Runnable) = {
     val update = new AddQueue.Bean()
     update.setKey(record.key)
@@ -1057,7 +1032,6 @@ class HawtDBClient(hawtDBStore: HawtDBSt
     lazy val messageKeyIndex = MESSAGE_KEY_INDEX_FACTORY.open(_tx, rootBuffer.getMessageKeyIndexPage)
     lazy val messageRefsIndex = MESSAGE_REFS_INDEX_FACTORY.open(_tx, rootBuffer.getMessageRefsIndexPage)
     lazy val subscriptionIndex = SUBSCRIPTIONS_INDEX_FACTORY.open(_tx, rootBuffer.getSubscriptionIndexPage)
-    lazy val directIndex = DIRECT_INDEX_FACTORY.open(_tx, rootBuffer.getDirectIndexPage)
 
     def addAndGet[K](index:SortedIndex[K, jl.Integer], key:K, amount:Int):Int = {
       var counter = index.get(key)

Modified: activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/HawtDBMemoryPoolSPI.scala
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/HawtDBMemoryPoolSPI.scala?rev=961200&r1=961199&r2=961200&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/HawtDBMemoryPoolSPI.scala (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/HawtDBMemoryPoolSPI.scala Wed Jul  7 04:18:33 2010
@@ -37,7 +37,8 @@ class HawtDBMemoryPoolSPI extends StoreF
 
   def create(config: StoreDTO) = {
     if( config.isInstanceOf[HawtDBStoreDTO]) {
-      new HawtDBStore
+// TODO:      new HawtDBMemoryPool
+      null
     } else {
       null
     }

Modified: activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/Helpers.scala
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/Helpers.scala?rev=961200&r1=961199&r2=961200&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/Helpers.scala (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/Helpers.scala Wed Jul  7 04:18:33 2010
@@ -109,7 +109,6 @@ object Helpers {
     rc.protocol = pb.getProtocol
     rc.size = pb.getSize
     rc.value = pb.getValue
-    rc.directKey = pb.getStreamKey
     rc.expiration = pb.getExpiration
     rc
   }
@@ -120,7 +119,6 @@ object Helpers {
     pb.setProtocol(v.protocol)
     pb.setSize(v.size)
     pb.setValue(v.value)
-    pb.setStreamKey(v.directKey)
     pb.setExpiration(v.expiration)
     pb
   }
@@ -228,9 +226,4 @@ object Helpers {
   SUBSCRIPTIONS_INDEX_FACTORY.setValueCodec(AddSubscription.FRAMED_CODEC);
   SUBSCRIPTIONS_INDEX_FACTORY.setDeferredEncoding(true);
 
-  val DIRECT_INDEX_FACTORY = new BTreeIndexFactory[jl.Long, AddDirect.Buffer]();
-  DIRECT_INDEX_FACTORY.setKeyCodec(LongCodec.INSTANCE);
-  DIRECT_INDEX_FACTORY.setValueCodec(AddDirect.FRAMED_CODEC);
-  DIRECT_INDEX_FACTORY.setDeferredEncoding(true);
-
 }
\ No newline at end of file

Modified: activemq/sandbox/activemq-apollo-actor/activemq-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompWireFormat.scala
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompWireFormat.scala?rev=961200&r1=961199&r2=961200&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompWireFormat.scala (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompWireFormat.scala Wed Jul  7 04:18:33 2010
@@ -167,7 +167,7 @@ class StompWireFormat extends WireFormat
   def getWriteCounter = write_counter
 
 
-  def write(command: Any):BufferState =  {
+  def write(command: Any):WireFormat.BufferState =  {
     if ( is_full) {
       WireFormat.BufferState.FULL
     } else {
@@ -181,7 +181,7 @@ class StompWireFormat extends WireFormat
     }
   }
 
-  def flush():BufferState = {
+  def flush():WireFormat.BufferState = {
     
     // if we have a pending write that is being sent over the socket...
     if ( !is_empty ) {

Modified: activemq/sandbox/activemq-apollo-actor/activemq-web/pom.xml
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-web/pom.xml?rev=961200&r1=961199&r2=961200&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-web/pom.xml (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-web/pom.xml Wed Jul  7 04:18:33 2010
@@ -104,6 +104,32 @@
       <version>${scalate-version}</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.activemq</groupId>
+      <artifactId>activemq-util</artifactId>
+      <version>6.0-SNAPSHOT</version>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+      <version>${junit-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.scalatest</groupId>
+      <artifactId>scalatest</artifactId>
+      <version>${scalatest-version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <!--<scope>test</scope>-->
+      <version>${log4j-version}</version>
+    </dependency>
     
   </dependencies>
 

Copied: activemq/sandbox/activemq-apollo-actor/activemq-web/src/test/scala/org/apache/activemq/apollo/web/FileConfigStoreTest.scala (from r961199, activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/apache/activemq/apollo/web/FileConfigStoreTest.scala)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-web/src/test/scala/org/apache/activemq/apollo/web/FileConfigStoreTest.scala?p2=activemq/sandbox/activemq-apollo-actor/activemq-web/src/test/scala/org/apache/activemq/apollo/web/FileConfigStoreTest.scala&p1=activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/apache/activemq/apollo/web/FileConfigStoreTest.scala&r1=961199&r2=961200&rev=961200&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/apache/activemq/apollo/web/FileConfigStoreTest.scala (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-web/src/test/scala/org/apache/activemq/apollo/web/FileConfigStoreTest.scala Wed Jul  7 04:18:33 2010
@@ -16,11 +16,10 @@
  */
 package org.apache.activemq.apollo.web
 
-import org.apache.activemq.apollo.broker.LoggingTracker
 import java.io.File
 import java.util.concurrent.{TimeUnit, CountDownLatch}
 import org.fusesource.hawtdispatch.Future
-import org.fusesource.scalate.test.FunSuiteSupport
+import org.apache.activemq.apollo.broker.{FunSuiteSupport, LoggingTracker}
 
 /**
  * <p>