You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2011/08/09 17:54:16 UTC

svn commit: r1155416 - in /incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/index/bplustree: BPTreeNode.java BPlusTree.java

Author: andy
Date: Tue Aug  9 15:54:15 2011
New Revision: 1155416

URL: http://svn.apache.org/viewvc?rev=1155416&view=rev
Log:
Address curent reads causing a warning.

Modified:
    incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/index/bplustree/BPTreeNode.java
    incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/index/bplustree/BPlusTree.java

Modified: incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/index/bplustree/BPTreeNode.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/index/bplustree/BPTreeNode.java?rev=1155416&r1=1155415&r2=1155416&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/index/bplustree/BPTreeNode.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/index/bplustree/BPTreeNode.java Tue Aug  9 15:54:15 2011
@@ -1137,7 +1137,8 @@ public final class BPTreeNode extends BP
     
     final boolean isRoot()
     {
-        if ( bpTree.root == this ) return true ;
+        // No BPT remembered root node currently 
+        //if ( bpTree.root == this ) return true ;
         return this.id == BPlusTreeParams.RootId ;
     }
 
@@ -1325,7 +1326,9 @@ public final class BPTreeNode extends BP
         if ( ! isLeaf && count+1 != ptrs.size() )
             error("Inconsistent: id=%d, count+1=%d, ptrs.size()=%d ; %s", id, count+1, ptrs.size(), this) ; 
     
-        if ( bpTree.root != null && !isRoot() && count < params.MinRec)
+        // No BPT remembered root node currently 
+        //if ( bpTree.root != null && !isRoot() && count < params.MinRec)
+        if ( !isRoot() && count < params.MinRec)
         {
             //warning("Runt node: %s", this) ;
             error("Runt node: %s", this) ;

Modified: incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/index/bplustree/BPlusTree.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/index/bplustree/BPlusTree.java?rev=1155416&r1=1155415&r2=1155416&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/index/bplustree/BPlusTree.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/index/bplustree/BPlusTree.java Tue Aug  9 15:54:15 2011
@@ -114,7 +114,7 @@ public class BPlusTree implements Iterab
     private static Logger log = LoggerFactory.getLogger(BPlusTree.class) ;
     
     private int rootIdx = BPlusTreeParams.RootId ;
-    /*package*/ BPTreeNode root ;
+    ///*package*/ BPTreeNode root ;
     private BPTreeNodeMgr nodeManager ; 
     private BPTreeRecordsMgr recordsMgr; 
     private BPlusTreeParams bpTreeParams ;
@@ -212,7 +212,7 @@ public class BPlusTree implements Iterab
                 root.release() ;
             }
             // Cache : not currently done - root is null
-            setRoot(root) ;
+            //setRoot(root) ;
             finishUpdateBlkMgr() ;
         }
     }
@@ -220,20 +220,23 @@ public class BPlusTree implements Iterab
     private BPTreeNode getRoot()
     {
         // No caching here.
-        root = nodeManager.getRoot(rootIdx) ;
+        BPTreeNode root = nodeManager.getRoot(rootIdx) ;
+        //this.root = root ;
         return root ;
     }
 
     private void releaseRoot(BPTreeNode rootNode)
     {
-        // [TxTDB:PATCH-UP]
-        if ( root != null ) 
-        {
-            root.release() ;
-            //nodeManager.release(rootNode) ;
-        }
-        if ( root != null && rootNode != root )
-            log.warn("Root is not root!") ;
+//        // [TxTDB:PATCH-UP]
+//        if ( root != null ) 
+//        {
+//            root.release() ;
+//            //nodeManager.release(rootNode) ;
+//        }
+//        if ( root != null && rootNode != root )
+//            log.warn("Root is not root!") ;
+        
+        rootNode.release() ;
     }
 
     private void setRoot(BPTreeNode node)