db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r149338 - in incubator/derby/site/trunk: build/site/ build/site/papers/ src/documentation/content/xdocs/ src/documentation/content/xdocs/papers/
Date Tue, 01 Feb 2005 01:03:31 GMT
Author: jta
Date: Mon Jan 31 17:03:28 2005
New Revision: 149338

URL: http://svn.apache.org/viewcvs?view=rev&rev=149338
Log:
Added document by Dibyendu Majumdar <dibyendu@mazumdar.demon.co.uk> on
"Derby Write Ahead Log Format".

Added:
    incubator/derby/site/trunk/build/site/papers/logformats.html
    incubator/derby/site/trunk/src/documentation/content/xdocs/papers/logformats.xml
Modified:
    incubator/derby/site/trunk/build/site/linkmap.html
    incubator/derby/site/trunk/build/site/papers/ApacheConUs04.html
    incubator/derby/site/trunk/build/site/papers/JDBCImplementation.html
    incubator/derby/site/trunk/build/site/papers/MiscPresentations.html
    incubator/derby/site/trunk/build/site/papers/derby_arch.html
    incubator/derby/site/trunk/build/site/papers/derby_htw.html
    incubator/derby/site/trunk/build/site/papers/derby_plugin.html
    incubator/derby/site/trunk/build/site/papers/derby_web.html
    incubator/derby/site/trunk/build/site/papers/fortune_tut.html
    incubator/derby/site/trunk/build/site/papers/index.html
    incubator/derby/site/trunk/build/site/papers/misc.html
    incubator/derby/site/trunk/build/site/papers/pageformats.html
    incubator/derby/site/trunk/src/documentation/content/xdocs/papers/index.xml
    incubator/derby/site/trunk/src/documentation/content/xdocs/site.xml

Modified: incubator/derby/site/trunk/build/site/linkmap.html
URL: http://svn.apache.org/viewcvs/incubator/derby/site/trunk/build/site/linkmap.html?view=diff&r1=149337&r2=149338
==============================================================================
--- incubator/derby/site/trunk/build/site/linkmap.html (original)
+++ incubator/derby/site/trunk/build/site/linkmap.html Mon Jan 31 17:03:28 2005
@@ -164,6 +164,9 @@
 <div class="menuitem">
 <a title="" href="papers/JDBCImplementation.html">JDBC</a>
 </div>
+<div class="menuitem">
+<a title="" href="papers/logformats.html">Log Format</a>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_1.5', 'skin/')" id="menu_1.5Title" class="menutitle">Integration</div>
 <div id="menu_1.5" class="menuitemgroup">
@@ -394,6 +397,10 @@
       
 <li>
 <a href="papers/JDBCImplementation.html">JDBC</a>&nbsp;&nbsp;&nbsp;_________________________&nbsp;&nbsp;<em>jdbc</em>
+</li>
+      
+<li>
+<a href="papers/logformats.html">Log Format</a>&nbsp;&nbsp;&nbsp;_________________________&nbsp;&nbsp;<em>log</em>
 </li>
   
 </ul>

Modified: incubator/derby/site/trunk/build/site/papers/ApacheConUs04.html
URL: http://svn.apache.org/viewcvs/incubator/derby/site/trunk/build/site/papers/ApacheConUs04.html?view=diff&r1=149337&r2=149338
==============================================================================
--- incubator/derby/site/trunk/build/site/papers/ApacheConUs04.html (original)
+++ incubator/derby/site/trunk/build/site/papers/ApacheConUs04.html Mon Jan 31 17:03:28 2005
@@ -125,6 +125,9 @@
 <div class="menuitem">
 <a title="" href="../papers/JDBCImplementation.html">JDBC</a>
 </div>
+<div class="menuitem">
+<a title="" href="../papers/logformats.html">Log Format</a>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_1.3', '../skin/')" id="menu_1.3Title" class="menutitle">Integration</div>
 <div id="menu_1.3" class="menuitemgroup">

Modified: incubator/derby/site/trunk/build/site/papers/JDBCImplementation.html
URL: http://svn.apache.org/viewcvs/incubator/derby/site/trunk/build/site/papers/JDBCImplementation.html?view=diff&r1=149337&r2=149338
==============================================================================
--- incubator/derby/site/trunk/build/site/papers/JDBCImplementation.html (original)
+++ incubator/derby/site/trunk/build/site/papers/JDBCImplementation.html Mon Jan 31 17:03:28 2005
@@ -125,6 +125,9 @@
 <div class="menupage">
 <div class="menupagetitle">JDBC</div>
 </div>
+<div class="menuitem">
+<a title="" href="../papers/logformats.html">Log Format</a>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_1.3', '../skin/')" id="menu_1.3Title" class="menutitle">Integration</div>
 <div id="menu_1.3" class="menuitemgroup">

Modified: incubator/derby/site/trunk/build/site/papers/MiscPresentations.html
URL: http://svn.apache.org/viewcvs/incubator/derby/site/trunk/build/site/papers/MiscPresentations.html?view=diff&r1=149337&r2=149338
==============================================================================
--- incubator/derby/site/trunk/build/site/papers/MiscPresentations.html (original)
+++ incubator/derby/site/trunk/build/site/papers/MiscPresentations.html Mon Jan 31 17:03:28 2005
@@ -125,6 +125,9 @@
 <div class="menuitem">
 <a title="" href="../papers/JDBCImplementation.html">JDBC</a>
 </div>
+<div class="menuitem">
+<a title="" href="../papers/logformats.html">Log Format</a>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_1.3', '../skin/')" id="menu_1.3Title" class="menutitle">Integration</div>
 <div id="menu_1.3" class="menuitemgroup">

