db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r1057702 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/io/ engine/org/apache/derby/impl/io/vfmem/ engine/org/apache/derby/impl/services/jce/ engine/org/apache/derby/impl/store/raw/data/ engine/org/apache/derby/impl/store/raw/...
Date Tue, 11 Jan 2011 15:45:35 GMT
Author: dag
Date: Tue Jan 11 15:45:35 2011
New Revision: 1057702

URL: http://svn.apache.org/viewvc?rev=1057702&view=rev
Log:
DERBY-4963 Revert to FileDescriptor#sync from FileChannel#force to improve interrupt resilience

Patch derby-4963-2 removes DirRandomAccessFile4 and with it the use of
FileChannel#force.  It also removes the metadata boolean argument (no
longer used) from the StorageRandomAccessFile#sync.


Removed:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirRandomAccessFile4.java
Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile4.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirRandomAccessFile.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/io/build.xml
    db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/VirtualRandomAccessFile.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/jce/JCECipherFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java
    db/derby/code/trunk/java/engine/org/apache/derby/io/StorageRandomAccessFile.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptRandomAccessFile.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RecoverBadLog.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile4.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile4.java?rev=1057702&r1=1057701&r2=1057702&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile4.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile4.java Tue Jan 11 15:45:35
2011
@@ -272,6 +272,6 @@ class DirFile4 extends DirFile
         // Assume that modes "rws" and "rwd" are not supported.
         if(!rwsOK && ("rws".equals( mode) || "rwd".equals( mode)))
             mode = "rw";
-        return new DirRandomAccessFile4( (File) this, mode);
+        return new DirRandomAccessFile( (File) this, mode);
     } // end of getRandomAccessFile
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirRandomAccessFile.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirRandomAccessFile.java?rev=1057702&r1=1057701&r2=1057702&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirRandomAccessFile.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirRandomAccessFile.java Tue
Jan 11 15:45:35 2011
@@ -60,13 +60,9 @@ class DirRandomAccessFile extends Random
     /**
      * Force any changes out to the persistent store.
      *
-     * @param metaData If true then this method is required to force changes to both the
file's
-     *          content and metadata to be written to storage; otherwise, it need only force
content changes
-     *          to be written.
-     *
      * @exception IOException If an IO error occurs.
      */
-    public void sync( boolean metaData) throws IOException
+    public void sync( ) throws IOException
     {
         getFD().sync();
     }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/io/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/io/build.xml?rev=1057702&r1=1057701&r2=1057702&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/io/build.xml (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/io/build.xml Tue Jan 11 15:45:35
2011
@@ -53,7 +53,6 @@
       </classpath>
       <include name="${derby.dir}/impl/io/**"/>
       <exclude name="${derby.dir}/impl/io/DirFile4.java"/>
-      <exclude name="${derby.dir}/impl/io/DirRandomAccessFile4.java"/>
       <exclude name="${derby.dir}/impl/io/DirStorageFactory4.java"/>
     </javac>
   </target>
@@ -75,7 +74,6 @@
         <pathelement path="${java14compile.classpath}"/>
       </classpath>
       <include name="${derby.dir}/impl/io/DirFile4.java"/>
-	  <include name="${derby.dir}/impl/io/DirRandomAccessFile4.java"/>
       <include name="${derby.dir}/impl/io/DirStorageFactory4.java"/>
     </javac>
   </target>

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/VirtualRandomAccessFile.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/VirtualRandomAccessFile.java?rev=1057702&r1=1057701&r2=1057702&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/VirtualRandomAccessFile.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/VirtualRandomAccessFile.java
Tue Jan 11 15:45:35 2011
@@ -125,7 +125,7 @@ public class VirtualRandomAccessFile
         }
     }
 
