db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r474695 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer4.java
Date Tue, 14 Nov 2006 08:32:25 GMT
Author: kahatlen
Date: Tue Nov 14 00:32:25 2006
New Revision: 474695

URL: http://svn.apache.org/viewvc?view=rev&rev=474695
Log:
DERBY-801: Allow parallel access to data files

This patch (DERBY-801-7.patch) turns the DEBUG_PRINT messages in
RAFContainer4 into assertions guarding the method entry points.

Patch contributed by Anders Morken.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer4.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer4.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer4.java?view=diff&rev=474695&r1=474694&r2=474695
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer4.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer4.java
Tue Nov 14 00:32:25 2006
@@ -172,6 +172,14 @@
             ioChannel = ourChannel;
             if (SanityManager.DEBUG) {
                 SanityManager.ASSERT(!getCommittedDropState());
+                // If ioChannel == null and fileData supports getChannel()
+                // we have a problem. See this.openContainer(ContainerKey 
+                // newIdentity).
+                SanityManager.ASSERT(! ((ioChannel == null) &&
+                        super.fileData instanceof java.io.RandomAccessFile),
+                        "RAFContainer4: New style readPage attempted" +
+                        " with uninitialized ioChannel");
+
             }
         }
 
@@ -209,10 +217,6 @@
         }
         else
         { // iochannel was not initialized, fall back to original method.
-            if(SanityManager.DEBUG) {
-                SanityManager.DEBUG_PRINT("RAFContainer4",
-                        "New style readPage attempted with uninitialized ioChannel");
-            }
             super.readPage(pageNumber, pageData);
         }
     }
@@ -236,6 +240,14 @@
             if (getCommittedDropState())
                 return;
             ioChannel = ourChannel;
+            if (SanityManager.DEBUG) {
+                // If ioChannel == null and fileData supports getChannel()
+                // we have a problem
+                SanityManager.ASSERT(! ((ioChannel == null) &&
+                        super.fileData instanceof java.io.RandomAccessFile),
+                        "RAFContainer4: New style writePage attempted " +
+                        "with uninitialized ioChannel");
+            }
         }
         if(ioChannel != null) {
             ///////////////////////////////////////////////////
@@ -344,10 +356,6 @@
             }
 
         } else { // iochannel was not initialized, fall back to original method.
-            if(SanityManager.DEBUG) {
-                SanityManager.DEBUG_PRINT("RAFContainer4",
-                        "New style writePage attempted with uninitialized ioChannel");
-            }
             super.writePage(pageNumber, pageData, syncPage);
         }
     }



Mime
View raw message