Modified: incubator/derby/site/trunk/build/site/papers/derby_arch.html
URL: http://svn.apache.org/viewcvs/incubator/derby/site/trunk/build/site/papers/derby_arch.html?view=diff&r1=149337&r2=149338
==============================================================================
--- incubator/derby/site/trunk/build/site/papers/derby_arch.html (original)
+++ incubator/derby/site/trunk/build/site/papers/derby_arch.html Mon Jan 31 17:03:28 2005
@@ -125,6 +125,9 @@
 <div class="menuitem">
 <a title="" href="../papers/JDBCImplementation.html">JDBC</a>
 </div>
+<div class="menuitem">
+<a title="" href="../papers/logformats.html">Log Format</a>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_1.3', '../skin/')" id="menu_1.3Title" class="menutitle">Integration</div>
 <div id="menu_1.3" class="menuitemgroup">

Modified: incubator/derby/site/trunk/build/site/papers/derby_htw.html
URL: http://svn.apache.org/viewcvs/incubator/derby/site/trunk/build/site/papers/derby_htw.html?view=diff&r1=149337&r2=149338
==============================================================================
--- incubator/derby/site/trunk/build/site/papers/derby_htw.html (original)
+++ incubator/derby/site/trunk/build/site/papers/derby_htw.html Mon Jan 31 17:03:28 2005
@@ -125,6 +125,9 @@
 <div class="menuitem">
 <a title="" href="../papers/JDBCImplementation.html">JDBC</a>
 </div>
+<div class="menuitem">
+<a title="" href="../papers/logformats.html">Log Format</a>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_1.3', '../skin/')" id="menu_1.3Title" class="menutitle">Integration</div>
 <div id="menu_1.3" class="menuitemgroup">

Modified: incubator/derby/site/trunk/build/site/papers/derby_plugin.html
URL: http://svn.apache.org/viewcvs/incubator/derby/site/trunk/build/site/papers/derby_plugin.html?view=diff&r1=149337&r2=149338
==============================================================================
--- incubator/derby/site/trunk/build/site/papers/derby_plugin.html (original)
+++ incubator/derby/site/trunk/build/site/papers/derby_plugin.html Mon Jan 31 17:03:28 2005
@@ -125,6 +125,9 @@
 <div class="menuitem">
 <a title="" href="../papers/JDBCImplementation.html">JDBC</a>
 </div>
+<div class="menuitem">
+<a title="" href="../papers/logformats.html">Log Format</a>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_selected_1.3', '../skin/')" id="menu_selected_1.3Title" class="menutitle" style="background-image: url('../skin/images/chapter_open.gif');">Integration</div>
 <div id="menu_selected_1.3" class="selectedmenuitemgroup" style="display: block;">

Modified: incubator/derby/site/trunk/build/site/papers/derby_web.html
URL: http://svn.apache.org/viewcvs/incubator/derby/site/trunk/build/site/papers/derby_web.html?view=diff&r1=149337&r2=149338
==============================================================================
--- incubator/derby/site/trunk/build/site/papers/derby_web.html (original)
+++ incubator/derby/site/trunk/build/site/papers/derby_web.html Mon Jan 31 17:03:28 2005
@@ -125,6 +125,9 @@
 <div class="menuitem">
 <a title="" href="../papers/JDBCImplementation.html">JDBC</a>
 </div>
+<div class="menuitem">
+<a title="" href="../papers/logformats.html">Log Format</a>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_1.3', '../skin/')" id="menu_1.3Title" class="menutitle">Integration</div>
 <div id="menu_1.3" class="menuitemgroup">

Modified: incubator/derby/site/trunk/build/site/papers/fortune_tut.html
URL: http://svn.apache.org/viewcvs/incubator/derby/site/trunk/build/site/papers/fortune_tut.html?view=diff&r1=149337&r2=149338
==============================================================================
--- incubator/derby/site/trunk/build/site/papers/fortune_tut.html (original)
+++ incubator/derby/site/trunk/build/site/papers/fortune_tut.html Mon Jan 31 17:03:28 2005
@@ -125,6 +125,9 @@
 <div class="menuitem">
 <a title="" href="../papers/JDBCImplementation.html">JDBC</a>
 </div>
+<div class="menuitem">
+<a title="" href="../papers/logformats.html">Log Format</a>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_1.3', '../skin/')" id="menu_1.3Title" class="menutitle">Integration</div>
 <div id="menu_1.3" class="menuitemgroup">

Modified: incubator/derby/site/trunk/build/site/papers/index.html
URL: http://svn.apache.org/viewcvs/incubator/derby/site/trunk/build/site/papers/index.html?view=diff&r1=149337&r2=149338
==============================================================================
--- incubator/derby/site/trunk/build/site/papers/index.html (original)
+++ incubator/derby/site/trunk/build/site/papers/index.html Mon Jan 31 17:03:28 2005
@@ -125,6 +125,9 @@
 <div class="menuitem">
 <a title="" href="../papers/JDBCImplementation.html">JDBC</a>
 </div>
+<div class="menuitem">
+<a title="" href="../papers/logformats.html">Log Format</a>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_1.3', '../skin/')" id="menu_1.3Title" class="menutitle">Integration</div>
 <div id="menu_1.3" class="menuitemgroup">
@@ -233,12 +236,15 @@
 <li>JDBC: <a href="JDBCImplementation.html">Derby JDBC Implementation
 		Notes</a>
 </li>
+	
+<li>Log Format: <a href="logformats.html">Derby Write Ahead Log Format</a>
+</li>
 
 </ul>
 </div>
 
 
-<a name="N10034"></a><a name="Integration"></a>
+<a name="N1003A"></a><a name="Integration"></a>
 <h2 class="boxed">Integration</h2>
 <div class="section">
 <p>  The <a href="misc.html">Summary</a> contains pointers
@@ -270,7 +276,7 @@
 </div>
 
 
-<a name="N1006B"></a><a name="Presentations"></a>
+<a name="N10071"></a><a name="Presentations"></a>
 <h2 class="boxed">Presentations</h2>
 <div class="section">
 <ul>
@@ -329,7 +335,7 @@
 </div>
 
 
