directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1536070 - in /directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree: managed/AbstractPage.java managed/Leaf.java memory/AbstractPage.java memory/Leaf.java
Date Sun, 27 Oct 2013 09:07:09 GMT
Author: elecharny
Date: Sun Oct 27 09:07:08 2013
New Revision: 1536070

URL: http://svn.apache.org/r1536070
Log:
Applied the KeyNotFoundException speedup in the InMemory BTree

Modified:
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/AbstractPage.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/Leaf.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/AbstractPage.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/Leaf.java

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/AbstractPage.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/AbstractPage.java?rev=1536070&r1=1536069&r2=1536070&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/AbstractPage.java
(original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/AbstractPage.java
Sun Oct 27 09:07:08 2013
@@ -23,6 +23,8 @@ package org.apache.directory.mavibot.btr
 import java.io.IOException;
 import java.lang.reflect.Array;
 
+import org.apache.directory.mavibot.btree.exception.KeyNotFoundException;
+
 
 /**
  * A MVCC abstract Page. It stores the field and the methods shared by the Node and Leaf
@@ -53,6 +55,10 @@ import java.lang.reflect.Array;
     /** The last {@link PageIO} storing the serialized Page on disk */
     private long lastOffset = -1L;
 
+    /** A static Exception used to avoid creating a new one every time */
+    protected KeyNotFoundException KEY_NOT_FOUND_EXCEPTION = new KeyNotFoundException(
+        "Cannot find an entry associated with this key" );
+
 
     /**
      * Creates a default empty AbstractPage

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/Leaf.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/Leaf.java?rev=1536070&r1=1536069&r2=1536070&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/Leaf.java
(original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/Leaf.java
Sun Oct 27 09:07:08 2013
@@ -45,10 +45,6 @@ import org.apache.directory.mavibot.btre
     /** Values associated with keys */
     protected ValueHolder<V>[] values;
 
-    /** A static Exception used to avoid creating a new one every time */
-    private KeyNotFoundException KEY_NOT_FOUND_EXCEPTION = new KeyNotFoundException(
-        "Cannot find an entry associated with this key" );
-
 
     /**
      * Constructor used to create a new Leaf when we read it from a file.

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/AbstractPage.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/AbstractPage.java?rev=1536070&r1=1536069&r2=1536070&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/AbstractPage.java
(original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/AbstractPage.java
Sun Oct 27 09:07:08 2013
@@ -23,6 +23,8 @@ package org.apache.directory.mavibot.btr
 import java.io.IOException;
 import java.lang.reflect.Array;
 
+import org.apache.directory.mavibot.btree.exception.KeyNotFoundException;
+
 
 /**
  * A MVCC abstract Page. It stores the field and the methods shared by the Node and Leaf
@@ -53,6 +55,10 @@ import java.lang.reflect.Array;
     /** The last {@link PageIO} storing the serialized Page on disk */
     private long lastOffset = -1L;
 
+    /** A static Exception used to avoid creating a new one every time */
+    protected KeyNotFoundException KEY_NOT_FOUND_EXCEPTION = new KeyNotFoundException(
+        "Cannot find an entry associated with this key" );
+
 
     /**
      * Creates a default empty AbstractPage

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/Leaf.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/Leaf.java?rev=1536070&r1=1536069&r2=1536070&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/Leaf.java
(original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/Leaf.java
Sun Oct 27 09:07:08 2013
@@ -554,7 +554,7 @@ import org.apache.directory.mavibot.btre
         }
         else
         {
-            throw new KeyNotFoundException( "Cannot find an entry for key " + key );
+            throw KEY_NOT_FOUND_EXCEPTION;
         }
     }
 
@@ -585,7 +585,7 @@ import org.apache.directory.mavibot.btre
         }
         else
         {
-            throw new KeyNotFoundException( "Cannot find an entry for key " + key );
+            throw KEY_NOT_FOUND_EXCEPTION;
         }
     }
 



Mime
View raw message