-    public void sync(boolean metaData) {
+    public void sync() {
         // Do nothing, everything is already synced.
     }
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/jce/JCECipherFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/jce/JCECipherFactory.java?rev=1057702&r1=1057701&r2=1057702&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/jce/JCECipherFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/jce/JCECipherFactory.java
Tue Jan 11 15:45:35 2011
@@ -899,7 +899,7 @@ public final class JCECipherFactory impl
 				verifyKeyFile.writeInt(checksum.length);
 				verifyKeyFile.write(checksum);
 				verifyKeyFile.write(data);
-				verifyKeyFile.sync(true);
+				verifyKeyFile.sync();
 			}
 			else
 			{

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java?rev=1057702&r1=1057701&r2=1057702&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
Tue Jan 11 15:45:35 2011
@@ -1899,7 +1899,7 @@ public class BaseDataFileFactory
             // write it out for future reference
             fileLockOnDB.writeUTF(myUUID.toString()); 
 
-            fileLockOnDB.sync( false);
+            fileLockOnDB.sync();
             fileLockOnDB.seek(0);
             // check the UUID
             UUID checkUUID = uuidFactory.recreateUUID(fileLockOnDB.readUTF());
@@ -1988,7 +1988,7 @@ public class BaseDataFileFactory
                 // write it out for future reference
                 fileLockOnDB.writeUTF(myUUID.toString()); 
 
-                fileLockOnDB.sync( false);
+                fileLockOnDB.sync();
                 fileLockOnDB.close();
             }
             catch (IOException ioe)

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java?rev=1057702&r1=1057701&r2=1057702&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java
Tue Jan 11 15:45:35 2011
@@ -364,7 +364,7 @@ class RAFContainer extends FileContainer
 				try
 				{
                     if (!dataFactory.dataNotSyncedAtAllocation)
-                        fileData.sync( false);
+                        fileData.sync();
 				}
 				finally
 				{
@@ -640,7 +640,7 @@ class RAFContainer extends FileContainer
 					inwrite = true;
 
                     if (!dataFactory.dataNotSyncedAtAllocation)
-                        fileData.sync(false);
+                        fileData.sync();
   				}
 				catch (IOException ioe)
 				{
@@ -758,7 +758,7 @@ class RAFContainer extends FileContainer
 			try
 			{
                 if (!dataFactory.dataNotSyncedAtCheckpoint)
-                   file.sync(false);
+                   file.sync();
 
 			}
 			finally
@@ -1320,7 +1320,7 @@ class RAFContainer extends FileContainer
             }
 
             // sync the new version of the container.
-            newRaf.sync(true);
+            newRaf.sync();
             newRaf.close();
             newRaf = null;
             

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java?rev=1057702&r1=1057701&r2=1057702&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java
Tue Jan 11 15:45:35 2011
@@ -660,7 +660,7 @@ public class LogAccessFile 
             {
                 synchronized( this)
                 {
-                    log.sync( false);
+                    log.sync();
                 }
 
                 // the sync succeed, so return

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java?rev=1057702&r1=1057701&r2=1057702&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java Tue
Jan 11 15:45:35 2011
@@ -4194,7 +4194,7 @@ public final class LogToFile implements 
             // mounted disk.  We re-try to do this 20 times.
             try
             {
-                raf.sync( false);
+                raf.sync();
 
                 // the sync succeed, so return
                 break;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/io/StorageRandomAccessFile.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/io/StorageRandomAccessFile.java?rev=1057702&r1=1057701&r2=1057702&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/io/StorageRandomAccessFile.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/io/StorageRandomAccessFile.java Tue Jan
11 15:45:35 2011
@@ -98,15 +98,11 @@ public interface StorageRandomAccessFile
      * Force any changes out to the persistent store. If the database is to be transient,
that is, if the database
      * does not survive a restart, then the sync method implementation need not do anything.
      *
-     * @param metaData If true then this method must force both changes to the file's
-     *          contents and metadata to be written to storage; if false, it need only force
file content changes
-     *          to be written. The implementation is allowed to ignore this parameter and
always force out
-     *          metadata changes.
      *
      * @exception SyncFailedException if a possibly recoverable error occurs.
      * @exception IOException If an IO error occurs.
      */
-    public void sync( boolean metaData) throws IOException;
+    public void sync() throws IOException;
 
     /**
      * Reads up to <code>len</code> bytes of data from this file into an

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptRandomAccessFile.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptRandomAccessFile.java?rev=1057702&r1=1057701&r2=1057702&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptRandomAccessFile.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptRandomAccessFile.java
Tue Jan 11 15:45:35 2011
@@ -101,9 +101,9 @@ public class CorruptRandomAccessFile imp
     /**
      * Force any changes out to the persistent store. 
      */
-    public void sync( boolean metaData) throws IOException
+    public void sync() throws IOException
 	{
-		realRaf.sync(metaData);
+		realRaf.sync();
 	}
 
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RecoverBadLog.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RecoverBadLog.java?rev=1057702&r1=1057701&r2=1057702&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RecoverBadLog.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RecoverBadLog.java
Tue Jan 11 15:45:35 2011
@@ -1818,7 +1818,7 @@ public class T_RecoverBadLog extends T_G
 				filepos +=512;
 
 			}
-			log.sync(false);
+			log.sync();
 			log.close();
 		}catch(IOException ie)
 		{



Mime
View raw message