-<a name="N100D1"></a><a name="How+To%27s"></a>
+<a name="N100D7"></a><a name="How+To%27s"></a>
 <h2 class="boxed">How To's</h2>
 <div class="section">
 <p>
@@ -341,7 +347,7 @@
 </div>
 
 
-<a name="N100DF"></a><a name="How+to+Contribute+Papers"></a>
+<a name="N100E5"></a><a name="How+to+Contribute+Papers"></a>
 <h2 class="boxed">How to Contribute Papers</h2>
 <div class="section">
 <p>

Added: incubator/derby/site/trunk/build/site/papers/logformats.html
URL: http://svn.apache.org/viewcvs/incubator/derby/site/trunk/build/site/papers/logformats.html?view=auto&rev=149338
==============================================================================
--- incubator/derby/site/trunk/build/site/papers/logformats.html (added)
+++ incubator/derby/site/trunk/build/site/papers/logformats.html Mon Jan 31 17:03:28 2005
@@ -0,0 +1,653 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<meta content="Apache Forrest" name="Generator">
+<meta name="Forrest-version" content="0.6">
+<meta name="Forrest-skin-name" content="pelt">
+<title>Derby Write Ahead Log Format</title>
+<link type="text/css" href="../skin/basic.css" rel="stylesheet">
+<link media="screen" type="text/css" href="../skin/screen.css" rel="stylesheet">
+<link media="print" type="text/css" href="../skin/print.css" rel="stylesheet">
+<link type="text/css" href="../skin/profile.css" rel="stylesheet">
+<script src="../skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="../skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="../skin/fontsize.js" language="javascript" type="text/javascript"></script>
+<link rel="shortcut icon" href="../">
+</head>
+<body onload="init()">
+<script type="text/javascript">ndeSetTextSize();</script>
+<div id="top">
+<!--+
+    |breadtrail
+    +-->
+<div class="breadtrail">
+<a href="http://www.apache.org/">apache</a> &gt; <a href="http://incubator.apache.org/">incubator</a><script src="../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
+</div>
+<!--+
+    |header
+    +-->
+<div class="header">
+<!--+
+    |start group logo
+    +-->
+<div class="grouplogo">
+<a href="http://incubator.apache.org"><img class="logoImage" alt="" src="../images/apache-incubator-logo.png" title=""></a>
+</div>
+<!--+
+    |end group logo
+    +-->
+<!--+
+    |start Project Logo
+    +-->
+<div class="projectlogo">
+<a href="http://incubator.apache.org/derby/"><img class="logoImage" alt="Derby" src="../images/derby-logo.jpg" title="Derby is a zero admin java RDBMS."></a>
+</div>
+<!--+
+    |end Project Logo
+    +-->
+<!--+
+    |start Search
+    +-->
+<div class="searchbox">
+<form action="http://www.google.com/search" method="get" class="roundtopsmall">
+<input value="apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google:');" value="Search the site with google:" size="25" name="q" id="query" type="text">&nbsp; 
+                    <input name="Search" value="Search" type="submit">
+</form>
+</div>
+<!--+
+    |end search
+    +-->
+<!--+
+    |start Tabs
+    +-->
+<ul id="tabs">
+<li>
+<a class="base-not-selected" href="../index.html">Home</a>
+</li>
+<li>
+<a class="base-not-selected" href="../manuals/index.html">Manuals</a>
+</li>
+<li class="current">
+<a class="base-selected" href="../papers/index.html">Papers</a>
+</li>
+</ul>
+<!--+
+    |end Tabs
+    +-->
+</div>
+</div>
+<div id="main">
+<div id="publishedStrip">
+<!--+
+    |start Subtabs
+    +-->
+<div id="level2tabs"></div>
+<!--+
+    |end Endtabs
+    +-->
+<script type="text/javascript" language="JavaScript"><!--
+              document.write("Published: " + document.lastModified);
+              //  --></script>
+</div>
+<!--+
+    |breadtrail
+    +-->
+<div class="breadtrail">
+             
+             &nbsp;
+           </div>
+<!--+
+    |start Menu, mainarea
+    +-->
+<!--+
+    |start Menu
+    +-->
+<div id="menu">
+<div onclick="SwitchMenu('menu_1.1', '../skin/')" id="menu_1.1Title" class="menutitle">About</div>
+<div id="menu_1.1" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../papers/index.html">Index</a>
+</div>
+<div class="menuitem">
+<a title="" href="../papers/derby_web.html">Derby Web Site</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_selected_1.2', '../skin/')" id="menu_selected_1.2Title" class="menutitle" style="background-image: url('../skin/images/chapter_open.gif');">Derby Engine</div>
+<div id="menu_selected_1.2" class="selectedmenuitemgroup" style="display: block;">
+<div class="menuitem">
+<a title="" href="../papers/derby_arch.html">Architecture</a>
+</div>
+<div class="menuitem">
+<a title="" href="../papers/pageformats.html">Disk Page Format</a>
+</div>
+<div class="menuitem">
+<a title="" href="../papers/derby_htw.html">How Things Work</a>
+</div>
+<div class="menuitem">
+<a title="" href="../papers/JDBCImplementation.html">JDBC</a>
+</div>
+<div class="menupage">
+<div class="menupagetitle">Log Format</div>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.3', '../skin/')" id="menu_1.3Title" class="menutitle">Integration</div>
+<div id="menu_1.3" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../papers/misc.html">Summary</a>
+</div>
+<div class="menuitem">
+<a title="" href="../binaries/HOWTO_CJDBC_Derby_v0.2.pdf">C-JDBC (PDF)</a>
+</div>
+<div class="menuitem">
+<a title="" href="../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
+</div>
+<div class="menuitem">
+<a title="" href="../DOTS_Derby.html">DOTS</a>
+</div>
+<div class="menuitem">
+<a title="" href="../papers/derby_plugin.html">Eclipse</a>
+</div>
+<div class="menuitem">
+<a title="" href="../binaries/DerbyAndRedHatAppServer.pdf">JOnAS (PDF)</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.4', '../skin/')" id="menu_1.4Title" class="menutitle">Presentations</div>
+<div id="menu_1.4" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../papers/MiscPresentations.html">Colorado 2004</a>
+</div>
+<div class="menuitem">
+<a title="" href="../papers/ApacheConUs04.html">ApacheCon US '04</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.5', '../skin/')" id="menu_1.5Title" class="menutitle">How To's</div>
+<div id="menu_1.5" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../papers/fortune_tut.html">Embedded Tutorial</a>
+</div>
+</div>
+<div id="credit"></div>
+<div id="roundbottom">
+<img style="display: none" class="corner" height="15" width="15" alt="" src="../skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
+<!--+
+  |alternative credits
+  +-->
+</div>
+<!--+
+    |end Menu
+    +-->
+<!--+
+    |start content
+    +-->
+<div id="content">
+<div id="skinconf-txtlink"></div>
+<div class="trail">
+	        Font size: 
+	          &nbsp;<input value="Reset" class="resetfont" title="Reset text" onclick="ndeSetTextSize('reset'); return false;" type="button">      
+	          &nbsp;<input value="-a" class="smallerfont" title="Shrink text" onclick="ndeSetTextSize('decr'); return false;" type="button">
+	          &nbsp;<input value="+a" class="biggerfont" title="Enlarge text" onclick="ndeSetTextSize('incr'); return false;" type="button">
+</div>
+<h1>Derby Write Ahead Log Format</h1>
+<div class="abstract">This document describes the storage format of Derby Write Ahead Log. This is a work-in-progress derived from Javadoc comments 
+    and from explanations Mike Matrigali posted to the Derby lists. 
+    Please post questions, comments, and corrections to derby-dev@db.apache.org.
+    </div>
+<div id="minitoc-area">
+<ul class="minitoc">
+<li>
+<a href="#introduction"> Introduction </a>
+</li>
+<li>
+<a href="#%0A%09%09%09Format+of+Write+Ahead+Log%0A%09%09">
+			Format of Write Ahead Log
+		</a>
+<ul class="minitoc">
+<li>
+<a href="#Format+of+Log+Control+File">Format of Log Control File</a>
+</li>
+<li>
+<a href="#Format+of+the+log+file">Format of the log file</a>
+</li>
+<li>
+<a href="#Format+of+the+log+record+wrapper">Format of the log record wrapper</a>
+</li>
+<li>
+<a href="#The+format+of+a+log+record">The format of a log record</a>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+    
+<a name="N1000F"></a><a name="introduction"></a>
+<h2 class="boxed"> Introduction </h2>
+<div class="section">
+<p>
+        Derby implements the Write Ahead Log using a non-circular file system file.
+        At present, there is no support for incremental log backup or media recovery. 
+        Only crash recovery is supported.  
+		</p>
+<p>
+        The 'log' is a stream of log records.  The 'log' is implemented as
+        a series of numbered log files.  These numbered log files are logically
+        continuous so a transaction can have log records that span multiple log files.
+        A single log record cannot span more then one log file.  The log file number
+        is monotonically increasing.
+		</p>
+<p>
+        The log belongs to a log factory of a RawStore.  In the current implementation,
+        each RawStore only has one log factory, so each RawStore only has one log
+        (which composed of multiple log files).
+        At any given time, a log factory only writes new log records to one log file,
+        this log file is called the 'current log file'.
+		</p>
+<p>
+        A log file is named log<em>logNumber</em>.dat
+		</p>
+<p>
+        Everytime a checkpoint is taken, a new log file is created and all subsequent
+        log records will go to the new log file.  After a checkpoint is taken, old
+        and useless log files will be deleted.
+		</p>
+<p>
+        RawStore exposes a checkpoint method which clients can call, or a checkpoint is
+        taken automatically by the RawStore when:
+		</p>
+<ol>
+	      
+<li> The log file grows beyond a certain size (configurable, default 100K bytes)</li>
+          
+<li> RawStore is shutdown and a checkpoint hasn't been done "for a while"</li>
+          
+<li> RawStore is recovered and a checkpoint hasn't been done "for a while"</li>
+          
+</ol>
+</div>
+	
+<a name="N10037"></a><a name="%0A%09%09%09Format+of+Write+Ahead+Log%0A%09%09"></a>
+<h2 class="boxed">
+			Format of Write Ahead Log
+		</h2>
+<div class="section">
+<p>
+	      An implementation of file based log is <span class="codefrag">org.apache.derby.impl.store.raw.log.LogToFile</span>.
+		This LogFactory is responsible for the formats of 2 kinds of file: the log
+		file and the log control file.  And it is responsible for the format of the
+		log record wrapper.
+		</p>
+<a name="N10043"></a><a name="Format+of+Log+Control+File"></a>
+<h3 class="boxed">Format of Log Control File</h3>
+<p>The log control file contains information about which log files
+			   are present and where the last checkpoint log record is located.</p>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+				
+<tr>
+					
+<th colspan="1" rowspan="1">Type</th>
+					<th colspan="1" rowspan="1">Desciption</th>
+				
+</tr>
+				
+<tr>
+					
+<td colspan="1" rowspan="1">int</td>
+					<td colspan="1" rowspan="1">format id set to FILE_STREAM_LOG_FILE</td>
+				
+</tr>
+				
+<tr>
+					
+<td colspan="1" rowspan="1">int</td>
+					<td colspan="1" rowspan="1">obsolete log file version</td>
+				
+</tr>
+				
+<tr>
+					
+<td colspan="1" rowspan="1">long</td>
+					<td colspan="1" rowspan="1">the log instant (LogCounter) of the last completed checkpoint</td>
+				
+</tr>
+				
+<tr>
+					
+<td colspan="1" rowspan="1">int</td>
+					<td colspan="1" rowspan="1">JBMS (older name for Cloudscape/Derby) version</td>
+				
+</tr>
+				
+<tr>
+					
+<td colspan="1" rowspan="1">int</td>
+					<td colspan="1" rowspan="1">checkpoint interval</td>
+				
+</tr>
+				
+<tr>
+					
+<td colspan="1" rowspan="1">long</td>
+					<td colspan="1" rowspan="1">spare (value set to 0)</td>
+				
+</tr>
+				
+<tr>
+					
+<td colspan="1" rowspan="1">long</td>
+					<td colspan="1" rowspan="1">spare (value set to 0)</td>
+				
+</tr>
+				
+<tr>
+					
+<td colspan="1" rowspan="1">long</td>
+					<td colspan="1" rowspan="1">spare (value set to 0)</td>
+				
+</tr>
+			
+</table>
+<a name="N100C5"></a><a name="Format+of+the+log+file"></a>
+<h3 class="boxed">Format of the log file</h3>
+<p>The log file contains log records which record all the changes
+		    	to the database.  The complete transaction log is composed of a series of
+		    	log files.</p>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+				
+<tr>
+					
+<th colspan="1" rowspan="1">Type</th>
+					<th colspan="1" rowspan="1">Description</th>
+				
+</tr>
+				
+<tr>
+					
+<td colspan="1" rowspan="1">int</td>
+					<td colspan="1" rowspan="1">Format id of this log file, set to FILE_STREAM_LOG_FILE.</td>
+				
+</tr>
+				
+<tr>
+					
+<td colspan="1" rowspan="1">int</td>
+					<td colspan="1" rowspan="1">Obsolete log file version - not used</td>
+				
+</tr>
+				
+<tr>
+					
+<td colspan="1" rowspan="1">long</td>
+					<td colspan="1" rowspan="1">Log file number - this number orders the log files in a
+						series to form the complete transaction log
+					</td>
+				
+</tr>		 
+				
+<tr>
+					
+<td colspan="1" rowspan="1">long</td>
+					<td colspan="1" rowspan="1">PrevLogRecord - log instant of the previous log record, in the
+	    				previous log file.</td>
+				
+</tr>
+				
+<tr>
+					
+<td colspan="1" rowspan="1">[log record wrapper]*</td>
+					<td colspan="1" rowspan="1">one or more log records with wrapper</td>
+				
+</tr>
+				
+<tr>
+					
+<td colspan="1" rowspan="1">int</td>
+					<td colspan="1" rowspan="1">EndMarker - value of zero.  The beginning of a log record wrapper
+						is the length of the log record, therefore it is never zero
+					</td>
+				
+</tr>
+				
+<tr>
+					
+<td colspan="1" rowspan="1">[int fuzzy end]*</td>
+					<td colspan="1" rowspan="1">zero or more int's of value 0, in case this log file
+					has been recovered and any incomplete log record set to zero.
+					</td>
+				
+</tr>
+			
+</table>
+<a name="N1013A"></a><a name="Format+of+the+log+record+wrapper"></a>
+<h3 class="boxed">Format of the log record wrapper</h3>
+<p>The log record wrapper provides information for the log scan.</p>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+				
+<tr>
+					
+<th colspan="1" rowspan="1">Type</th>
+					<th colspan="1" rowspan="1">Description</th>
+				
+</tr>
+				
+<tr>
+					
+<td colspan="1" rowspan="1">int</td>
+					<td colspan="1" rowspan="1">length - length of the log record (for forward scan)</td>
+				
+</tr>
+				
+<tr>
+					
+<td colspan="1" rowspan="1">long</td>
+					<td colspan="1" rowspan="1">instant - LogInstant of the log record</td>
+				
+</tr>
+				
+<tr>
+					
+<td colspan="1" rowspan="1">byte[length]</td>
+					<td colspan="1" rowspan="1">logRecord - byte array that is written by the FileLogger</td>
+				
+</tr>
+				
+<tr>
+					
+<td colspan="1" rowspan="1">int</td>
+					<td colspan="1" rowspan="1">length - length of the log record (for backward scan)</td>
+				
+</tr>
+			
+</table>
+<a name="N10188"></a><a name="The+format+of+a+log+record"></a>
+<h3 class="boxed">The format of a log record</h3>
+<p>The log record described every change to the persistent store</p>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+				
+<tr>
+					
+<th colspan="1" rowspan="1">Type</th>
+					<th colspan="1" rowspan="1">Description</th>
+				
+</tr>
+				
+<tr>
+					
+<td colspan="1" rowspan="1">int</td>
+					<td colspan="1" rowspan="1">format_id, set to LOG_RECORD. The formatId is written by FormatIdOutputStream 
+                                  when this object is	written out by writeObject
+					</td>
+				
+</tr>
+				
+<tr>
+					
+<td colspan="1" rowspan="1">CompressedInt</td>
+					<td colspan="1" rowspan="1">
+<p>loggable group - the loggable's group value.</p>
+						
+<p>	
+						Each loggable belongs to one or more groups of similar functionality.
+						</p>
+						
+<p>
+						Grouping is a way to quickly sort out log records that are interesting
+						to different modules or different implementations.
+						</p>
+						
+<p>
+						When a module makes loggable and sent it to the log file, it must mark
+						this loggable with one or more of the following group. 
+						If none fit, or if the loggable encompasses functionality that is not
+						described in existing groups, then a new group should be introduced.  
+						</p>
+						
+<p>
+						Grouping has no effect on how the record is logged or how it is treated
+						in rollback or recovery.
+						</p>
+						
+<p>
+						The following groups are defined. This list serves as the registry of
+						all loggable groups.
+						</p>
+						
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+							
+<caption>Loggable Groups</caption>
+							
+<tr>
+								
+<th colspan="1" rowspan="1">Name</th>
+								<th colspan="1" rowspan="1">Value</th>
+								<th colspan="1" rowspan="1">Description</th>
+							
+</tr>
+							
+<tr>
+								
+<td colspan="1" rowspan="1">FIRST</td>
+								<td colspan="1" rowspan="1">0x1</td>
+								<td colspan="1" rowspan="1">The first operation of a transaction.</td>
+							
+</tr>
+							
+<tr>
+								
+<td colspan="1" rowspan="1">LAST</td>
+								<td colspan="1" rowspan="1">0x2</td>
+								<td colspan="1" rowspan="1">The last operation of a transaction.</td>
+							
+</tr>
+							
+<tr>
+								
+<td colspan="1" rowspan="1">COMPENSATION</td>
+								<td colspan="1" rowspan="1">0x4</td>
+								<td colspan="1" rowspan="1">A compensation log record.</td>
+							
+</tr>
+							
+<tr>
+								
+<td colspan="1" rowspan="1">BI_LOG</td>
+								<td colspan="1" rowspan="1">0x8</td>
+								<td colspan="1" rowspan="1">A BeforeImage log record.</td>
+							
+</tr>	
+							
+<tr>
+								
+<td colspan="1" rowspan="1">COMMIT</td>
+								<td colspan="1" rowspan="1">0x10</td>
+								<td colspan="1" rowspan="1">The transaction committed.</td>
+							
+</tr>
+							
+<tr>
+								
+<td colspan="1" rowspan="1">ABORT</td>
+								<td colspan="1" rowspan="1">0x20</td>
+								<td colspan="1" rowspan="1">The transaction aborted.</td>
+							
+</tr>
+							
+<tr>
+								
+<td colspan="1" rowspan="1">PREPARE</td>
+								<td colspan="1" rowspan="1">0x40</td>
+								<td colspan="1" rowspan="1">The transaction prepared.</td>
+							
+</tr>
+							
+<tr>
+								
+<td colspan="1" rowspan="1">XA_NEEDLOCK</td>
+								<td colspan="1" rowspan="1">0x80</td>
+								<td colspan="1" rowspan="1">Need to reclaim locks associated with theis log record during XA prepared xact recovery.</td>
+							
+</tr>
+							
+<tr>
+								
+<td colspan="1" rowspan="1">RAWSTORE</td>
+								<td colspan="1" rowspan="1">0x100</td>
+								<td colspan="1" rowspan="1">A log record generated by the raw store.</td>
+							
+</tr>
+							
+<tr>
+								
+<td colspan="1" rowspan="1">FILE_RESOURCE</td>
+								<td colspan="1" rowspan="1">0x400</td>
+								<td colspan="1" rowspan="1">related to "non-transactional" files.</td>	
+							
+</tr>
+						
+</table>
+					
+</td>
+				
+</tr>
+				
+<tr>
+					
+<td colspan="1" rowspan="1">TransactionId</td>
+					<td colspan="1" rowspan="1">xactId - The Transaction this log belongs to.</td>
+				
+</tr>
+				
+<tr>
+					
+<td colspan="1" rowspan="1">Loggable</td>
+					<td colspan="1" rowspan="1">op - the log operation</td>
+				
+</tr>
+			
+</table>
+</div>
+  
+</div>
+<!--+
+    |end content
+    +-->
+<div class="clearboth">&nbsp;</div>
+</div>
+<div id="footer">
+<!--+
+    |start bottomstrip
+    +-->
+<div class="lastmodified">
+<script type="text/javascript"><!--
+document.write("Last Published: " + document.lastModified);
+//  --></script>
+</div>
+<div class="copyright">
+ Copyright &copy; 2004-2005 Apache Software Foundation</div>
+<div id="feedback">
+    Send feedback about the website to:
+  <a id="feedbackto" href="mailto:derby-dev@db.apache.org?subject=Feedback%C2%A0papers/logformats.html">derby-dev@db.apache.org</a>
+</div>
+<!--+
+    |end bottomstrip
+    +-->
+</div>
+</body>
+</html>

