db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1433331 - in /db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree: ./ index/
Date Tue, 15 Jan 2013 09:52:24 GMT
Author: kahatlen
Date: Tue Jan 15 09:52:24 2013
New Revision: 1433331

URL: http://svn.apache.org/viewvc?rev=1433331&view=rev
Log:
DERBY-6041: Remove unused parameters from the BTreeLockingPolicy interface

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeController.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeForwardScan.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeLockingPolicy.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeMaxScan.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeScan.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2INoLocking.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IRowLocking1.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IRowLocking3.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IRowLockingRR.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeController.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeController.java?rev=1433331&r1=1433330&r2=1433331&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeController.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeController.java
Tue Jan 15 09:52:24 2013
@@ -593,7 +593,7 @@ public class BTreeController extends Ope
         RowLocation lock_row_loc = 
             (RowLocation) scratch_template[scratch_template.length - 1];
         boolean latch_released = !getLockingPolicy().lockNonScanRowOnPage(
-                this.getConglomerate(), leaf, slot, lock_fetch_desc,template, 
+                leaf, slot, lock_fetch_desc, template,
                 lock_row_loc, ConglomerateController.LOCK_UPD);
         //if latch was released some other transaction was operating on this
         //record and might have changed the tree by now
@@ -737,7 +737,6 @@ public class BTreeController extends Ope
 
             latch_released = 
                 !this.getLockingPolicy().lockNonScanPreviousRow(
-                    this.getConglomerate(),
                     targetleaf, 
                     slot_after_previous, 
                     lock_fetch_desc,
@@ -792,7 +791,7 @@ public class BTreeController extends Ope
 
                     latch_released = 
                         !this.getLockingPolicy().lockNonScanRowOnPage(
-                            this.getConglomerate(), targetleaf, insert_slot, 
+                            targetleaf, insert_slot,
                             lock_fetch_desc, scratch_template, lock_row_loc,
                             ConglomerateController.LOCK_UPD);
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeForwardScan.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeForwardScan.java?rev=1433331&r1=1433330&r2=1433331&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeForwardScan.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeForwardScan.java
Tue Jan 15 09:52:24 2013
@@ -304,7 +304,7 @@ public class BTreeForwardScan extends BT
                 // row was marked deleted - the key value cannot change.
                 boolean latch_released =
                     !this.getLockingPolicy().lockScanRow(
-                        this, this.getConglomerate(), pos, 
+                        this, pos,
                         init_lock_fetch_desc,
                         pos.current_lock_template,
                         pos.current_lock_row_loc,
@@ -391,7 +391,6 @@ public class BTreeForwardScan extends BT
                             latch_released =
                                 !this.getLockingPolicy().lockScanRow(
                                     this, 
-                                    this.getConglomerate(), 
                                     pos, 
                                     init_lock_fetch_desc,
                                     pos.current_lock_template,

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeLockingPolicy.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeLockingPolicy.java?rev=1433331&r1=1433330&r2=1433331&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeLockingPolicy.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeLockingPolicy.java
Tue Jan 15 09:52:24 2013
@@ -114,7 +114,6 @@ public interface BTreeLockingPolicy
      *
      * @param open_btree        The open_btree to associate latches with - 
      *                          used if routine has to scan backward.
-     * @param btree             the conglomerate info.
      * @param pos               Description of position of row to lock.
      * @param lock_template     A scratch area to use to read in rows.
      * @param previous_key_lock Is this a previous key lock call?
@@ -131,7 +130,6 @@ public interface BTreeLockingPolicy
      **/
     abstract public boolean lockScanRow(
     OpenBTree               open_btree,
-    BTree                   btree,
     BTreeRowPosition        pos,
     FetchDescriptor         lock_fetch_desc,
     DataValueDescriptor[]   lock_template,
@@ -202,7 +200,6 @@ public interface BTreeLockingPolicy
      * moved in the btree so caller must research to find the row.
      *
      *
-     * @param btree             The conglomerate we are locking.
      * @param current_leaf      Latched current leaf where "current" key is.
      * @param current_slot      The slot of row on "current_leaf" 
      * @param lock_template     Empty full template row, to read row into.
@@ -226,7 +223,6 @@ public interface BTreeLockingPolicy
 	 * @exception  StandardException  Standard exception policy.
      **/
     abstract public boolean lockNonScanPreviousRow(
-    BTree                   btree,
     LeafControlRow          current_leaf,
     int                     current_slot,
     FetchDescriptor         lock_fetch_desc,
@@ -291,7 +287,6 @@ public interface BTreeLockingPolicy
      *
 	 * @return Whether locks were acquired without releasing latch on leaf.
      *
-     * @param btree             the conglomerate info.
      * @param leaf              The control row of the current leaf to lock.
      * @param slot              The slot position of the row to lock.
      * @param lock_template     A scratch area to use to read in rows.
@@ -306,7 +301,6 @@ public interface BTreeLockingPolicy
 	 * @exception  StandardException  Standard exception policy.
      **/
     abstract public boolean lockNonScanRowOnPage(
-    BTree                   btree,
     LeafControlRow          leaf,
     int                     slot,
     FetchDescriptor         lock_fetch_desc,

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeMaxScan.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeMaxScan.java?rev=1433331&r1=1433330&r2=1433331&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeMaxScan.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeMaxScan.java
Tue Jan 15 09:52:24 2013
@@ -229,7 +229,7 @@ public class BTreeMaxScan extends BTreeS
             pos.current_slot--;
             boolean latch_released = 
                 !this.getLockingPolicy().lockScanRow(
-                    this, this.getConglomerate(), pos,
+                    this, pos,
                     init_lock_fetch_desc,
                     pos.current_lock_template,
                     pos.current_lock_row_loc,
@@ -460,7 +460,7 @@ public class BTreeMaxScan extends BTreeS
                 // lock current row in max scan, no previous key lock necessary.
                 boolean latch_released =
                     !this.getLockingPolicy().lockScanRow(
-                        this, this.getConglomerate(), pos, 
+                        this, pos,
                         init_lock_fetch_desc,
                         pos.current_lock_template,
                         pos.current_lock_row_loc,

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeScan.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeScan.java?rev=1433331&r1=1433330&r2=1433331&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeScan.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeScan.java
Tue Jan 15 09:52:24 2013
@@ -432,7 +432,7 @@ public abstract class BTreeScan extends 
             {
                 latch_released = 
                     !this.getLockingPolicy().lockScanRow(
-                        this, this.getConglomerate(), pos,
+                        this, pos,
                         init_lock_fetch_desc,
                         pos.current_lock_template,
                         pos.current_lock_row_loc,
@@ -1137,7 +1137,7 @@ public abstract class BTreeScan extends 
                 // the lock to X.
                 boolean latch_released =
                     !this.getLockingPolicy().lockScanRow(
-                        this, this.getConglomerate(), scan_position,
+                        this, scan_position,
                         init_lock_fetch_desc,
                         scan_position.current_lock_template,
                         scan_position.current_lock_row_loc,

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2INoLocking.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2INoLocking.java?rev=1433331&r1=1433330&r2=1433331&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2INoLocking.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2INoLocking.java
Tue Jan 15 09:52:24 2013
@@ -132,7 +132,6 @@ public class B2INoLocking implements BTr
      **/
     public boolean lockScanRow(
     OpenBTree               open_btree,
-    BTree                   btree,
     BTreeRowPosition        pos,
     FetchDescriptor         lock_fetch_desc,
     DataValueDescriptor[]   lock_template,
@@ -177,7 +176,6 @@ public class B2INoLocking implements BTr
 	 * @exception  StandardException  Standard exception policy.
      **/
     public boolean lockNonScanPreviousRow(
-    BTree                   btree,
     LeafControlRow          current_leaf,
     int                     current_slot,
     FetchDescriptor         lock_fetch_desc,
@@ -211,7 +209,6 @@ public class B2INoLocking implements BTr
     }
 
     public boolean lockNonScanRowOnPage(
-    BTree                   btree,
     LeafControlRow          current_leaf,
     int                     current_slot,
     FetchDescriptor         lock_fetch_desc,

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IRowLocking1.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IRowLocking1.java?rev=1433331&r1=1433330&r2=1433331&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IRowLocking1.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IRowLocking1.java
Tue Jan 15 09:52:24 2013
@@ -104,7 +104,6 @@ class B2IRowLocking1 extends B2IRowLocki
      *
      * @param open_btree        The open_btree to associate latches with - 
      *                          used if routine has to scan backward.
-     * @param btree             the conglomerate info.
      * @param pos               The position of the row to lock.
      * @param lock_template     A scratch area to use to read in rows.
      * @param previous_key_lock Is this a previous key lock call?
@@ -114,7 +113,6 @@ class B2IRowLocking1 extends B2IRowLocki
      **/
     public boolean lockScanRow(
     OpenBTree               open_btree,
-    BTree                   btree,
     BTreeRowPosition        pos,
     FetchDescriptor         lock_fetch_desc,
     DataValueDescriptor[]   lock_template,
@@ -129,7 +127,6 @@ class B2IRowLocking1 extends B2IRowLocki
         return(
             _lockScanRow(
                  open_btree,
-                 btree,
                  pos,
                  (forUpdate && !previous_key_lock), // only get update row lock
                  lock_fetch_desc, lock_template, lock_row_loc,

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IRowLocking3.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IRowLocking3.java?rev=1433331&r1=1433330&r2=1433331&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IRowLocking3.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IRowLocking3.java
Tue Jan 15 09:52:24 2013
@@ -201,7 +201,6 @@ class B2IRowLocking3 implements BTreeLoc
      * and then it will request a WAIT lock on the row.  
      * <p>
      *
-     * @param btree             The conglomerate we are locking.
      * @param current_leaf      Latched current leaf where "current" key is.
      * @param aux_leaf          If non-null, this leaf is unlatched if the 
      *                          routine has to wait on the lock.
@@ -222,7 +221,6 @@ class B2IRowLocking3 implements BTreeLoc
 	 * @exception  StandardException  Standard exception policy.
      **/
     private boolean lockRowOnPage(
-    BTree                   btree,
     LeafControlRow          current_leaf,
     LeafControlRow          aux_leaf,
     int                     current_slot,
@@ -247,14 +245,6 @@ class B2IRowLocking3 implements BTreeLoc
                         current_leaf.getPage().recordCount());
             }
 
-
-            if (!(btree instanceof B2I))
-            {
-                SanityManager.THROWASSERT(
-                    "btree not instance of B2I, it is " +
-                    btree.getClass().getName());
-            }
-
             SanityManager.ASSERT(lock_template != null, "template is null");
 
             // For now the RowLocation is expected to be the object located in
@@ -351,9 +341,7 @@ class B2IRowLocking3 implements BTreeLoc
      * @exception  StandardException  Standard exception policy.
      **/
     private boolean searchLeftAndLockPreviousKey(
-    B2I                     b2i,
     LeafControlRow          current_leaf,
-    int                     current_slot,
     FetchDescriptor         lock_fetch_desc,
     DataValueDescriptor[]   lock_template,
     RowLocation             lock_row_loc,
@@ -406,7 +394,6 @@ class B2IRowLocking3 implements BTreeLoc
                     
                     boolean ret_status = 
                         lockRowOnPage(
-                            b2i,
                             prev_leaf, 
                             current_leaf, 
                             prev_leaf.getPage().recordCount() - 1, 
@@ -520,7 +507,6 @@ class B2IRowLocking3 implements BTreeLoc
      *
      * @param open_btree        The open_btree to associate latches with - 
      *                          used if routine has to scan backward.
-     * @param btree             the conglomerate info.
      * @param pos               The position of the row to lock.
      * @param request_row_lock  Whether to request the row lock, should
      *                          only be requested once per page in the scan.
@@ -534,7 +520,6 @@ class B2IRowLocking3 implements BTreeLoc
      **/
     protected boolean _lockScanRow(
     OpenBTree               open_btree,
-    BTree                   btree,
     BTreeRowPosition        pos,
     boolean                 request_row_lock,
     FetchDescriptor         lock_fetch_desc,
@@ -546,7 +531,6 @@ class B2IRowLocking3 implements BTreeLoc
 		throws StandardException
     {
         boolean latch_released = false;
-        B2I     b2i            = (B2I) btree;
 
         if (request_row_lock)
         {
@@ -568,7 +552,6 @@ class B2IRowLocking3 implements BTreeLoc
 
                 latch_released = 
                     !lockNonScanPreviousRow(
-                        btree,
                         pos.current_leaf,
                         1 /* lock row previous to row at slot 1 */, 
                         lock_fetch_desc,
@@ -598,7 +581,6 @@ class B2IRowLocking3 implements BTreeLoc
 
                 latch_released = 
                     !lockRowOnPage(
-                        btree,
                         pos.current_leaf, 
                         (LeafControlRow) null /* no other latch currently */,
                         pos.current_slot, 
@@ -697,7 +679,6 @@ class B2IRowLocking3 implements BTreeLoc
      *
      * @param open_btree        The open_btree to associate latches with - 
      *                          used if routine has to scan backward.
-     * @param btree             the conglomerate info.
      * @param pos               The position of the row to lock.
      * @param lock_template     A scratch area to use to read in rows.
      * @param previous_key_lock Is this a previous key lock call?
@@ -707,7 +688,6 @@ class B2IRowLocking3 implements BTreeLoc
      **/
     public boolean lockScanRow(
     OpenBTree               open_btree,
-    BTree                   btree,
     BTreeRowPosition        pos,
     FetchDescriptor         lock_fetch_desc,
     DataValueDescriptor[]   lock_template,
@@ -720,7 +700,6 @@ class B2IRowLocking3 implements BTreeLoc
         return(
             _lockScanRow(
                 open_btree,
-                btree,
                 pos,
                 true,  // request the row lock (always true for iso 3 )
                 lock_fetch_desc,
@@ -762,7 +741,6 @@ class B2IRowLocking3 implements BTreeLoc
 	 * @exception  StandardException  Standard exception policy.
      **/
     public boolean lockNonScanPreviousRow(
-    BTree                   btree,
     LeafControlRow          current_leaf,
     int                     current_slot,
     FetchDescriptor         lock_fetch_desc,
@@ -775,11 +753,6 @@ class B2IRowLocking3 implements BTreeLoc
     {
         boolean          ret_status;
 
-        if (SanityManager.DEBUG)
-        {
-            SanityManager.ASSERT(btree instanceof B2I);
-        }
-
         if (current_slot > 1)
         {
             // Easy case, just lock the key previous to the current one.
@@ -788,7 +761,6 @@ class B2IRowLocking3 implements BTreeLoc
 
             ret_status = 
                 lockRowOnPage(
-                    btree,
                     current_leaf, (LeafControlRow) null, 
                     current_slot - 1,
                     null,
@@ -824,8 +796,7 @@ class B2IRowLocking3 implements BTreeLoc
                 // caller must research, get new locks if this routine 
                 // releases latches.
                 ret_status = this.searchLeftAndLockPreviousKey(
-                    (B2I) btree,
-                    current_leaf, current_slot,
+                    current_leaf,
                     lock_fetch_desc, lock_template, lock_row_loc,
                     open_btree, lock_operation, lock_duration);
             }
@@ -889,7 +860,6 @@ class B2IRowLocking3 implements BTreeLoc
     }
 
     public boolean lockNonScanRowOnPage(
-    BTree                   btree,
     LeafControlRow          current_leaf,
     int                     current_slot,
     FetchDescriptor         lock_fetch_desc,
@@ -900,7 +870,6 @@ class B2IRowLocking3 implements BTreeLoc
     {
         return(
             lockRowOnPage(
-                btree,
                 current_leaf,
                 null,
                 current_slot,

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IRowLockingRR.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IRowLockingRR.java?rev=1433331&r1=1433330&r2=1433331&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IRowLockingRR.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IRowLockingRR.java
Tue Jan 15 09:52:24 2013
@@ -80,7 +80,6 @@ class B2IRowLockingRR extends B2IRowLock
      *
      * @param open_btree        The open_btree to associate latches with - 
      *                          used if routine has to scan backward.
-     * @param btree             the conglomerate info.
      * @param pos               The position of the row to lock.
      * @param lock_template     A scratch area to use to read in rows.
      * @param previous_key_lock Is this a previous key lock call?
@@ -90,7 +89,6 @@ class B2IRowLockingRR extends B2IRowLock
      **/
     public boolean lockScanRow(
     OpenBTree               open_btree,
-    BTree                   btree,
     BTreeRowPosition        pos,
     FetchDescriptor         lock_fetch_desc,
     DataValueDescriptor[]   lock_template,
@@ -105,7 +103,6 @@ class B2IRowLockingRR extends B2IRowLock
         return(
             _lockScanRow(
                 open_btree,
-                btree,
                 pos,
                 !previous_key_lock, // request row lock iff not prev key lock 
                 lock_fetch_desc, lock_template, lock_row_loc,



Mime
View raw message