camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r965601 - in /camel/trunk: components/camel-hawtdb/src/main/java/org/apache/camel/component/hawtdb/HawtDBFile.java parent/pom.xml
Date Mon, 19 Jul 2010 19:46:40 GMT
Author: chirino
Date: Mon Jul 19 19:46:39 2010
New Revision: 965601

URL: http://svn.apache.org/viewvc?rev=965601&view=rev
Log:
Fixes CAMEL-2964 : Upgrade to HawtDB 1.2

Modified:
    camel/trunk/components/camel-hawtdb/src/main/java/org/apache/camel/component/hawtdb/HawtDBFile.java
    camel/trunk/parent/pom.xml

Modified: camel/trunk/components/camel-hawtdb/src/main/java/org/apache/camel/component/hawtdb/HawtDBFile.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hawtdb/src/main/java/org/apache/camel/component/hawtdb/HawtDBFile.java?rev=965601&r1=965600&r2=965601&view=diff
==============================================================================
--- camel/trunk/components/camel-hawtdb/src/main/java/org/apache/camel/component/hawtdb/HawtDBFile.java
(original)
+++ camel/trunk/components/camel-hawtdb/src/main/java/org/apache/camel/component/hawtdb/HawtDBFile.java
Mon Jul 19 19:46:39 2010
@@ -74,15 +74,12 @@ public class HawtDBFile extends TxPageFi
 
         execute(new Work<Boolean>() {
             public Boolean execute(Transaction tx) {
-                int page = tx.allocator().alloc(1);
-                if (page == 0) {
+                if (!tx.allocator().isAllocated(0)) {
                     // if we just created the file, first allocated page should be 0
-                    ROOT_INDEXES_FACTORY.create(tx, 0);
+                    ROOT_INDEXES_FACTORY.create(tx);
                     LOG.info("Aggregation repository data store created using file: " + getFile());
                 } else {
-                    // Was previously created.. so free up the test page
-                    tx.allocator().free(page, 1);
-                    SortedIndex<String, Integer> indexes = ROOT_INDEXES_FACTORY.open(tx,
0);
+                    SortedIndex<String, Integer> indexes = ROOT_INDEXES_FACTORY.open(tx);
                     LOG.info("Aggregation repository data store loaded using file: " + getFile()
                             + " containing " + indexes.size() + " repositories.");
                 }
@@ -117,13 +114,13 @@ public class HawtDBFile extends TxPageFi
     public SortedIndex<Buffer, Buffer> getRepositoryIndex(Transaction tx, String name,
boolean create) {
         SortedIndex<Buffer, Buffer> answer = null;
 
-        SortedIndex<String, Integer> indexes = ROOT_INDEXES_FACTORY.open(tx, 0);
+        SortedIndex<String, Integer> indexes = ROOT_INDEXES_FACTORY.open(tx);
         Integer location = indexes.get(name);
 
         if (create && location == null) {
             // create it..
-            int page = tx.allocator().alloc(1);
-            SortedIndex<Buffer, Buffer> created = INDEX_FACTORY.create(tx, page);
+            SortedIndex<Buffer, Buffer> created = INDEX_FACTORY.create(tx);
+            int page = created.getIndexLocation();
 
             // add it to indexes so we can find it the next time
             indexes.put(name, page);

Modified: camel/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=965601&r1=965600&r2=965601&view=diff
==============================================================================
--- camel/trunk/parent/pom.xml (original)
+++ camel/trunk/parent/pom.xml Mon Jul 19 19:46:39 2010
@@ -69,7 +69,7 @@
     <guiceyfruit-version>2.0</guiceyfruit-version>
     <hamcrest-version>1.2-dev1</hamcrest-version>
     <hawtbuf-version>1.0</hawtbuf-version>
-    <hawtdb-version>1.1</hawtdb-version>
+    <hawtdb-version>1.2</hawtdb-version>
     <hibernate-version>3.2.6.ga</hibernate-version>
     <hibernate-entitymanager-version>3.2.1.ga</hibernate-entitymanager-version>
     <hsqldb-version>1.8.0.7</hsqldb-version>



Mime
View raw message