Modified: incubator/derby/site/trunk/build/site/papers/misc.html
URL: http://svn.apache.org/viewcvs/incubator/derby/site/trunk/build/site/papers/misc.html?view=diff&r1=149337&r2=149338
==============================================================================
--- incubator/derby/site/trunk/build/site/papers/misc.html (original)
+++ incubator/derby/site/trunk/build/site/papers/misc.html Mon Jan 31 17:03:28 2005
@@ -125,6 +125,9 @@
 <div class="menuitem">
 <a title="" href="../papers/JDBCImplementation.html">JDBC</a>
 </div>
+<div class="menuitem">
+<a title="" href="../papers/logformats.html">Log Format</a>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_selected_1.3', '../skin/')" id="menu_selected_1.3Title" class="menutitle" style="background-image: url('../skin/images/chapter_open.gif');">Integration</div>
 <div id="menu_selected_1.3" class="selectedmenuitemgroup" style="display: block;">

Modified: incubator/derby/site/trunk/build/site/papers/pageformats.html
URL: http://svn.apache.org/viewcvs/incubator/derby/site/trunk/build/site/papers/pageformats.html?view=diff&r1=149337&r2=149338
==============================================================================
--- incubator/derby/site/trunk/build/site/papers/pageformats.html (original)
+++ incubator/derby/site/trunk/build/site/papers/pageformats.html Mon Jan 31 17:03:28 2005
@@ -125,6 +125,9 @@
 <div class="menuitem">
 <a title="" href="../papers/JDBCImplementation.html">JDBC</a>
 </div>
+<div class="menuitem">
+<a title="" href="../papers/logformats.html">Log Format</a>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_1.3', '../skin/')" id="menu_1.3Title" class="menutitle">Integration</div>
 <div id="menu_1.3" class="menuitemgroup">

Modified: incubator/derby/site/trunk/src/documentation/content/xdocs/papers/index.xml
URL: http://svn.apache.org/viewcvs/incubator/derby/site/trunk/src/documentation/content/xdocs/papers/index.xml?view=diff&r1=149337&r2=149338
==============================================================================
--- incubator/derby/site/trunk/src/documentation/content/xdocs/papers/index.xml (original)
+++ incubator/derby/site/trunk/src/documentation/content/xdocs/papers/index.xml Mon Jan 31 17:03:28 2005
@@ -22,6 +22,7 @@
         <li><a href="derby_htw.html">How Things Work</a> </li> 
 	<li>JDBC: <a href="JDBCImplementation.html">Derby JDBC Implementation
 		Notes</a></li>
+	<li>Log Format: <a href="logformats.html">Derby Write Ahead Log Format</a></li>
 </ul>
 
 </section>

Added: incubator/derby/site/trunk/src/documentation/content/xdocs/papers/logformats.xml
URL: http://svn.apache.org/viewcvs/incubator/derby/site/trunk/src/documentation/content/xdocs/papers/logformats.xml?view=auto&rev=149338
==============================================================================
--- incubator/derby/site/trunk/src/documentation/content/xdocs/papers/logformats.xml (added)
+++ incubator/derby/site/trunk/src/documentation/content/xdocs/papers/logformats.xml Mon Jan 31 17:03:28 2005
@@ -0,0 +1,293 @@
+<?xml version="1.0"?>
+<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
+<document> 
+  <header> 
+    <title>Derby Write Ahead Log Format</title>
+    <abstract>This document describes the storage format of Derby Write Ahead Log. This is a work-in-progress derived from Javadoc comments 
+    and from explanations Mike Matrigali posted to the Derby lists. 
+    Please post questions, comments, and corrections to derby-dev@db.apache.org.
+    </abstract>
+  </header>
+  <body>
+    <section id="introduction"> 
+      <title> Introduction </title>
+	    <p>
+        Derby implements the Write Ahead Log using a non-circular file system file.
+        At present, there is no support for incremental log backup or media recovery. 
+        Only crash recovery is supported.  
+		</p>
+        <p>
+        The 'log' is a stream of log records.  The 'log' is implemented as
+        a series of numbered log files.  These numbered log files are logically
+        continuous so a transaction can have log records that span multiple log files.
+        A single log record cannot span more then one log file.  The log file number
+        is monotonically increasing.
+		</p>
+        <p>
+        The log belongs to a log factory of a RawStore.  In the current implementation,
+        each RawStore only has one log factory, so each RawStore only has one log
+        (which composed of multiple log files).
+        At any given time, a log factory only writes new log records to one log file,
+        this log file is called the 'current log file'.
+		</p>
+		<p>
+        A log file is named log<em>logNumber</em>.dat
+		</p>
+        <p>
+        Everytime a checkpoint is taken, a new log file is created and all subsequent
+        log records will go to the new log file.  After a checkpoint is taken, old
+        and useless log files will be deleted.
+		</p>
+        <p>
+        RawStore exposes a checkpoint method which clients can call, or a checkpoint is
+        taken automatically by the RawStore when:
+		</p>
+	      <ol>
+	      <li> The log file grows beyond a certain size (configurable, default 100K bytes)</li>
+          <li> RawStore is shutdown and a checkpoint hasn't been done "for a while"</li>
+          <li> RawStore is recovered and a checkpoint hasn't been done "for a while"</li>
+          </ol>
+    </section>
+	<section>
+		<title>
+			Format of Write Ahead Log
+		</title>
+		<p>
+	      An implementation of file based log is <code>org.apache.derby.impl.store.raw.log.LogToFile</code>.
+		This LogFactory is responsible for the formats of 2 kinds of file: the log
+		file and the log control file.  And it is responsible for the format of the
+		log record wrapper.
+		</p>
+		<section>
+			<title>Format of Log Control File</title>
+			<p>The log control file contains information about which log files
+			   are present and where the last checkpoint log record is located.</p>
+			<table>
+				<tr>
+					<th>Type</th>
+					<th>Desciption</th>
+				</tr>
+				<tr>
+					<td>int</td>
+					<td>format id set to FILE_STREAM_LOG_FILE</td>
+				</tr>
+				<tr>
+					<td>int</td>
+					<td>obsolete log file version</td>
+				</tr>
+				<tr>
+					<td>long</td>
+					<td>the log instant (LogCounter) of the last completed checkpoint</td>
+				</tr>
+				<tr>
+					<td>int</td>
+					<td>JBMS (older name for Cloudscape/Derby) version</td>
+				</tr>
+				<tr>
+					<td>int</td>
+					<td>checkpoint interval</td>
+				</tr>
+				<tr>
+					<td>long</td>
+					<td>spare (value set to 0)</td>
+				</tr>
+				<tr>
+					<td>long</td>
+					<td>spare (value set to 0)</td>
+				</tr>
+				<tr>
+					<td>long</td>
+					<td>spare (value set to 0)</td>
+				</tr>
+			</table>
+		</section>
+		<section>
+			<title>Format of the log file</title>
+			<p>The log file contains log records which record all the changes
+		    	to the database.  The complete transaction log is composed of a series of
+		    	log files.</p>
+			<table>
+				<tr>
+					<th>Type</th>
+					<th>Description</th>
+				</tr>
+				<tr>
+					<td>int</td>
+					<td>Format id of this log file, set to FILE_STREAM_LOG_FILE.</td>
+				</tr>
+				<tr>
+					<td>int</td>
+					<td>Obsolete log file version - not used</td>
+				</tr>
+				<tr>
+					<td>long</td>
+					<td>Log file number - this number orders the log files in a
+						series to form the complete transaction log
+					</td>
+				</tr>		 
+				<tr>
+					<td>long</td>
+					<td>PrevLogRecord - log instant of the previous log record, in the
+	    				previous log file.</td>
+				</tr>
+				<tr>
+					<td>[log record wrapper]*</td>
+					<td>one or more log records with wrapper</td>
+				</tr>
+				<tr>
+					<td>int</td>
+					<td>EndMarker - value of zero.  The beginning of a log record wrapper
+						is the length of the log record, therefore it is never zero
+					</td>
+				</tr>
+				<tr>
+					<td>[int fuzzy end]*</td>
+					<td>zero or more int's of value 0, in case this log file
+					has been recovered and any incomplete log record set to zero.
+					</td>
+				</tr>
+			</table>
+		</section>
+		<section>
+			<title>Format of the log record wrapper</title>
+			<p>The log record wrapper provides information for the log scan.</p>
+			<table>
+				<tr>
+					<th>Type</th>
+					<th>Description</th>
+				</tr>
+				<tr>
+					<td>int</td>
+					<td>length - length of the log record (for forward scan)</td>
+				</tr>
+				<tr>
+					<td>long</td>
+					<td>instant - LogInstant of the log record</td>
+				</tr>
+				<tr>
+					<td>byte[length]</td>
+					<td>logRecord - byte array that is written by the FileLogger</td>
+				</tr>
+				<tr>
+					<td>int</td>
+					<td>length - length of the log record (for backward scan)</td>
+				</tr>
+			</table>
+		</section>
+		<section>
+			<title>The format of a log record</title>
+			<p>The log record described every change to the persistent store</p>
+			<table>
+				<tr>
+					<th>Type</th>
+					<th>Description</th>
+				</tr>
+				<tr>
+					<td>int</td>
+					<td>format_id, set to LOG_RECORD. The formatId is written by FormatIdOutputStream 
+                                  when this object is	written out by writeObject
+					</td>
+				</tr>
+				<tr>
+					<td>CompressedInt</td>
+					<td><p>loggable group - the loggable's group value.</p>
+						<p>	
+						Each loggable belongs to one or more groups of similar functionality.
+						</p>
+						<p>
+						Grouping is a way to quickly sort out log records that are interesting
+						to different modules or different implementations.
+						</p>
+						<p>
+						When a module makes loggable and sent it to the log file, it must mark
+						this loggable with one or more of the following group. 
+						If none fit, or if the loggable encompasses functionality that is not
+						described in existing groups, then a new group should be introduced.  
+						</p>
+						<p>
+						Grouping has no effect on how the record is logged or how it is treated
+						in rollback or recovery.
+						</p>
+						<p>
+						The following groups are defined. This list serves as the registry of
+						all loggable groups.
+						</p>
+						<table>
+							<caption>Loggable Groups</caption>
+							<tr>
+								<th>Name</th>
+								<th>Value</th>
+								<th>Description</th>
+							</tr>
+							<tr>
+								<td>FIRST</td>
+								<td>0x1</td>
+								<td>The first operation of a transaction.</td>
+							</tr>
+							<tr>
+								<td>LAST</td>
+								<td>0x2</td>
+								<td>The last operation of a transaction.</td>
+							</tr>
+							<tr>
+								<td>COMPENSATION</td>
+								<td>0x4</td>
+								<td>A compensation log record.</td>
+							</tr>
+							<tr>
+								<td>BI_LOG</td>
+								<td>0x8</td>
+								<td>A BeforeImage log record.</td>
+							</tr>	
+							<tr>
+								<td>COMMIT</td>
+								<td>0x10</td>
+								<td>The transaction committed.</td>
+							</tr>
+							<tr>
+								<td>ABORT</td>
+								<td>0x20</td>
+								<td>The transaction aborted.</td>
+							</tr>
+							<tr>
+								<td>PREPARE</td>
+								<td>0x40</td>
+								<td>The transaction prepared.</td>
+							</tr>
+							<tr>
+								<td>XA_NEEDLOCK</td>
+								<td>0x80</td>
+								<td>Need to reclaim locks associated with theis log record during XA prepared xact recovery.</td>
+							</tr>
+							<tr>
+								<td>RAWSTORE</td>
+								<td>0x100</td>
+								<td>A log record generated by the raw store.</td>
+							</tr>
+							<tr>
+								<td>FILE_RESOURCE</td>
+								<td>0x400</td>
+								<td>related to "non-transactional" files.</td>	
+							</tr>
+						</table>
+					</td>
+				</tr>
+				<tr>
+					<td>TransactionId</td>
+					<td>xactId - The Transaction this log belongs to.</td>
+				</tr>
+				<tr>
+					<td>Loggable</td>
+					<td>op - the log operation</td>
+				</tr>
+			</table>
+		</section>
+	</section>
+  </body>
+  <footer> 
+	<legal>
+	</legal>
+  </footer>
+</document>
+
+

Modified: incubator/derby/site/trunk/src/documentation/content/xdocs/site.xml
URL: http://svn.apache.org/viewcvs/incubator/derby/site/trunk/src/documentation/content/xdocs/site.xml?view=diff&r1=149337&r2=149338
==============================================================================
--- incubator/derby/site/trunk/src/documentation/content/xdocs/site.xml (original)
+++ incubator/derby/site/trunk/src/documentation/content/xdocs/site.xml Mon Jan 31 17:03:28 2005
@@ -25,10 +25,11 @@
   </papers>
 
   <engine label="Derby Engine" href="papers/" tab="papers">
-      <index label="Architecture"  href="derby_arch.html"/>
+      <index   label="Architecture"     href="derby_arch.html"/>
       <pformat label="Disk Page Format" href="pageformats.html"/>
-      <misc  label="How Things Work" href="derby_htw.html"/>
-      <jdbc  label="JDBC"  href="JDBCImplementation.html"/>
+      <misc    label="How Things Work"  href="derby_htw.html"/>
+      <jdbc    label="JDBC"             href="JDBCImplementation.html"/>
+      <log     label="Log Format"       href="logformats.html"/>
   </engine>
 
   <how_to label="Integration" href="papers/" tab="papers">



Mime
View raw message