Published site at 405bf5e6383a09f435baadbac6c389e9f6c43ac6.
authorjenkins <builds@apache.org>
Tue, 20 Nov 2018 14:52:40 +0000 (14:52 +0000)
committerjenkins <builds@apache.org>
Tue, 20 Nov 2018 14:52:40 +0000 (14:52 +0000)
74 files changed:
acid-semantics.html
apache_hbase_reference_guide.pdf
book.html
bulk-loads.html
checkstyle-aggregate.html
checkstyle.rss
coc.html
dependencies.html
dependency-convergence.html
dependency-info.html
dependency-management.html
devapidocs/constant-values.html
devapidocs/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html
devapidocs/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.html
devapidocs/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html
devapidocs/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html
devapidocs/src-html/org/apache/hadoop/hbase/Version.html
devapidocs/src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.DeleteState.html
devapidocs/src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html
devapidocs/src-html/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.InvalidWALDataException.html
devapidocs/src-html/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.Loader.html
devapidocs/src-html/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.html
devapidocs/src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.LeaseRecovery.html
devapidocs/src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html
devapidocs/src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.SyncMetrics.html
devapidocs/src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html
downloads.html
export_control.html
index.html
integration.html
issue-tracking.html
license.html
mail-lists.html
metrics.html
old_news.html
plugin-management.html
plugins.html
poweredbyhbase.html
project-info.html
project-reports.html
project-summary.html
pseudo-distributed.html
replication.html
resources.html
source-repository.html
sponsors.html
supportingprojects.html
team-list.html
testdevapidocs/allclasses-frame.html
testdevapidocs/allclasses-noframe.html
testdevapidocs/index-all.html
testdevapidocs/org/apache/hadoop/hbase/backup/package-tree.html
testdevapidocs/org/apache/hadoop/hbase/class-use/HBaseClassTestRule.html
testdevapidocs/org/apache/hadoop/hbase/class-use/HBaseTestingUtility.html
testdevapidocs/org/apache/hadoop/hbase/io/hfile/package-tree.html
testdevapidocs/org/apache/hadoop/hbase/master/TestHMasterRPCException.html
testdevapidocs/org/apache/hadoop/hbase/master/TestLoadProcedureError.TestProcedure.html [new file with mode: 0644]
testdevapidocs/org/apache/hadoop/hbase/master/TestLoadProcedureError.html [new file with mode: 0644]
testdevapidocs/org/apache/hadoop/hbase/master/TestMaster.html
testdevapidocs/org/apache/hadoop/hbase/master/class-use/TestLoadProcedureError.TestProcedure.html [new file with mode: 0644]
testdevapidocs/org/apache/hadoop/hbase/master/class-use/TestLoadProcedureError.html [new file with mode: 0644]
testdevapidocs/org/apache/hadoop/hbase/master/package-frame.html
testdevapidocs/org/apache/hadoop/hbase/master/package-summary.html
testdevapidocs/org/apache/hadoop/hbase/master/package-tree.html
testdevapidocs/org/apache/hadoop/hbase/package-tree.html
testdevapidocs/org/apache/hadoop/hbase/procedure/package-tree.html
testdevapidocs/org/apache/hadoop/hbase/procedure2/ProcedureTestingUtility.NoopProcedure.html
testdevapidocs/org/apache/hadoop/hbase/procedure2/class-use/ProcedureTestingUtility.NoopProcedure.html
testdevapidocs/org/apache/hadoop/hbase/procedure2/package-tree.html
testdevapidocs/org/apache/hadoop/hbase/procedure2/package-use.html
testdevapidocs/org/apache/hadoop/hbase/regionserver/package-tree.html
testdevapidocs/overview-tree.html
testdevapidocs/src-html/org/apache/hadoop/hbase/master/TestLoadProcedureError.TestProcedure.html [new file with mode: 0644]
testdevapidocs/src-html/org/apache/hadoop/hbase/master/TestLoadProcedureError.html [new file with mode: 0644]

index 7a8622e..5bf6014 100644 (file)
@@ -7,7 +7,7 @@
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20181119" />
+    <meta name="Date-Revision-yyyymmdd" content="20181120" />
     <meta http-equiv="Content-Language" content="en" />
     <title>Apache HBase &#x2013;  
       Apache HBase (TM) ACID Properties
@@ -611,7 +611,7 @@ under the License. -->
                         <a href="https://www.apache.org/">The Apache Software Foundation</a>.
             All rights reserved.      
                     
-                  <li id="publishDate" class="pull-right">Last Published: 2018-11-19</li>
+                  <li id="publishDate" class="pull-right">Last Published: 2018-11-20</li>
             </p>
                 </div>
 
index 7afef34..2665718 100644 (file)
@@ -5,8 +5,8 @@
 /Author (Apache HBase Team)
 /Creator (Asciidoctor PDF 1.5.0.alpha.15, based on Prawn 2.2.2)
 /Producer (Apache HBase Team)
-/ModDate (D:20181119143337+00'00')
-/CreationDate (D:20181119145001+00'00')
+/ModDate (D:20181120143320+00'00')
+/CreationDate (D:20181120144912+00'00')
 >>
 endobj
 2 0 obj
index 3733931..7e3cdf8 100644 (file)
--- a/book.html
+++ b/book.html
@@ -41318,7 +41318,7 @@ org/apache/hadoop/hbase/security/access/AccessControlClient.revoke:(Lorg/apache/
 <div id="footer">
 <div id="footer-text">
 Version 3.0.0-SNAPSHOT<br>
-Last updated 2018-11-19 14:33:37 UTC
+Last updated 2018-11-20 14:33:20 UTC
 </div>
 </div>
 </body>
index 960fdc4..e1b2c16 100644 (file)
@@ -7,7 +7,7 @@
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20181119" />
+    <meta name="Date-Revision-yyyymmdd" content="20181120" />
     <meta http-equiv="Content-Language" content="en" />
     <title>Apache HBase &#x2013;  
       Bulk Loads in Apache HBase (TM)
@@ -316,7 +316,7 @@ under the License. -->
                         <a href="https://www.apache.org/">The Apache Software Foundation</a>.
             All rights reserved.      
                     
-                  <li id="publishDate" class="pull-right">Last Published: 2018-11-19</li>
+                  <li id="publishDate" class="pull-right">Last Published: 2018-11-20</li>
             </p>
                 </div>
 
index e99da79..deaf0b6 100644 (file)
@@ -7,7 +7,7 @@
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20181119" />
+    <meta name="Date-Revision-yyyymmdd" content="20181120" />
     <meta http-equiv="Content-Language" content="en" />
     <title>Apache HBase &#x2013; Checkstyle Results</title>
     <link rel="stylesheet" href="./css/apache-maven-fluido-1.4-HBase.min.css" />
 <th><img src="images/icon_warning_sml.gif" alt="" />&#160;Warnings</th>
 <th><img src="images/icon_error_sml.gif" alt="" />&#160;Errors</th></tr>
 <tr class="b">
-<td>3811</td>
+<td>3812</td>
 <td>0</td>
 <td>0</td>
 <td>14996</td></tr></table></div>
 <td><a class="externalLink" href="http://checkstyle.sourceforge.net/config_javadoc.html#JavadocTagContinuationIndentation">JavadocTagContinuationIndentation</a>
 <ul>
 <li>offset: <tt>&quot;2&quot;</tt></li></ul></td>
-<td>731</td>
+<td>730</td>
 <td><img src="images/icon_error_sml.gif" alt="" />&#160;Error</td></tr>
 <tr class="b">
 <td></td>
 <td><a class="externalLink" href="http://checkstyle.sourceforge.net/config_javadoc.html#NonEmptyAtclauseDescription">NonEmptyAtclauseDescription</a></td>
-<td>3452</td>
+<td>3453</td>
 <td><img src="images/icon_error_sml.gif" alt="" />&#160;Error</td></tr>
 <tr class="a">
 <td>misc</td>
 <tr class="b">
 <td><img src="images/icon_error_sml.gif" alt="" />&#160;Error</td>
 <td>javadoc</td>
-<td>JavadocTagContinuationIndentation</td>
+<td>NonEmptyAtclauseDescription</td>
 <td>Javadoc comment at column 0 has parse error. Details: no viable alternative at input '   *' while parsing JAVADOC_TAG</td>
 <td>117</td></tr>
 <tr class="a">
 <td>blocks</td>
 <td>NeedBraces</td>
 <td>'if' construct must use '{}'s.</td>
-<td>656</td></tr>
+<td>662</td></tr>
 <tr class="a">
 <td><img src="images/icon_error_sml.gif" alt="" />&#160;Error</td>
 <td>blocks</td>
 <td>NeedBraces</td>
 <td>'if' construct must use '{}'s.</td>
-<td>943</td></tr>
+<td>949</td></tr>
 <tr class="b">
 <td><img src="images/icon_error_sml.gif" alt="" />&#160;Error</td>
 <td>indentation</td>
 <td>Indentation</td>
 <td>'if' child has incorrect indentation level 8, expected level should be 6.</td>
-<td>1081</td></tr></table></div>
+<td>1087</td></tr></table></div>
 <div class="section">
 <h3 id="org.apache.hadoop.hbase.procedure2.util.DelayedUtil.java">org/apache/hadoop/hbase/procedure2/util/DelayedUtil.java</h3>
 <table border="0" class="table table-striped">
                         <a href="https://www.apache.org/">The Apache Software Foundation</a>.
             All rights reserved.      
                     
-                  <li id="publishDate" class="pull-right">Last Published: 2018-11-19</li>
+                  <li id="publishDate" class="pull-right">Last Published: 2018-11-20</li>
             </p>
                 </div>
 
index ced5768..bbe0bd1 100644 (file)
@@ -25,7 +25,7 @@ under the License.
     <language>en-us</language>
     <copyright>&#169;2007 - 2018 The Apache Software Foundation</copyright>
     <item>
-      <title>File: 3811,
+      <title>File: 3812,
              Errors: 14996,
              Warnings: 0,
              Infos: 0
@@ -29922,6 +29922,20 @@ under the License.
               </tr>
                           <tr>
                 <td>
+                  <a href="http://hbase.apache.org/checkstyle.html#org.apache.hadoop.hbase.master.TestLoadProcedureError.java">org/apache/hadoop/hbase/master/TestLoadProcedureError.java</a>
+                </td>
+                <td>
+                  0
+                </td>
+                <td>
+                  0
+                </td>
+                <td>
+                  0
+                </td>
+              </tr>
+                          <tr>
+                <td>
                   <a href="http://hbase.apache.org/checkstyle.html#org.apache.hadoop.hbase.regionserver.TestRegionReplicasWithRestartScenarios.java">org/apache/hadoop/hbase/regionserver/TestRegionReplicasWithRestartScenarios.java</a>
                 </td>
                 <td>
index 1e8c313..2cf874b 100644 (file)
--- a/coc.html
+++ b/coc.html
@@ -7,7 +7,7 @@
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20181119" />
+    <meta name="Date-Revision-yyyymmdd" content="20181120" />
     <meta http-equiv="Content-Language" content="en" />
     <title>Apache HBase &#x2013; 
       Code of Conduct Policy
@@ -385,7 +385,7 @@ email to <a class="externalLink" href="mailto:private@hbase.apache.org">the priv
                         <a href="https://www.apache.org/">The Apache Software Foundation</a>.
             All rights reserved.      
                     
-                  <li id="publishDate" class="pull-right">Last Published: 2018-11-19</li>
+                  <li id="publishDate" class="pull-right">Last Published: 2018-11-20</li>
             </p>
                 </div>
 
index e3a5cce..da88b26 100644 (file)
@@ -7,7 +7,7 @@
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20181119" />
+    <meta name="Date-Revision-yyyymmdd" content="20181120" />
     <meta http-equiv="Content-Language" content="en" />
     <title>Apache HBase &#x2013; Project Dependencies</title>
     <link rel="stylesheet" href="./css/apache-maven-fluido-1.4-HBase.min.css" />
                         <a href="https://www.apache.org/">The Apache Software Foundation</a>.
             All rights reserved.      
                     
-                  <li id="publishDate" class="pull-right">Last Published: 2018-11-19</li>
+                  <li id="publishDate" class="pull-right">Last Published: 2018-11-20</li>
             </p>
                 </div>
 
index 7ac84d2..ea3ce81 100644 (file)
@@ -7,7 +7,7 @@
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20181119" />
+    <meta name="Date-Revision-yyyymmdd" content="20181120" />
     <meta http-equiv="Content-Language" content="en" />
     <title>Apache HBase &#x2013; Reactor Dependency Convergence</title>
     <link rel="stylesheet" href="./css/apache-maven-fluido-1.4-HBase.min.css" />
                         <a href="https://www.apache.org/">The Apache Software Foundation</a>.
             All rights reserved.      
                     
-                  <li id="publishDate" class="pull-right">Last Published: 2018-11-19</li>
+                  <li id="publishDate" class="pull-right">Last Published: 2018-11-20</li>
             </p>
                 </div>
 
index 15b6964..e40faa7 100644 (file)
@@ -7,7 +7,7 @@
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20181119" />
+    <meta name="Date-Revision-yyyymmdd" content="20181120" />
     <meta http-equiv="Content-Language" content="en" />
     <title>Apache HBase &#x2013; Dependency Information</title>
     <link rel="stylesheet" href="./css/apache-maven-fluido-1.4-HBase.min.css" />
                         <a href="https://www.apache.org/">The Apache Software Foundation</a>.
             All rights reserved.      
                     
-                  <li id="publishDate" class="pull-right">Last Published: 2018-11-19</li>
+                  <li id="publishDate" class="pull-right">Last Published: 2018-11-20</li>
             </p>
                 </div>
 
index c3d4a8c..f5ddf99 100644 (file)
@@ -7,7 +7,7 @@
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20181119" />
+    <meta name="Date-Revision-yyyymmdd" content="20181120" />
     <meta http-equiv="Content-Language" content="en" />
     <title>Apache HBase &#x2013; Project Dependency Management</title>
     <link rel="stylesheet" href="./css/apache-maven-fluido-1.4-HBase.min.css" />
                         <a href="https://www.apache.org/">The Apache Software Foundation</a>.
             All rights reserved.      
                     
-                  <li id="publishDate" class="pull-right">Last Published: 2018-11-19</li>
+                  <li id="publishDate" class="pull-right">Last Published: 2018-11-20</li>
             </p>
                 </div>
 
index fe24cdf..b5207a8 100644 (file)
 <!--   -->
 </a><code>public&nbsp;static&nbsp;final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
 <td><code><a href="org/apache/hadoop/hbase/Version.html#date">date</a></code></td>
-<td class="colLast"><code>"Mon Nov 19 14:44:53 UTC 2018"</code></td>
+<td class="colLast"><code>"Tue Nov 20 14:44:19 UTC 2018"</code></td>
 </tr>
 <tr class="rowColor">
 <td class="colFirst"><a name="org.apache.hadoop.hbase.Version.revision">
 <!--   -->
 </a><code>public&nbsp;static&nbsp;final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
 <td><code><a href="org/apache/hadoop/hbase/Version.html#srcChecksum">srcChecksum</a></code></td>
-<td class="colLast"><code>"354946859721123895ba2f38486ee8a8"</code></td>
+<td class="colLast"><code>"05b800e0fa4b560f4e9c387e4d35888d"</code></td>
 </tr>
 <tr class="rowColor">
 <td class="colFirst"><a name="org.apache.hadoop.hbase.Version.url">
index 04f9053..eddd906 100644 (file)
@@ -777,7 +777,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>isModified</h4>
-<pre>public&nbsp;boolean&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.280">isModified</a>(long&nbsp;procId)</pre>
+<pre>public&nbsp;boolean&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.281">isModified</a>(long&nbsp;procId)</pre>
 </li>
 </ul>
 <a name="isDeleted-long-">
@@ -786,7 +786,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>isDeleted</h4>
-<pre>public&nbsp;<a href="../../../../../../org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.DeleteState.html" title="enum in org.apache.hadoop.hbase.procedure2.store">ProcedureStoreTracker.DeleteState</a>&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.293">isDeleted</a>(long&nbsp;procId)</pre>
+<pre>public&nbsp;<a href="../../../../../../org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.DeleteState.html" title="enum in org.apache.hadoop.hbase.procedure2.store">ProcedureStoreTracker.DeleteState</a>&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.294">isDeleted</a>(long&nbsp;procId)</pre>
 <div class="block">If <a href="../../../../../../org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#partial"><code>partial</code></a> is false, returns state from the bitmap. If no state is found for
  <code>procId</code>, returns YES.
  If partial is true, tracker doesn't have complete view of system state, so it returns MAYBE
@@ -800,7 +800,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>getActiveMinProcId</h4>
-<pre>public&nbsp;long&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.303">getActiveMinProcId</a>()</pre>
+<pre>public&nbsp;long&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.304">getActiveMinProcId</a>()</pre>
 </li>
 </ul>
 <a name="setKeepDeletes-boolean-">
@@ -809,7 +809,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>setKeepDeletes</h4>
-<pre>public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.308">setKeepDeletes</a>(boolean&nbsp;keepDeletes)</pre>
+<pre>public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.309">setKeepDeletes</a>(boolean&nbsp;keepDeletes)</pre>
 </li>
 </ul>
 <a name="isPartial--">
@@ -818,7 +818,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>isPartial</h4>
-<pre>public&nbsp;boolean&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.323">isPartial</a>()</pre>
+<pre>public&nbsp;boolean&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.324">isPartial</a>()</pre>
 </li>
 </ul>
 <a name="setPartialFlag-boolean-">
@@ -827,7 +827,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>setPartialFlag</h4>
-<pre>public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.327">setPartialFlag</a>(boolean&nbsp;isPartial)</pre>
+<pre>public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.328">setPartialFlag</a>(boolean&nbsp;isPartial)</pre>
 </li>
 </ul>
 <a name="isEmpty--">
@@ -836,7 +836,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>isEmpty</h4>
-<pre>public&nbsp;boolean&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.339">isEmpty</a>()</pre>
+<pre>public&nbsp;boolean&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.340">isEmpty</a>()</pre>
 <dl>
 <dt><span class="returnLabel">Returns:</span></dt>
 <dd>true, if no procedure is active, else false.</dd>
@@ -849,7 +849,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>isAllModified</h4>
-<pre>public&nbsp;boolean&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.352">isAllModified</a>()</pre>
+<pre>public&nbsp;boolean&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.353">isAllModified</a>()</pre>
 <dl>
 <dt><span class="returnLabel">Returns:</span></dt>
 <dd>true if all procedure was modified or deleted since last call to
@@ -863,7 +863,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>getAllActiveProcIds</h4>
-<pre>public&nbsp;long[]&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.366">getAllActiveProcIds</a>()</pre>
+<pre>public&nbsp;long[]&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.367">getAllActiveProcIds</a>()</pre>
 <div class="block">Will be used when there are too many proc wal files. We will rewrite the states of the active
  procedures in the oldest proc wal file so that we can delete it.</div>
 <dl>
@@ -878,7 +878,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>resetModified</h4>
-<pre>public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.375">resetModified</a>()</pre>
+<pre>public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.376">resetModified</a>()</pre>
 <div class="block">Clears the list of updated procedure ids. This doesn't affect global list of active
  procedure ids.</div>
 </li>
@@ -889,7 +889,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>getOrCreateNode</h4>
-<pre>private&nbsp;<a href="../../../../../../org/apache/hadoop/hbase/procedure2/store/BitSetNode.html" title="class in org.apache.hadoop.hbase.procedure2.store">BitSetNode</a>&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.383">getOrCreateNode</a>(long&nbsp;procId)</pre>
+<pre>private&nbsp;<a href="../../../../../../org/apache/hadoop/hbase/procedure2/store/BitSetNode.html" title="class in org.apache.hadoop.hbase.procedure2.store">BitSetNode</a>&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.384">getOrCreateNode</a>(long&nbsp;procId)</pre>
 </li>
 </ul>
 <a name="growNode-org.apache.hadoop.hbase.procedure2.store.BitSetNode-long-">
@@ -898,7 +898,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>growNode</h4>
-<pre>private&nbsp;<a href="../../../../../../org/apache/hadoop/hbase/procedure2/store/BitSetNode.html" title="class in org.apache.hadoop.hbase.procedure2.store">BitSetNode</a>&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.439">growNode</a>(<a href="../../../../../../org/apache/hadoop/hbase/procedure2/store/BitSetNode.html" title="class in org.apache.hadoop.hbase.procedure2.store">BitSetNode</a>&nbsp;node,
+<pre>private&nbsp;<a href="../../../../../../org/apache/hadoop/hbase/procedure2/store/BitSetNode.html" title="class in org.apache.hadoop.hbase.procedure2.store">BitSetNode</a>&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.440">growNode</a>(<a href="../../../../../../org/apache/hadoop/hbase/procedure2/store/BitSetNode.html" title="class in org.apache.hadoop.hbase.procedure2.store">BitSetNode</a>&nbsp;node,
                             long&nbsp;procId)</pre>
 <div class="block">Grows <code>node</code> to contain <code>procId</code> and updates the map.</div>
 <dl>
@@ -913,7 +913,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>mergeNodes</h4>
-<pre>private&nbsp;<a href="../../../../../../org/apache/hadoop/hbase/procedure2/store/BitSetNode.html" title="class in org.apache.hadoop.hbase.procedure2.store">BitSetNode</a>&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.449">mergeNodes</a>(<a href="../../../../../../org/apache/hadoop/hbase/procedure2/store/BitSetNode.html" title="class in org.apache.hadoop.hbase.procedure2.store">BitSetNode</a>&nbsp;leftNode,
+<pre>private&nbsp;<a href="../../../../../../org/apache/hadoop/hbase/procedure2/store/BitSetNode.html" title="class in org.apache.hadoop.hbase.procedure2.store">BitSetNode</a>&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.450">mergeNodes</a>(<a href="../../../../../../org/apache/hadoop/hbase/procedure2/store/BitSetNode.html" title="class in org.apache.hadoop.hbase.procedure2.store">BitSetNode</a>&nbsp;leftNode,
                               <a href="../../../../../../org/apache/hadoop/hbase/procedure2/store/BitSetNode.html" title="class in org.apache.hadoop.hbase.procedure2.store">BitSetNode</a>&nbsp;rightNode)</pre>
 <div class="block">Merges <code>leftNode</code> & <code>rightNode</code> and updates the map.</div>
 </li>
@@ -924,7 +924,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>dump</h4>
-<pre>public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.456">dump</a>()</pre>
+<pre>public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.457">dump</a>()</pre>
 </li>
 </ul>
 <a name="toProto--">
@@ -933,7 +933,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockListLast">
 <li class="blockList">
 <h4>toProto</h4>
-<pre>public&nbsp;org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureStoreTracker&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.474">toProto</a>()
+<pre>public&nbsp;org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureStoreTracker&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html#line.475">toProto</a>()
                                                                                                 throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <div class="block">Builds
  org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.ProcedureStoreTracker
index 66fa7c4..3e90c3a 100644 (file)
@@ -452,7 +452,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>writeHeader</h4>
-<pre>public static&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.html#line.114">writeHeader</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a>&nbsp;stream,
+<pre>public static&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.html#line.111">writeHeader</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a>&nbsp;stream,
                                org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureWALHeader&nbsp;header)
                         throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <dl>
@@ -467,7 +467,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>writeTrailer</h4>
-<pre>public static&nbsp;long&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.html#line.134">writeTrailer</a>(org.apache.hadoop.fs.FSDataOutputStream&nbsp;stream,
+<pre>public static&nbsp;long&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.html#line.131">writeTrailer</a>(org.apache.hadoop.fs.FSDataOutputStream&nbsp;stream,
                                 <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.html" title="class in org.apache.hadoop.hbase.procedure2.store">ProcedureStoreTracker</a>&nbsp;tracker)
                          throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <dl>
@@ -482,7 +482,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>readHeader</h4>
-<pre>public static&nbsp;org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureWALHeader&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.html#line.152">readHeader</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;stream)
+<pre>public static&nbsp;org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureWALHeader&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.html#line.149">readHeader</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;stream)
                                                                                                        throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <dl>
 <dt><span class="throwsLabel">Throws:</span></dt>
@@ -496,7 +496,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>readTrailer</h4>
-<pre>public static&nbsp;org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureWALTrailer&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.html#line.177">readTrailer</a>(org.apache.hadoop.fs.FSDataInputStream&nbsp;stream,
+<pre>public static&nbsp;org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureWALTrailer&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.html#line.174">readTrailer</a>(org.apache.hadoop.fs.FSDataInputStream&nbsp;stream,
                                                                                                                 long&nbsp;startPos,
                                                                                                                 long&nbsp;size)
                                                                                                          throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
@@ -512,7 +512,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>readEntry</h4>
-<pre>public static&nbsp;org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureWALEntry&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.html#line.214">readEntry</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;stream)
+<pre>public static&nbsp;org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureWALEntry&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.html#line.211">readEntry</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;stream)
                                                                                                      throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <dl>
 <dt><span class="throwsLabel">Throws:</span></dt>
@@ -526,7 +526,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>writeEntry</h4>
-<pre>public static&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.html#line.218">writeEntry</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/util/ByteSlot.html" title="class in org.apache.hadoop.hbase.procedure2.util">ByteSlot</a>&nbsp;slot,
+<pre>public static&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.html#line.215">writeEntry</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/util/ByteSlot.html" title="class in org.apache.hadoop.hbase.procedure2.util">ByteSlot</a>&nbsp;slot,
                               org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureWALEntry.Type&nbsp;type,
                               <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2">Procedure</a>&lt;?&gt;&nbsp;proc,
                               <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2">Procedure</a>&lt;?&gt;[]&nbsp;subprocs)
@@ -543,7 +543,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>writeInsert</h4>
-<pre>public static&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.html#line.231">writeInsert</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/util/ByteSlot.html" title="class in org.apache.hadoop.hbase.procedure2.util">ByteSlot</a>&nbsp;slot,
+<pre>public static&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.html#line.228">writeInsert</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/util/ByteSlot.html" title="class in org.apache.hadoop.hbase.procedure2.util">ByteSlot</a>&nbsp;slot,
                                <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2">Procedure</a>&lt;?&gt;&nbsp;proc)
                         throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <dl>
@@ -558,7 +558,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>writeInsert</h4>
-<pre>public static&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.html#line.236">writeInsert</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/util/ByteSlot.html" title="class in org.apache.hadoop.hbase.procedure2.util">ByteSlot</a>&nbsp;slot,
+<pre>public static&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.html#line.233">writeInsert</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/util/ByteSlot.html" title="class in org.apache.hadoop.hbase.procedure2.util">ByteSlot</a>&nbsp;slot,
                                <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2">Procedure</a>&lt;?&gt;&nbsp;proc,
                                <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2">Procedure</a>&lt;?&gt;[]&nbsp;subprocs)
                         throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
@@ -574,7 +574,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>writeUpdate</h4>
-<pre>public static&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.html#line.241">writeUpdate</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/util/ByteSlot.html" title="class in org.apache.hadoop.hbase.procedure2.util">ByteSlot</a>&nbsp;slot,
+<pre>public static&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.html#line.238">writeUpdate</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/util/ByteSlot.html" title="class in org.apache.hadoop.hbase.procedure2.util">ByteSlot</a>&nbsp;slot,
                                <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2">Procedure</a>&lt;?&gt;&nbsp;proc)
                         throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <dl>
@@ -589,7 +589,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>writeDelete</h4>
-<pre>public static&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.html#line.246">writeDelete</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/util/ByteSlot.html" title="class in org.apache.hadoop.hbase.procedure2.util">ByteSlot</a>&nbsp;slot,
+<pre>public static&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.html#line.243">writeDelete</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/util/ByteSlot.html" title="class in org.apache.hadoop.hbase.procedure2.util">ByteSlot</a>&nbsp;slot,
                                long&nbsp;procId)
                         throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <dl>
@@ -604,7 +604,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockListLast">
 <li class="blockList">
 <h4>writeDelete</h4>
-<pre>public static&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.html#line.254">writeDelete</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/util/ByteSlot.html" title="class in org.apache.hadoop.hbase.procedure2.util">ByteSlot</a>&nbsp;slot,
+<pre>public static&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.html#line.251">writeDelete</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/util/ByteSlot.html" title="class in org.apache.hadoop.hbase.procedure2.util">ByteSlot</a>&nbsp;slot,
                                <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2">Procedure</a>&lt;?&gt;&nbsp;proc,
                                long[]&nbsp;subprocs)
                         throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
index 3fd4750..e03e9cc 100644 (file)
@@ -122,7 +122,7 @@ var activeTableTab = "activeTableTab";
 </dl>
 <hr>
 <br>
-<pre>private static enum <a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.700">WALProcedureStore.PushType</a>
+<pre>private static enum <a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.706">WALProcedureStore.PushType</a>
 extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang">Enum</a>&lt;<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html" title="enum in org.apache.hadoop.hbase.procedure2.store.wal">WALProcedureStore.PushType</a>&gt;</pre>
 </li>
 </ul>
@@ -213,7 +213,7 @@ the order they are declared.</div>
 <ul class="blockList">
 <li class="blockList">
 <h4>INSERT</h4>
-<pre>public static final&nbsp;<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html" title="enum in org.apache.hadoop.hbase.procedure2.store.wal">WALProcedureStore.PushType</a> <a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html#line.700">INSERT</a></pre>
+<pre>public static final&nbsp;<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html" title="enum in org.apache.hadoop.hbase.procedure2.store.wal">WALProcedureStore.PushType</a> <a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html#line.706">INSERT</a></pre>
 </li>
 </ul>
 <a name="UPDATE">
@@ -222,7 +222,7 @@ the order they are declared.</div>
 <ul class="blockList">
 <li class="blockList">
 <h4>UPDATE</h4>
-<pre>public static final&nbsp;<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html" title="enum in org.apache.hadoop.hbase.procedure2.store.wal">WALProcedureStore.PushType</a> <a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html#line.700">UPDATE</a></pre>
+<pre>public static final&nbsp;<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html" title="enum in org.apache.hadoop.hbase.procedure2.store.wal">WALProcedureStore.PushType</a> <a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html#line.706">UPDATE</a></pre>
 </li>
 </ul>
 <a name="DELETE">
@@ -231,7 +231,7 @@ the order they are declared.</div>
 <ul class="blockListLast">
 <li class="blockList">
 <h4>DELETE</h4>
-<pre>public static final&nbsp;<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html" title="enum in org.apache.hadoop.hbase.procedure2.store.wal">WALProcedureStore.PushType</a> <a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html#line.700">DELETE</a></pre>
+<pre>public static final&nbsp;<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html" title="enum in org.apache.hadoop.hbase.procedure2.store.wal">WALProcedureStore.PushType</a> <a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html#line.706">DELETE</a></pre>
 </li>
 </ul>
 </li>
@@ -248,7 +248,7 @@ the order they are declared.</div>
 <ul class="blockList">
 <li class="blockList">
 <h4>values</h4>
-<pre>public static&nbsp;<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html" title="enum in org.apache.hadoop.hbase.procedure2.store.wal">WALProcedureStore.PushType</a>[]&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html#line.700">values</a>()</pre>
+<pre>public static&nbsp;<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html" title="enum in org.apache.hadoop.hbase.procedure2.store.wal">WALProcedureStore.PushType</a>[]&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html#line.706">values</a>()</pre>
 <div class="block">Returns an array containing the constants of this enum type, in
 the order they are declared.  This method may be used to iterate
 over the constants as follows:
@@ -268,7 +268,7 @@ for (WALProcedureStore.PushType c : WALProcedureStore.PushType.values())
 <ul class="blockListLast">
 <li class="blockList">
 <h4>valueOf</h4>
-<pre>public static&nbsp;<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html" title="enum in org.apache.hadoop.hbase.procedure2.store.wal">WALProcedureStore.PushType</a>&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html#line.700">valueOf</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</pre>
+<pre>public static&nbsp;<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html" title="enum in org.apache.hadoop.hbase.procedure2.store.wal">WALProcedureStore.PushType</a>&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html#line.706">valueOf</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</pre>
 <div class="block">Returns the enum constant of this type with the specified name.
 The string must match <i>exactly</i> an identifier used to declare an
 enum constant in this type.  (Extraneous whitespace characters are 
index a2f36de..f00006f 100644 (file)
@@ -1489,7 +1489,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>WALS_PATH_FILTER</h4>
-<pre>private static final&nbsp;org.apache.hadoop.fs.PathFilter <a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1265">WALS_PATH_FILTER</a></pre>
+<pre>private static final&nbsp;org.apache.hadoop.fs.PathFilter <a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1275">WALS_PATH_FILTER</a></pre>
 </li>
 </ul>
 <a name="FILE_STATUS_ID_COMPARATOR">
@@ -1498,7 +1498,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockListLast">
 <li class="blockList">
 <h4>FILE_STATUS_ID_COMPARATOR</h4>
-<pre>private static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;org.apache.hadoop.fs.FileStatus&gt; <a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1273">FILE_STATUS_ID_COMPARATOR</a></pre>
+<pre>private static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;org.apache.hadoop.fs.FileStatus&gt; <a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1283">FILE_STATUS_ID_COMPARATOR</a></pre>
 </li>
 </ul>
 </li>
@@ -1685,7 +1685,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>tryCleanupLogsOnLoad</h4>
-<pre>private&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.503">tryCleanupLogsOnLoad</a>()</pre>
+<pre>private&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.509">tryCleanupLogsOnLoad</a>()</pre>
 </li>
 </ul>
 <a name="insert-org.apache.hadoop.hbase.procedure2.Procedure-org.apache.hadoop.hbase.procedure2.Procedure:A-">
@@ -1694,7 +1694,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>insert</h4>
-<pre>public&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.524">insert</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2">Procedure</a>&lt;?&gt;&nbsp;proc,
+<pre>public&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.530">insert</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2">Procedure</a>&lt;?&gt;&nbsp;proc,
                    <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2">Procedure</a>&lt;?&gt;[]&nbsp;subprocs)</pre>
 <div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/ProcedureStore.html#insert-org.apache.hadoop.hbase.procedure2.Procedure-org.apache.hadoop.hbase.procedure2.Procedure:A-">ProcedureStore</a></code></span></div>
 <div class="block">When a procedure is submitted to the executor insert(proc, null) will be called.
@@ -1716,7 +1716,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>insert</h4>
-<pre>public&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.558">insert</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2">Procedure</a>&lt;?&gt;[]&nbsp;procs)</pre>
+<pre>public&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.564">insert</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2">Procedure</a>&lt;?&gt;[]&nbsp;procs)</pre>
 <div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/ProcedureStore.html#insert-org.apache.hadoop.hbase.procedure2.Procedure:A-">ProcedureStore</a></code></span></div>
 <div class="block">Serialize a set of new procedures.
  These procedures are freshly submitted to the executor and each procedure
@@ -1733,7 +1733,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>update</h4>
-<pre>public&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.587">update</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2">Procedure</a>&lt;?&gt;&nbsp;proc)</pre>
+<pre>public&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.593">update</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2">Procedure</a>&lt;?&gt;&nbsp;proc)</pre>
 <div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/ProcedureStore.html#update-org.apache.hadoop.hbase.procedure2.Procedure-">ProcedureStore</a></code></span></div>
 <div class="block">The specified procedure was executed,
  and the new state should be written to the store.</div>
@@ -1749,7 +1749,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>delete</h4>
-<pre>public&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.610">delete</a>(long&nbsp;procId)</pre>
+<pre>public&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.616">delete</a>(long&nbsp;procId)</pre>
 <div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/ProcedureStore.html#delete-long-">ProcedureStore</a></code></span></div>
 <div class="block">The specified procId was removed from the executor,
  due to completion, abort or failure.
@@ -1766,7 +1766,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>delete</h4>
-<pre>public&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.630">delete</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2">Procedure</a>&lt;?&gt;&nbsp;proc,
+<pre>public&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.636">delete</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2">Procedure</a>&lt;?&gt;&nbsp;proc,
                    long[]&nbsp;subProcIds)</pre>
 <div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/ProcedureStore.html#delete-org.apache.hadoop.hbase.procedure2.Procedure-long:A-">ProcedureStore</a></code></span></div>
 <div class="block">The parent procedure completed.
@@ -1784,7 +1784,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>delete</h4>
-<pre>public&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.655">delete</a>(long[]&nbsp;procIds,
+<pre>public&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.661">delete</a>(long[]&nbsp;procIds,
                    int&nbsp;offset,
                    int&nbsp;count)</pre>
 <div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/ProcedureStore.html#delete-long:A-int-int-">ProcedureStore</a></code></span></div>
@@ -1805,7 +1805,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>delete</h4>
-<pre>private&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.666">delete</a>(long[]&nbsp;procIds)</pre>
+<pre>private&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.672">delete</a>(long[]&nbsp;procIds)</pre>
 </li>
 </ul>
 <a name="acquireSlot--">
@@ -1814,7 +1814,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>acquireSlot</h4>
-<pre>private&nbsp;<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/util/ByteSlot.html" title="class in org.apache.hadoop.hbase.procedure2.util">ByteSlot</a>&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.690">acquireSlot</a>()</pre>
+<pre>private&nbsp;<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/util/ByteSlot.html" title="class in org.apache.hadoop.hbase.procedure2.util">ByteSlot</a>&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.696">acquireSlot</a>()</pre>
 </li>
 </ul>
 <a name="releaseSlot-org.apache.hadoop.hbase.procedure2.util.ByteSlot-">
@@ -1823,7 +1823,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>releaseSlot</h4>
-<pre>private&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.695">releaseSlot</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/util/ByteSlot.html" title="class in org.apache.hadoop.hbase.procedure2.util">ByteSlot</a>&nbsp;slot)</pre>
+<pre>private&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.701">releaseSlot</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/util/ByteSlot.html" title="class in org.apache.hadoop.hbase.procedure2.util">ByteSlot</a>&nbsp;slot)</pre>
 </li>
 </ul>
 <a name="pushData-org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore.PushType-org.apache.hadoop.hbase.procedure2.util.ByteSlot-long-long:A-">
@@ -1832,7 +1832,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>pushData</h4>
-<pre>private&nbsp;long&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.702">pushData</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html" title="enum in org.apache.hadoop.hbase.procedure2.store.wal">WALProcedureStore.PushType</a>&nbsp;type,
+<pre>private&nbsp;long&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.708">pushData</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html" title="enum in org.apache.hadoop.hbase.procedure2.store.wal">WALProcedureStore.PushType</a>&nbsp;type,
                       <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/util/ByteSlot.html" title="class in org.apache.hadoop.hbase.procedure2.util">ByteSlot</a>&nbsp;slot,
                       long&nbsp;procId,
                       long[]&nbsp;subProcIds)</pre>
@@ -1844,7 +1844,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>updateStoreTracker</h4>
-<pre>private&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.762">updateStoreTracker</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html" title="enum in org.apache.hadoop.hbase.procedure2.store.wal">WALProcedureStore.PushType</a>&nbsp;type,
+<pre>private&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.768">updateStoreTracker</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.PushType.html" title="enum in org.apache.hadoop.hbase.procedure2.store.wal">WALProcedureStore.PushType</a>&nbsp;type,
                                 long&nbsp;procId,
                                 long[]&nbsp;subProcIds)</pre>
 </li>
@@ -1855,7 +1855,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>isSyncAborted</h4>
-<pre>private&nbsp;boolean&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.793">isSyncAborted</a>()</pre>
+<pre>private&nbsp;boolean&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.799">isSyncAborted</a>()</pre>
 </li>
 </ul>
 <a name="syncLoop--">
@@ -1864,7 +1864,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>syncLoop</h4>
-<pre>private&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.797">syncLoop</a>()
+<pre>private&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.803">syncLoop</a>()
                throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang">Throwable</a></pre>
 <dl>
 <dt><span class="throwsLabel">Throws:</span></dt>
@@ -1878,7 +1878,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>getSyncMetrics</h4>
-<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a>&lt;<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.SyncMetrics.html" title="class in org.apache.hadoop.hbase.procedure2.store.wal">WALProcedureStore.SyncMetrics</a>&gt;&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.877">getSyncMetrics</a>()</pre>
+<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a>&lt;<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.SyncMetrics.html" title="class in org.apache.hadoop.hbase.procedure2.store.wal">WALProcedureStore.SyncMetrics</a>&gt;&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.883">getSyncMetrics</a>()</pre>
 </li>
 </ul>
 <a name="syncSlots--">
@@ -1887,7 +1887,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>syncSlots</h4>
-<pre>private&nbsp;long&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.886">syncSlots</a>()
+<pre>private&nbsp;long&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.892">syncSlots</a>()
                 throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang">Throwable</a></pre>
 <dl>
 <dt><span class="throwsLabel">Throws:</span></dt>
@@ -1901,7 +1901,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>syncSlots</h4>
-<pre>protected&nbsp;long&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.914">syncSlots</a>(org.apache.hadoop.fs.FSDataOutputStream&nbsp;stream,
+<pre>protected&nbsp;long&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.920">syncSlots</a>(org.apache.hadoop.fs.FSDataOutputStream&nbsp;stream,
                          <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/util/ByteSlot.html" title="class in org.apache.hadoop.hbase.procedure2.util">ByteSlot</a>[]&nbsp;slots,
                          int&nbsp;offset,
                          int&nbsp;count)
@@ -1918,7 +1918,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>syncStream</h4>
-<pre>protected&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.933">syncStream</a>(org.apache.hadoop.fs.FSDataOutputStream&nbsp;stream)
+<pre>protected&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.939">syncStream</a>(org.apache.hadoop.fs.FSDataOutputStream&nbsp;stream)
                    throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <dl>
 <dt><span class="throwsLabel">Throws:</span></dt>
@@ -1932,7 +1932,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>rollWriterWithRetries</h4>
-<pre>private&nbsp;boolean&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.941">rollWriterWithRetries</a>()</pre>
+<pre>private&nbsp;boolean&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.947">rollWriterWithRetries</a>()</pre>
 </li>
 </ul>
 <a name="tryRollWriter--">
@@ -1941,7 +1941,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>tryRollWriter</h4>
-<pre>private&nbsp;boolean&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.957">tryRollWriter</a>()</pre>
+<pre>private&nbsp;boolean&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.963">tryRollWriter</a>()</pre>
 </li>
 </ul>
 <a name="getMillisToNextPeriodicRoll--">
@@ -1950,7 +1950,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>getMillisToNextPeriodicRoll</h4>
-<pre>public&nbsp;long&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.966">getMillisToNextPeriodicRoll</a>()</pre>
+<pre>public&nbsp;long&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.972">getMillisToNextPeriodicRoll</a>()</pre>
 </li>
 </ul>
 <a name="getMillisFromLastRoll--">
@@ -1959,7 +1959,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>getMillisFromLastRoll</h4>
-<pre>public&nbsp;long&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.973">getMillisFromLastRoll</a>()</pre>
+<pre>public&nbsp;long&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.979">getMillisFromLastRoll</a>()</pre>
 </li>
 </ul>
 <a name="periodicRollForTesting--">
@@ -1968,7 +1968,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>periodicRollForTesting</h4>
-<pre>void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.978">periodicRollForTesting</a>()
+<pre>void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.984">periodicRollForTesting</a>()
                      throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <dl>
 <dt><span class="throwsLabel">Throws:</span></dt>
@@ -1982,7 +1982,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>rollWriterForTesting</h4>
-<pre>public&nbsp;boolean&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.988">rollWriterForTesting</a>()
+<pre>public&nbsp;boolean&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.994">rollWriterForTesting</a>()
                              throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <dl>
 <dt><span class="throwsLabel">Throws:</span></dt>
@@ -1996,7 +1996,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>removeInactiveLogsForTesting</h4>
-<pre>void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.998">removeInactiveLogsForTesting</a>()
+<pre>void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1004">removeInactiveLogsForTesting</a>()
                            throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></pre>
 <dl>
 <dt><span class="throwsLabel">Throws:</span></dt>
@@ -2010,7 +2010,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>periodicRoll</h4>
-<pre>private&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1007">periodicRoll</a>()
+<pre>private&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1013">periodicRoll</a>()
                    throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <dl>
 <dt><span class="throwsLabel">Throws:</span></dt>
@@ -2024,7 +2024,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>rollWriter</h4>
-<pre>private&nbsp;boolean&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1028">rollWriter</a>()
+<pre>private&nbsp;boolean&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1034">rollWriter</a>()
                     throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <dl>
 <dt><span class="throwsLabel">Throws:</span></dt>
@@ -2038,7 +2038,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>rollWriter</h4>
-<pre>boolean&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1052">rollWriter</a>(long&nbsp;logId)
+<pre>boolean&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1058">rollWriter</a>(long&nbsp;logId)
             throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <dl>
 <dt><span class="throwsLabel">Throws:</span></dt>
@@ -2052,7 +2052,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>closeCurrentLogStream</h4>
-<pre>private&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1129">closeCurrentLogStream</a>(boolean&nbsp;abort)</pre>
+<pre>private&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1135">closeCurrentLogStream</a>(boolean&nbsp;abort)</pre>
 </li>
 </ul>
 <a name="removeInactiveLogs--">
@@ -2061,7 +2061,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>removeInactiveLogs</h4>
-<pre>private&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1156">removeInactiveLogs</a>()
+<pre>private&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1166">removeInactiveLogs</a>()
                          throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <dl>
 <dt><span class="throwsLabel">Throws:</span></dt>
@@ -2075,7 +2075,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>buildHoldingCleanupTracker</h4>
-<pre>private&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1169">buildHoldingCleanupTracker</a>()</pre>
+<pre>private&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1179">buildHoldingCleanupTracker</a>()</pre>
 </li>
 </ul>
 <a name="removeAllLogs-long-java.lang.String-">
@@ -2084,7 +2084,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>removeAllLogs</h4>
-<pre>private&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1203">removeAllLogs</a>(long&nbsp;lastLogId,
+<pre>private&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1213">removeAllLogs</a>(long&nbsp;lastLogId,
                            <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;why)</pre>
 <div class="block">Remove all logs with logId <= <code>lastLogId</code>.</div>
 </li>
@@ -2095,7 +2095,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>removeLogFile</h4>
-<pre>private&nbsp;boolean&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1225">removeLogFile</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFile.html" title="class in org.apache.hadoop.hbase.procedure2.store.wal">ProcedureWALFile</a>&nbsp;log,
+<pre>private&nbsp;boolean&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1235">removeLogFile</a>(<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFile.html" title="class in org.apache.hadoop.hbase.procedure2.store.wal">ProcedureWALFile</a>&nbsp;log,
                               org.apache.hadoop.fs.Path&nbsp;walArchiveDir)</pre>
 </li>
 </ul>
@@ -2105,7 +2105,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>getWALDir</h4>
-<pre>public&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1242">getWALDir</a>()</pre>
+<pre>public&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1252">getWALDir</a>()</pre>
 </li>
 </ul>
 <a name="getWalArchiveDir--">
@@ -2114,7 +2114,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>getWalArchiveDir</h4>
-<pre>org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1247">getWalArchiveDir</a>()</pre>
+<pre>org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1257">getWalArchiveDir</a>()</pre>
 </li>
 </ul>
 <a name="getFileSystem--">
@@ -2123,7 +2123,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>getFileSystem</h4>
-<pre>public&nbsp;org.apache.hadoop.fs.FileSystem&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1251">getFileSystem</a>()</pre>
+<pre>public&nbsp;org.apache.hadoop.fs.FileSystem&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1261">getFileSystem</a>()</pre>
 </li>
 </ul>
 <a name="getLogFilePath-long-">
@@ -2132,7 +2132,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>getLogFilePath</h4>
-<pre>protected&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1255">getLogFilePath</a>(long&nbsp;logId)
+<pre>protected&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1265">getLogFilePath</a>(long&nbsp;logId)
                                             throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <dl>
 <dt><span class="throwsLabel">Throws:</span></dt>
@@ -2146,7 +2146,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>getLogIdFromName</h4>
-<pre>private static&nbsp;long&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1259">getLogIdFromName</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</pre>
+<pre>private static&nbsp;long&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1269">getLogIdFromName</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</pre>
 </li>
 </ul>
 <a name="getLogFiles--">
@@ -2155,7 +2155,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>getLogFiles</h4>
-<pre>private&nbsp;org.apache.hadoop.fs.FileStatus[]&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1283">getLogFiles</a>()
+<pre>private&nbsp;org.apache.hadoop.fs.FileStatus[]&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1293">getLogFiles</a>()
                                                throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <dl>
 <dt><span class="throwsLabel">Throws:</span></dt>
@@ -2169,7 +2169,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>getMaxLogId</h4>
-<pre>private static&nbsp;long&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1299">getMaxLogId</a>(org.apache.hadoop.fs.FileStatus[]&nbsp;logFiles)</pre>
+<pre>private static&nbsp;long&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1309">getMaxLogId</a>(org.apache.hadoop.fs.FileStatus[]&nbsp;logFiles)</pre>
 <div class="block">Make sure that the file set are gotten by calling <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#getLogFiles--"><code>getLogFiles()</code></a>, where we will sort
  the file set by log id.</div>
 <dl>
@@ -2184,7 +2184,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>initOldLogs</h4>
-<pre>private&nbsp;long&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1311">initOldLogs</a>(org.apache.hadoop.fs.FileStatus[]&nbsp;logFiles)
+<pre>private&nbsp;long&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1321">initOldLogs</a>(org.apache.hadoop.fs.FileStatus[]&nbsp;logFiles)
                   throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <div class="block">Make sure that the file set are gotten by calling <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#getLogFiles--"><code>getLogFiles()</code></a>, where we will sort
  the file set by log id.</div>
@@ -2202,7 +2202,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>initTrackerFromOldLogs</h4>
-<pre>private&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1337">initTrackerFromOldLogs</a>()</pre>
+<pre>private&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1347">initTrackerFromOldLogs</a>()</pre>
 <div class="block">If last log's tracker is not null, use it as <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#storeTracker"><code>storeTracker</code></a>. Otherwise, set storeTracker
  as partial, and let <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormatReader.html" title="class in org.apache.hadoop.hbase.procedure2.store.wal"><code>ProcedureWALFormatReader</code></a> rebuild it using entries in the log.</div>
 </li>
@@ -2213,7 +2213,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockList">
 <li class="blockList">
 <h4>initOldLog</h4>
-<pre>private&nbsp;<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFile.html" title="class in org.apache.hadoop.hbase.procedure2.store.wal">ProcedureWALFile</a>&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1353">initOldLog</a>(org.apache.hadoop.fs.FileStatus&nbsp;logFile,
+<pre>private&nbsp;<a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFile.html" title="class in org.apache.hadoop.hbase.procedure2.store.wal">ProcedureWALFile</a>&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1363">initOldLog</a>(org.apache.hadoop.fs.FileStatus&nbsp;logFile,
                                     org.apache.hadoop.fs.Path&nbsp;walArchiveDir)
                              throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <div class="block">Loads given log file and it's tracker.</div>
@@ -2229,7 +2229,7 @@ extends <a href="../../../../../../../org/apache/hadoop/hbase/procedure2/store/P
 <ul class="blockListLast">
 <li class="blockList">
 <h4>main</h4>
-<pre>public static&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1391">main</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]&nbsp;args)
+<pre>public static&nbsp;void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.html#line.1401">main</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]&nbsp;args)
                  throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <div class="block">Parses a directory of WALs building up ProcedureState.
  For testing parse and profiling.</div>
index 23054ab..288641b 100644 (file)
@@ -18,9 +18,9 @@
 <span class="sourceLineNo">010</span>  public static final String version = "3.0.0-SNAPSHOT";<a name="line.10"></a>
 <span class="sourceLineNo">011</span>  public static final String revision = "";<a name="line.11"></a>
 <span class="sourceLineNo">012</span>  public static final String user = "jenkins";<a name="line.12"></a>
-<span class="sourceLineNo">013</span>  public static final String date = "Mon Nov 19 14:44:53 UTC 2018";<a name="line.13"></a>
+<span class="sourceLineNo">013</span>  public static final String date = "Tue Nov 20 14:44:19 UTC 2018";<a name="line.13"></a>
 <span class="sourceLineNo">014</span>  public static final String url = "git://jenkins-websites1.apache.org/home/jenkins/jenkins-slave/workspace/hbase_generate_website/hbase";<a name="line.14"></a>
-<span class="sourceLineNo">015</span>  public static final String srcChecksum = "354946859721123895ba2f38486ee8a8";<a name="line.15"></a>
+<span class="sourceLineNo">015</span>  public static final String srcChecksum = "05b800e0fa4b560f4e9c387e4d35888d";<a name="line.15"></a>
 <span class="sourceLineNo">016</span>}<a name="line.16"></a>
 
 
index 5fc97ee..2cc0fc9 100644 (file)
 <span class="sourceLineNo">274</span>    this.keepDeletes = false;<a name="line.274"></a>
 <span class="sourceLineNo">275</span>    this.partial = false;<a name="line.275"></a>
 <span class="sourceLineNo">276</span>    this.map.clear();<a name="line.276"></a>
-<span class="sourceLineNo">277</span>    resetModified();<a name="line.277"></a>
-<span class="sourceLineNo">278</span>  }<a name="line.278"></a>
-<span class="sourceLineNo">279</span><a name="line.279"></a>
-<span class="sourceLineNo">280</span>  public boolean isModified(long procId) {<a name="line.280"></a>
-<span class="sourceLineNo">281</span>    final Map.Entry&lt;Long, BitSetNode&gt; entry = map.floorEntry(procId);<a name="line.281"></a>
-<span class="sourceLineNo">282</span>    return entry != null &amp;&amp; entry.getValue().contains(procId) &amp;&amp;<a name="line.282"></a>
-<span class="sourceLineNo">283</span>      entry.getValue().isModified(procId);<a name="line.283"></a>
-<span class="sourceLineNo">284</span>  }<a name="line.284"></a>
-<span class="sourceLineNo">285</span><a name="line.285"></a>
-<span class="sourceLineNo">286</span>  /**<a name="line.286"></a>
-<span class="sourceLineNo">287</span>   * If {@link #partial} is false, returns state from the bitmap. If no state is found for<a name="line.287"></a>
-<span class="sourceLineNo">288</span>   * {@code procId}, returns YES.<a name="line.288"></a>
-<span class="sourceLineNo">289</span>   * If partial is true, tracker doesn't have complete view of system state, so it returns MAYBE<a name="line.289"></a>
-<span class="sourceLineNo">290</span>   * if there is no update for the procedure or if it doesn't have a state in bitmap. Otherwise,<a name="line.290"></a>
-<span class="sourceLineNo">291</span>   * returns state from the bitmap.<a name="line.291"></a>
-<span class="sourceLineNo">292</span>   */<a name="line.292"></a>
-<span class="sourceLineNo">293</span>  public DeleteState isDeleted(long procId) {<a name="line.293"></a>
-<span class="sourceLineNo">294</span>    Map.Entry&lt;Long, BitSetNode&gt; entry = map.floorEntry(procId);<a name="line.294"></a>
-<span class="sourceLineNo">295</span>    if (entry != null &amp;&amp; entry.getValue().contains(procId)) {<a name="line.295"></a>
-<span class="sourceLineNo">296</span>      BitSetNode node = entry.getValue();<a name="line.296"></a>
-<span class="sourceLineNo">297</span>      DeleteState state = node.isDeleted(procId);<a name="line.297"></a>
-<span class="sourceLineNo">298</span>      return partial &amp;&amp; !node.isModified(procId) ? DeleteState.MAYBE : state;<a name="line.298"></a>
-<span class="sourceLineNo">299</span>    }<a name="line.299"></a>
-<span class="sourceLineNo">300</span>    return partial ? DeleteState.MAYBE : DeleteState.YES;<a name="line.300"></a>
-<span class="sourceLineNo">301</span>  }<a name="line.301"></a>
-<span class="sourceLineNo">302</span><a name="line.302"></a>
-<span class="sourceLineNo">303</span>  public long getActiveMinProcId() {<a name="line.303"></a>
-<span class="sourceLineNo">304</span>    Map.Entry&lt;Long, BitSetNode&gt; entry = map.firstEntry();<a name="line.304"></a>
-<span class="sourceLineNo">305</span>    return entry == null ? Procedure.NO_PROC_ID : entry.getValue().getActiveMinProcId();<a name="line.305"></a>
-<span class="sourceLineNo">306</span>  }<a name="line.306"></a>
-<span class="sourceLineNo">307</span><a name="line.307"></a>
-<span class="sourceLineNo">308</span>  public void setKeepDeletes(boolean keepDeletes) {<a name="line.308"></a>
-<span class="sourceLineNo">309</span>    this.keepDeletes = keepDeletes;<a name="line.309"></a>
-<span class="sourceLineNo">310</span>    // If not to keep deletes, remove the BitSetNodes which are empty (i.e. contains ids of deleted<a name="line.310"></a>
-<span class="sourceLineNo">311</span>    // procedures).<a name="line.311"></a>
-<span class="sourceLineNo">312</span>    if (!keepDeletes) {<a name="line.312"></a>
-<span class="sourceLineNo">313</span>      Iterator&lt;Map.Entry&lt;Long, BitSetNode&gt;&gt; it = map.entrySet().iterator();<a name="line.313"></a>
-<span class="sourceLineNo">314</span>      while (it.hasNext()) {<a name="line.314"></a>
-<span class="sourceLineNo">315</span>        Map.Entry&lt;Long, BitSetNode&gt; entry = it.next();<a name="line.315"></a>
-<span class="sourceLineNo">316</span>        if (entry.getValue().isEmpty()) {<a name="line.316"></a>
-<span class="sourceLineNo">317</span>          it.remove();<a name="line.317"></a>
-<span class="sourceLineNo">318</span>        }<a name="line.318"></a>
-<span class="sourceLineNo">319</span>      }<a name="line.319"></a>
-<span class="sourceLineNo">320</span>    }<a name="line.320"></a>
-<span class="sourceLineNo">321</span>  }<a name="line.321"></a>
-<span class="sourceLineNo">322</span><a name="line.322"></a>
-<span class="sourceLineNo">323</span>  public boolean isPartial() {<a name="line.323"></a>
-<span class="sourceLineNo">324</span>    return partial;<a name="line.324"></a>
-<span class="sourceLineNo">325</span>  }<a name="line.325"></a>
-<span class="sourceLineNo">326</span><a name="line.326"></a>
-<span class="sourceLineNo">327</span>  public void setPartialFlag(boolean isPartial) {<a name="line.327"></a>
-<span class="sourceLineNo">328</span>    if (this.partial &amp;&amp; !isPartial) {<a name="line.328"></a>
-<span class="sourceLineNo">329</span>      for (Map.Entry&lt;Long, BitSetNode&gt; entry : map.entrySet()) {<a name="line.329"></a>
-<span class="sourceLineNo">330</span>        entry.getValue().unsetPartialFlag();<a name="line.330"></a>
-<span class="sourceLineNo">331</span>      }<a name="line.331"></a>
-<span class="sourceLineNo">332</span>    }<a name="line.332"></a>
-<span class="sourceLineNo">333</span>    this.partial = isPartial;<a name="line.333"></a>
-<span class="sourceLineNo">334</span>  }<a name="line.334"></a>
-<span class="sourceLineNo">335</span><a name="line.335"></a>
-<span class="sourceLineNo">336</span>  /**<a name="line.336"></a>
-<span class="sourceLineNo">337</span>   * @return true, if no procedure is active, else false.<a name="line.337"></a>
-<span class="sourceLineNo">338</span>   */<a name="line.338"></a>
-<span class="sourceLineNo">339</span>  public boolean isEmpty() {<a name="line.339"></a>
-<span class="sourceLineNo">340</span>    for (Map.Entry&lt;Long, BitSetNode&gt; entry : map.entrySet()) {<a name="line.340"></a>
-<span class="sourceLineNo">341</span>      if (!entry.getValue().isEmpty()) {<a name="line.341"></a>
-<span class="sourceLineNo">342</span>        return false;<a name="line.342"></a>
-<span class="sourceLineNo">343</span>      }<a name="line.343"></a>
-<span class="sourceLineNo">344</span>    }<a name="line.344"></a>
-<span class="sourceLineNo">345</span>    return true;<a name="line.345"></a>
-<span class="sourceLineNo">346</span>  }<a name="line.346"></a>
-<span class="sourceLineNo">347</span><a name="line.347"></a>
-<span class="sourceLineNo">348</span>  /**<a name="line.348"></a>
-<span class="sourceLineNo">349</span>   * @return true if all procedure was modified or deleted since last call to<a name="line.349"></a>
-<span class="sourceLineNo">350</span>   *         {@link #resetModified()}.<a name="line.350"></a>
-<span class="sourceLineNo">351</span>   */<a name="line.351"></a>
-<span class="sourceLineNo">352</span>  public boolean isAllModified() {<a name="line.352"></a>
-<span class="sourceLineNo">353</span>    for (Map.Entry&lt;Long, BitSetNode&gt; entry : map.entrySet()) {<a name="line.353"></a>
-<span class="sourceLineNo">354</span>      if (!entry.getValue().isAllModified()) {<a name="line.354"></a>
-<span class="sourceLineNo">355</span>        return false;<a name="line.355"></a>
-<span class="sourceLineNo">356</span>      }<a name="line.356"></a>
-<span class="sourceLineNo">357</span>    }<a name="line.357"></a>
-<span class="sourceLineNo">358</span>    return true;<a name="line.358"></a>
-<span class="sourceLineNo">359</span>  }<a name="line.359"></a>
-<span class="sourceLineNo">360</span><a name="line.360"></a>
-<span class="sourceLineNo">361</span>  /**<a name="line.361"></a>
-<span class="sourceLineNo">362</span>   * Will be used when there are too many proc wal files. We will rewrite the states of the active<a name="line.362"></a>
-<span class="sourceLineNo">363</span>   * procedures in the oldest proc wal file so that we can delete it.<a name="line.363"></a>
-<span class="sourceLineNo">364</span>   * @return all the active procedure ids in this tracker.<a name="line.364"></a>
-<span class="sourceLineNo">365</span>   */<a name="line.365"></a>
-<span class="sourceLineNo">366</span>  public long[] getAllActiveProcIds() {<a name="line.366"></a>
-<span class="sourceLineNo">367</span>    return map.values().stream().map(BitSetNode::getActiveProcIds).filter(p -&gt; p.length &gt; 0)<a name="line.367"></a>
-<span class="sourceLineNo">368</span>      .flatMapToLong(LongStream::of).toArray();<a name="line.368"></a>
-<span class="sourceLineNo">369</span>  }<a name="line.369"></a>
-<span class="sourceLineNo">370</span><a name="line.370"></a>
-<span class="sourceLineNo">371</span>  /**<a name="line.371"></a>
-<span class="sourceLineNo">372</span>   * Clears the list of updated procedure ids. This doesn't affect global list of active<a name="line.372"></a>
-<span class="sourceLineNo">373</span>   * procedure ids.<a name="line.373"></a>
-<span class="sourceLineNo">374</span>   */<a name="line.374"></a>
-<span class="sourceLineNo">375</span>  public void resetModified() {<a name="line.375"></a>
-<span class="sourceLineNo">376</span>    for (Map.Entry&lt;Long, BitSetNode&gt; entry : map.entrySet()) {<a name="line.376"></a>
-<span class="sourceLineNo">377</span>      entry.getValue().resetModified();<a name="line.377"></a>
-<span class="sourceLineNo">378</span>    }<a name="line.378"></a>
-<span class="sourceLineNo">379</span>    minModifiedProcId = Long.MAX_VALUE;<a name="line.379"></a>
-<span class="sourceLineNo">380</span>    maxModifiedProcId = Long.MIN_VALUE;<a name="line.380"></a>
-<span class="sourceLineNo">381</span>  }<a name="line.381"></a>
-<span class="sourceLineNo">382</span><a name="line.382"></a>
-<span class="sourceLineNo">383</span>  private BitSetNode getOrCreateNode(long procId) {<a name="line.383"></a>
-<span class="sourceLineNo">384</span>    // If procId can fit in left node (directly or by growing it)<a name="line.384"></a>
-<span class="sourceLineNo">385</span>    BitSetNode leftNode = null;<a name="line.385"></a>
-<span class="sourceLineNo">386</span>    boolean leftCanGrow = false;<a name="line.386"></a>
-<span class="sourceLineNo">387</span>    Map.Entry&lt;Long, BitSetNode&gt; leftEntry = map.floorEntry(procId);<a name="line.387"></a>
-<span class="sourceLineNo">388</span>    if (leftEntry != null) {<a name="line.388"></a>
-<span class="sourceLineNo">389</span>      leftNode = leftEntry.getValue();<a name="line.389"></a>
-<span class="sourceLineNo">390</span>      if (leftNode.contains(procId)) {<a name="line.390"></a>
-<span class="sourceLineNo">391</span>        return leftNode;<a name="line.391"></a>
-<span class="sourceLineNo">392</span>      }<a name="line.392"></a>
-<span class="sourceLineNo">393</span>      leftCanGrow = leftNode.canGrow(procId);<a name="line.393"></a>
-<span class="sourceLineNo">394</span>    }<a name="line.394"></a>
-<span class="sourceLineNo">395</span><a name="line.395"></a>
-<span class="sourceLineNo">396</span>    // If procId can fit in right node (directly or by growing it)<a name="line.396"></a>
-<span class="sourceLineNo">397</span>    BitSetNode rightNode = null;<a name="line.397"></a>
-<span class="sourceLineNo">398</span>    boolean rightCanGrow = false;<a name="line.398"></a>
-<span class="sourceLineNo">399</span>    Map.Entry&lt;Long, BitSetNode&gt; rightEntry = map.ceilingEntry(procId);<a name="line.399"></a>
-<span class="sourceLineNo">400</span>    if (rightEntry != null) {<a name="line.400"></a>
-<span class="sourceLineNo">401</span>      rightNode = rightEntry.getValue();<a name="line.401"></a>
-<span class="sourceLineNo">402</span>      rightCanGrow = rightNode.canGrow(procId);<a name="line.402"></a>
-<span class="sourceLineNo">403</span>      if (leftNode != null) {<a name="line.403"></a>
-<span class="sourceLineNo">404</span>        if (leftNode.canMerge(rightNode)) {<a name="line.404"></a>
-<span class="sourceLineNo">405</span>          // merge left and right node<a name="line.405"></a>
-<span class="sourceLineNo">406</span>          return mergeNodes(leftNode, rightNode);<a name="line.406"></a>
-<span class="sourceLineNo">407</span>        }<a name="line.407"></a>
-<span class="sourceLineNo">408</span><a name="line.408"></a>
-<span class="sourceLineNo">409</span>        // If left and right nodes can not merge, decide which one to grow.<a name="line.409"></a>
-<span class="sourceLineNo">410</span>        if (leftCanGrow &amp;&amp; rightCanGrow) {<a name="line.410"></a>
-<span class="sourceLineNo">411</span>          if ((procId - leftNode.getEnd()) &lt;= (rightNode.getStart() - procId)) {<a name="line.411"></a>
-<span class="sourceLineNo">412</span>            return growNode(leftNode, procId);<a name="line.412"></a>
-<span class="sourceLineNo">413</span>          }<a name="line.413"></a>
-<span class="sourceLineNo">414</span>          return growNode(rightNode, procId);<a name="line.414"></a>
-<span class="sourceLineNo">415</span>        }<a name="line.415"></a>
-<span class="sourceLineNo">416</span>      }<a name="line.416"></a>
-<span class="sourceLineNo">417</span>    }<a name="line.417"></a>
-<span class="sourceLineNo">418</span><a name="line.418"></a>
-<span class="sourceLineNo">419</span>    // grow the left node<a name="line.419"></a>
-<span class="sourceLineNo">420</span>    if (leftCanGrow) {<a name="line.420"></a>
-<span class="sourceLineNo">421</span>      return growNode(leftNode, procId);<a name="line.421"></a>
-<span class="sourceLineNo">422</span>    }<a name="line.422"></a>
-<span class="sourceLineNo">423</span><a name="line.423"></a>
-<span class="sourceLineNo">424</span>    // grow the right node<a name="line.424"></a>
-<span class="sourceLineNo">425</span>    if (rightCanGrow) {<a name="line.425"></a>
-<span class="sourceLineNo">426</span>      return growNode(rightNode, procId);<a name="line.426"></a>
-<span class="sourceLineNo">427</span>    }<a name="line.427"></a>
-<span class="sourceLineNo">428</span><a name="line.428"></a>
-<span class="sourceLineNo">429</span>    // add new node if there are no left/right nodes which can be used.<a name="line.429"></a>
-<span class="sourceLineNo">430</span>    BitSetNode node = new BitSetNode(procId, partial);<a name="line.430"></a>
-<span class="sourceLineNo">431</span>    map.put(node.getStart(), node);<a name="line.431"></a>
-<span class="sourceLineNo">432</span>    return node;<a name="line.432"></a>
-<span class="sourceLineNo">433</span>  }<a name="line.433"></a>
-<span class="sourceLineNo">434</span><a name="line.434"></a>
-<span class="sourceLineNo">435</span>  /**<a name="line.435"></a>
-<span class="sourceLineNo">436</span>   * Grows {@code node} to contain {@code procId} and updates the map.<a name="line.436"></a>
-<span class="sourceLineNo">437</span>   * @return {@link BitSetNode} instance which contains {@code procId}.<a name="line.437"></a>
-<span class="sourceLineNo">438</span>   */<a name="line.438"></a>
-<span class="sourceLineNo">439</span>  private BitSetNode growNode(BitSetNode node, long procId) {<a name="line.439"></a>
-<span class="sourceLineNo">440</span>    map.remove(node.getStart());<a name="line.440"></a>
-<span class="sourceLineNo">441</span>    node.grow(procId);<a name="line.441"></a>
-<span class="sourceLineNo">442</span>    map.put(node.getStart(), node);<a name="line.442"></a>
-<span class="sourceLineNo">443</span>    return node;<a name="line.443"></a>
-<span class="sourceLineNo">444</span>  }<a name="line.444"></a>
-<span class="sourceLineNo">445</span><a name="line.445"></a>
-<span class="sourceLineNo">446</span>  /**<a name="line.446"></a>
-<span class="sourceLineNo">447</span>   * Merges {@code leftNode} &amp; {@code rightNode} and updates the map.<a name="line.447"></a>
-<span class="sourceLineNo">448</span>   */<a name="line.448"></a>
-<span class="sourceLineNo">449</span>  private BitSetNode mergeNodes(BitSetNode leftNode, BitSetNode rightNode) {<a name="line.449"></a>
-<span class="sourceLineNo">450</span>    assert leftNode.getStart() &lt; rightNode.getStart();<a name="line.450"></a>
-<span class="sourceLineNo">451</span>    leftNode.merge(rightNode);<a name="line.451"></a>
-<span class="sourceLineNo">452</span>    map.remove(rightNode.getStart());<a name="line.452"></a>
-<span class="sourceLineNo">453</span>    return leftNode;<a name="line.453"></a>
-<span class="sourceLineNo">454</span>  }<a name="line.454"></a>
-<span class="sourceLineNo">455</span><a name="line.455"></a>
-<span class="sourceLineNo">456</span>  public void dump() {<a name="line.456"></a>
-<span class="sourceLineNo">457</span>    System.out.println("map " + map.size());<a name="line.457"></a>
-<span class="sourceLineNo">458</span>    System.out.println("isAllModified " + isAllModified());<a name="line.458"></a>
-<span class="sourceLineNo">459</span>    System.out.println("isEmpty " + isEmpty());<a name="line.459"></a>
-<span class="sourceLineNo">460</span>    for (Map.Entry&lt;Long, BitSetNode&gt; entry : map.entrySet()) {<a name="line.460"></a>
-<span class="sourceLineNo">461</span>      entry.getValue().dump();<a name="line.461"></a>
-<span class="sourceLineNo">462</span>    }<a name="line.462"></a>
-<span class="sourceLineNo">463</span>  }<a name="line.463"></a>
-<span class="sourceLineNo">464</span><a name="line.464"></a>
-<span class="sourceLineNo">465</span>  // ========================================================================<a name="line.465"></a>
-<span class="sourceLineNo">466</span>  //  Convert to/from Protocol Buffer.<a name="line.466"></a>
-<span class="sourceLineNo">467</span>  // ========================================================================<a name="line.467"></a>
-<span class="sourceLineNo">468</span><a name="line.468"></a>
-<span class="sourceLineNo">469</span>  /**<a name="line.469"></a>
-<span class="sourceLineNo">470</span>   * Builds<a name="line.470"></a>
-<span class="sourceLineNo">471</span>   * org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.ProcedureStoreTracker<a name="line.471"></a>
-<span class="sourceLineNo">472</span>   * protocol buffer from current state.<a name="line.472"></a>
-<span class="sourceLineNo">473</span>   */<a name="line.473"></a>
-<span class="sourceLineNo">474</span>  public ProcedureProtos.ProcedureStoreTracker toProto() throws IOException {<a name="line.474"></a>
-<span class="sourceLineNo">475</span>    ProcedureProtos.ProcedureStoreTracker.Builder builder =<a name="line.475"></a>
-<span class="sourceLineNo">476</span>        ProcedureProtos.ProcedureStoreTracker.newBuilder();<a name="line.476"></a>
-<span class="sourceLineNo">477</span>    for (Map.Entry&lt;Long, BitSetNode&gt; entry : map.entrySet()) {<a name="line.477"></a>
-<span class="sourceLineNo">478</span>      builder.addNode(entry.getValue().convert());<a name="line.478"></a>
-<span class="sourceLineNo">479</span>    }<a name="line.479"></a>
-<span class="sourceLineNo">480</span>    return builder.build();<a name="line.480"></a>
-<span class="sourceLineNo">481</span>  }<a name="line.481"></a>
-<span class="sourceLineNo">482</span>}<a name="line.482"></a>
+<span class="sourceLineNo">277</span>    minModifiedProcId = Long.MAX_VALUE;<a name="line.277"></a>
+<span class="sourceLineNo">278</span>    maxModifiedProcId = Long.MIN_VALUE;<a name="line.278"></a>
+<span class="sourceLineNo">279</span>  }<a name="line.279"></a>
+<span class="sourceLineNo">280</span><a name="line.280"></a>
+<span class="sourceLineNo">281</span>  public boolean isModified(long procId) {<a name="line.281"></a>
+<span class="sourceLineNo">282</span>    final Map.Entry&lt;Long, BitSetNode&gt; entry = map.floorEntry(procId);<a name="line.282"></a>
+<span class="sourceLineNo">283</span>    return entry != null &amp;&amp; entry.getValue().contains(procId) &amp;&amp;<a name="line.283"></a>
+<span class="sourceLineNo">284</span>      entry.getValue().isModified(procId);<a name="line.284"></a>
+<span class="sourceLineNo">285</span>  }<a name="line.285"></a>
+<span class="sourceLineNo">286</span><a name="line.286"></a>
+<span class="sourceLineNo">287</span>  /**<a name="line.287"></a>
+<span class="sourceLineNo">288</span>   * If {@link #partial} is false, returns state from the bitmap. If no state is found for<a name="line.288"></a>
+<span class="sourceLineNo">289</span>   * {@code procId}, returns YES.<a name="line.289"></a>
+<span class="sourceLineNo">290</span>   * If partial is true, tracker doesn't have complete view of system state, so it returns MAYBE<a name="line.290"></a>
+<span class="sourceLineNo">291</span>   * if there is no update for the procedure or if it doesn't have a state in bitmap. Otherwise,<a name="line.291"></a>
+<span class="sourceLineNo">292</span>   * returns state from the bitmap.<a name="line.292"></a>
+<span class="sourceLineNo">293</span>   */<a name="line.293"></a>
+<span class="sourceLineNo">294</span>  public DeleteState isDeleted(long procId) {<a name="line.294"></a>
+<span class="sourceLineNo">295</span>    Map.Entry&lt;Long, BitSetNode&gt; entry = map.floorEntry(procId);<a name="line.295"></a>
+<span class="sourceLineNo">296</span>    if (entry != null &amp;&amp; entry.getValue().contains(procId)) {<a name="line.296"></a>
+<span class="sourceLineNo">297</span>      BitSetNode node = entry.getValue();<a name="line.297"></a>
+<span class="sourceLineNo">298</span>      DeleteState state = node.isDeleted(procId);<a name="line.298"></a>
+<span class="sourceLineNo">299</span>      return partial &amp;&amp; !node.isModified(procId) ? DeleteState.MAYBE : state;<a name="line.299"></a>
+<span class="sourceLineNo">300</span>    }<a name="line.300"></a>
+<span class="sourceLineNo">301</span>    return partial ? DeleteState.MAYBE : DeleteState.YES;<a name="line.301"></a>
+<span class="sourceLineNo">302</span>  }<a name="line.302"></a>
+<span class="sourceLineNo">303</span><a name="line.303"></a>
+<span class="sourceLineNo">304</span>  public long getActiveMinProcId() {<a name="line.304"></a>
+<span class="sourceLineNo">305</span>    Map.Entry&lt;Long, BitSetNode&gt; entry = map.firstEntry();<a name="line.305"></a>
+<span class="sourceLineNo">306</span>    return entry == null ? Procedure.NO_PROC_ID : entry.getValue().getActiveMinProcId();<a name="line.306"></a>
+<span class="sourceLineNo">307</span>  }<a name="line.307"></a>
+<span class="sourceLineNo">308</span><a name="line.308"></a>
+<span class="sourceLineNo">309</span>  public void setKeepDeletes(boolean keepDeletes) {<a name="line.309"></a>
+<span class="sourceLineNo">310</span>    this.keepDeletes = keepDeletes;<a name="line.310"></a>
+<span class="sourceLineNo">311</span>    // If not to keep deletes, remove the BitSetNodes which are empty (i.e. contains ids of deleted<a name="line.311"></a>
+<span class="sourceLineNo">312</span>    // procedures).<a name="line.312"></a>
+<span class="sourceLineNo">313</span>    if (!keepDeletes) {<a name="line.313"></a>
+<span class="sourceLineNo">314</span>      Iterator&lt;Map.Entry&lt;Long, BitSetNode&gt;&gt; it = map.entrySet().iterator();<a name="line.314"></a>
+<span class="sourceLineNo">315</span>      while (it.hasNext()) {<a name="line.315"></a>
+<span class="sourceLineNo">316</span>        Map.Entry&lt;Long, BitSetNode&gt; entry = it.next();<a name="line.316"></a>
+<span class="sourceLineNo">317</span>        if (entry.getValue().isEmpty()) {<a name="line.317"></a>
+<span class="sourceLineNo">318</span>          it.remove();<a name="line.318"></a>
+<span class="sourceLineNo">319</span>        }<a name="line.319"></a>
+<span class="sourceLineNo">320</span>      }<a name="line.320"></a>
+<span class="sourceLineNo">321</span>    }<a name="line.321"></a>
+<span class="sourceLineNo">322</span>  }<a name="line.322"></a>
+<span class="sourceLineNo">323</span><a name="line.323"></a>
+<span class="sourceLineNo">324</span>  public boolean isPartial() {<a name="line.324"></a>
+<span class="sourceLineNo">325</span>    return partial;<a name="line.325"></a>
+<span class="sourceLineNo">326</span>  }<a name="line.326"></a>
+<span class="sourceLineNo">327</span><a name="line.327"></a>
+<span class="sourceLineNo">328</span>  public void setPartialFlag(boolean isPartial) {<a name="line.328"></a>
+<span class="sourceLineNo">329</span>    if (this.partial &amp;&amp; !isPartial) {<a name="line.329"></a>
+<span class="sourceLineNo">330</span>      for (Map.Entry&lt;Long, BitSetNode&gt; entry : map.entrySet()) {<a name="line.330"></a>
+<span class="sourceLineNo">331</span>        entry.getValue().unsetPartialFlag();<a name="line.331"></a>
+<span class="sourceLineNo">332</span>      }<a name="line.332"></a>
+<span class="sourceLineNo">333</span>    }<a name="line.333"></a>
+<span class="sourceLineNo">334</span>    this.partial = isPartial;<a name="line.334"></a>
+<span class="sourceLineNo">335</span>  }<a name="line.335"></a>
+<span class="sourceLineNo">336</span><a name="line.336"></a>
+<span class="sourceLineNo">337</span>  /**<a name="line.337"></a>
+<span class="sourceLineNo">338</span>   * @return true, if no procedure is active, else false.<a name="line.338"></a>
+<span class="sourceLineNo">339</span>   */<a name="line.339"></a>
+<span class="sourceLineNo">340</span>  public boolean isEmpty() {<a name="line.340"></a>
+<span class="sourceLineNo">341</span>    for (Map.Entry&lt;Long, BitSetNode&gt; entry : map.entrySet()) {<a name="line.341"></a>
+<span class="sourceLineNo">342</span>      if (!entry.getValue().isEmpty()) {<a name="line.342"></a>
+<span class="sourceLineNo">343</span>        return false;<a name="line.343"></a>
+<span class="sourceLineNo">344</span>      }<a name="line.344"></a>
+<span class="sourceLineNo">345</span>    }<a name="line.345"></a>
+<span class="sourceLineNo">346</span>    return true;<a name="line.346"></a>
+<span class="sourceLineNo">347</span>  }<a name="line.347"></a>
+<span class="sourceLineNo">348</span><a name="line.348"></a>
+<span class="sourceLineNo">349</span>  /**<a name="line.349"></a>
+<span class="sourceLineNo">350</span>   * @return true if all procedure was modified or deleted since last call to<a name="line.350"></a>
+<span class="sourceLineNo">351</span>   *         {@link #resetModified()}.<a name="line.351"></a>
+<span class="sourceLineNo">352</span>   */<a name="line.352"></a>
+<span class="sourceLineNo">353</span>  public boolean isAllModified() {<a name="line.353"></a>
+<span class="sourceLineNo">354</span>    for (Map.Entry&lt;Long, BitSetNode&gt; entry : map.entrySet()) {<a name="line.354"></a>
+<span class="sourceLineNo">355</span>      if (!entry.getValue().isAllModified()) {<a name="line.355"></a>
+<span class="sourceLineNo">356</span>        return false;<a name="line.356"></a>
+<span class="sourceLineNo">357</span>      }<a name="line.357"></a>
+<span class="sourceLineNo">358</span>    }<a name="line.358"></a>
+<span class="sourceLineNo">359</span>    return true;<a name="line.359"></a>
+<span class="sourceLineNo">360</span>  }<a name="line.360"></a>
+<span class="sourceLineNo">361</span><a name="line.361"></a>
+<span class="sourceLineNo">362</span>  /**<a name="line.362"></a>
+<span class="sourceLineNo">363</span>   * Will be used when there are too many proc wal files. We will rewrite the states of the active<a name="line.363"></a>
+<span class="sourceLineNo">364</span>   * procedures in the oldest proc wal file so that we can delete it.<a name="line.364"></a>
+<span class="sourceLineNo">365</span>   * @return all the active procedure ids in this tracker.<a name="line.365"></a>
+<span class="sourceLineNo">366</span>   */<a name="line.366"></a>
+<span class="sourceLineNo">367</span>  public long[] getAllActiveProcIds() {<a name="line.367"></a>
+<span class="sourceLineNo">368</span>    return map.values().stream().map(BitSetNode::getActiveProcIds).filter(p -&gt; p.length &gt; 0)<a name="line.368"></a>
+<span class="sourceLineNo">369</span>      .flatMapToLong(LongStream::of).toArray();<a name="line.369"></a>
+<span class="sourceLineNo">370</span>  }<a name="line.370"></a>
+<span class="sourceLineNo">371</span><a name="line.371"></a>
+<span class="sourceLineNo">372</span>  /**<a name="line.372"></a>
+<span class="sourceLineNo">373</span>   * Clears the list of updated procedure ids. This doesn't affect global list of active<a name="line.373"></a>
+<span class="sourceLineNo">374</span>   * procedure ids.<a name="line.374"></a>
+<span class="sourceLineNo">375</span>   */<a name="line.375"></a>
+<span class="sourceLineNo">376</span>  public void resetModified() {<a name="line.376"></a>
+<span class="sourceLineNo">377</span>    for (Map.Entry&lt;Long, BitSetNode&gt; entry : map.entrySet()) {<a name="line.377"></a>
+<span class="sourceLineNo">378</span>      entry.getValue().resetModified();<a name="line.378"></a>
+<span class="sourceLineNo">379</span>    }<a name="line.379"></a>
+<span class="sourceLineNo">380</span>    minModifiedProcId = Long.MAX_VALUE;<a name="line.380"></a>
+<span class="sourceLineNo">381</span>    maxModifiedProcId = Long.MIN_VALUE;<a name="line.381"></a>
+<span class="sourceLineNo">382</span>  }<a name="line.382"></a>
+<span class="sourceLineNo">383</span><a name="line.383"></a>
+<span class="sourceLineNo">384</span>  private BitSetNode getOrCreateNode(long procId) {<a name="line.384"></a>
+<span class="sourceLineNo">385</span>    // If procId can fit in left node (directly or by growing it)<a name="line.385"></a>
+<span class="sourceLineNo">386</span>    BitSetNode leftNode = null;<a name="line.386"></a>
+<span class="sourceLineNo">387</span>    boolean leftCanGrow = false;<a name="line.387"></a>
+<span class="sourceLineNo">388</span>    Map.Entry&lt;Long, BitSetNode&gt; leftEntry = map.floorEntry(procId);<a name="line.388"></a>
+<span class="sourceLineNo">389</span>    if (leftEntry != null) {<a name="line.389"></a>
+<span class="sourceLineNo">390</span>      leftNode = leftEntry.getValue();<a name="line.390"></a>
+<span class="sourceLineNo">391</span>      if (leftNode.contains(procId)) {<a name="line.391"></a>
+<span class="sourceLineNo">392</span>        return leftNode;<a name="line.392"></a>
+<span class="sourceLineNo">393</span>      }<a name="line.393"></a>
+<span class="sourceLineNo">394</span>      leftCanGrow = leftNode.canGrow(procId);<a name="line.394"></a>
+<span class="sourceLineNo">395</span>    }<a name="line.395"></a>
+<span class="sourceLineNo">396</span><a name="line.396"></a>
+<span class="sourceLineNo">397</span>    // If procId can fit in right node (directly or by growing it)<a name="line.397"></a>
+<span class="sourceLineNo">398</span>    BitSetNode rightNode = null;<a name="line.398"></a>
+<span class="sourceLineNo">399</span>    boolean rightCanGrow = false;<a name="line.399"></a>
+<span class="sourceLineNo">400</span>    Map.Entry&lt;Long, BitSetNode&gt; rightEntry = map.ceilingEntry(procId);<a name="line.400"></a>
+<span class="sourceLineNo">401</span>    if (rightEntry != null) {<a name="line.401"></a>
+<span class="sourceLineNo">402</span>      rightNode = rightEntry.getValue();<a name="line.402"></a>
+<span class="sourceLineNo">403</span>      rightCanGrow = rightNode.canGrow(procId);<a name="line.403"></a>
+<span class="sourceLineNo">404</span>      if (leftNode != null) {<a name="line.404"></a>
+<span class="sourceLineNo">405</span>        if (leftNode.canMerge(rightNode)) {<a name="line.405"></a>
+<span class="sourceLineNo">406</span>          // merge left and right node<a name="line.406"></a>
+<span class="sourceLineNo">407</span>          return mergeNodes(leftNode, rightNode);<a name="line.407"></a>
+<span class="sourceLineNo">408</span>        }<a name="line.408"></a>
+<span class="sourceLineNo">409</span><a name="line.409"></a>
+<span class="sourceLineNo">410</span>        // If left and right nodes can not merge, decide which one to grow.<a name="line.410"></a>
+<span class="sourceLineNo">411</span>        if (leftCanGrow &amp;&amp; rightCanGrow) {<a name="line.411"></a>
+<span class="sourceLineNo">412</span>          if ((procId - leftNode.getEnd()) &lt;= (rightNode.getStart() - procId)) {<a name="line.412"></a>
+<span class="sourceLineNo">413</span>            return growNode(leftNode, procId);<a name="line.413"></a>
+<span class="sourceLineNo">414</span>          }<a name="line.414"></a>
+<span class="sourceLineNo">415</span>          return growNode(rightNode, procId);<a name="line.415"></a>
+<span class="sourceLineNo">416</span>        }<a name="line.416"></a>
+<span class="sourceLineNo">417</span>      }<a name="line.417"></a>
+<span class="sourceLineNo">418</span>    }<a name="line.418"></a>
+<span class="sourceLineNo">419</span><a name="line.419"></a>
+<span class="sourceLineNo">420</span>    // grow the left node<a name="line.420"></a>
+<span class="sourceLineNo">421</span>    if (leftCanGrow) {<a name="line.421"></a>
+<span class="sourceLineNo">422</span>      return growNode(leftNode, procId);<a name="line.422"></a>
+<span class="sourceLineNo">423</span>    }<a name="line.423"></a>
+<span class="sourceLineNo">424</span><a name="line.424"></a>
+<span class="sourceLineNo">425</span>    // grow the right node<a name="line.425"></a>
+<span class="sourceLineNo">426</span>    if (rightCanGrow) {<a name="line.426"></a>
+<span class="sourceLineNo">427</span>      return growNode(rightNode, procId);<a name="line.427"></a>
+<span class="sourceLineNo">428</span>    }<a name="line.428"></a>
+<span class="sourceLineNo">429</span><a name="line.429"></a>
+<span class="sourceLineNo">430</span>    // add new node if there are no left/right nodes which can be used.<a name="line.430"></a>
+<span class="sourceLineNo">431</span>    BitSetNode node = new BitSetNode(procId, partial);<a name="line.431"></a>
+<span class="sourceLineNo">432</span>    map.put(node.getStart(), node);<a name="line.432"></a>
+<span class="sourceLineNo">433</span>    return node;<a name="line.433"></a>
+<span class="sourceLineNo">434</span>  }<a name="line.434"></a>
+<span class="sourceLineNo">435</span><a name="line.435"></a>
+<span class="sourceLineNo">436</span>  /**<a name="line.436"></a>
+<span class="sourceLineNo">437</span>   * Grows {@code node} to contain {@code procId} and updates the map.<a name="line.437"></a>
+<span class="sourceLineNo">438</span>   * @return {@link BitSetNode} instance which contains {@code procId}.<a name="line.438"></a>
+<span class="sourceLineNo">439</span>   */<a name="line.439"></a>
+<span class="sourceLineNo">440</span>  private BitSetNode growNode(BitSetNode node, long procId) {<a name="line.440"></a>
+<span class="sourceLineNo">441</span>    map.remove(node.getStart());<a name="line.441"></a>
+<span class="sourceLineNo">442</span>    node.grow(procId);<a name="line.442"></a>
+<span class="sourceLineNo">443</span>    map.put(node.getStart(), node);<a name="line.443"></a>
+<span class="sourceLineNo">444</span>    return node;<a name="line.444"></a>
+<span class="sourceLineNo">445</span>  }<a name="line.445"></a>
+<span class="sourceLineNo">446</span><a name="line.446"></a>
+<span class="sourceLineNo">447</span>  /**<a name="line.447"></a>
+<span class="sourceLineNo">448</span>   * Merges {@code leftNode} &amp; {@code rightNode} and updates the map.<a name="line.448"></a>
+<span class="sourceLineNo">449</span>   */<a name="line.449"></a>
+<span class="sourceLineNo">450</span>  private BitSetNode mergeNodes(BitSetNode leftNode, BitSetNode rightNode) {<a name="line.450"></a>
+<span class="sourceLineNo">451</span>    assert leftNode.getStart() &lt; rightNode.getStart();<a name="line.451"></a>
+<span class="sourceLineNo">452</span>    leftNode.merge(rightNode);<a name="line.452"></a>
+<span class="sourceLineNo">453</span>    map.remove(rightNode.getStart());<a name="line.453"></a>
+<span class="sourceLineNo">454</span>    return leftNode;<a name="line.454"></a>
+<span class="sourceLineNo">455</span>  }<a name="line.455"></a>
+<span class="sourceLineNo">456</span><a name="line.456"></a>
+<span class="sourceLineNo">457</span>  public void dump() {<a name="line.457"></a>
+<span class="sourceLineNo">458</span>    System.out.println("map " + map.size());<a name="line.458"></a>
+<span class="sourceLineNo">459</span>    System.out.println("isAllModified " + isAllModified());<a name="line.459"></a>
+<span class="sourceLineNo">460</span>    System.out.println("isEmpty " + isEmpty());<a name="line.460"></a>
+<span class="sourceLineNo">461</span>    for (Map.Entry&lt;Long, BitSetNode&gt; entry : map.entrySet()) {<a name="line.461"></a>
+<span class="sourceLineNo">462</span>      entry.getValue().dump();<a name="line.462"></a>
+<span class="sourceLineNo">463</span>    }<a name="line.463"></a>
+<span class="sourceLineNo">464</span>  }<a name="line.464"></a>
+<span class="sourceLineNo">465</span><a name="line.465"></a>
+<span class="sourceLineNo">466</span>  // ========================================================================<a name="line.466"></a>
+<span class="sourceLineNo">467</span>  //  Convert to/from Protocol Buffer.<a name="line.467"></a>
+<span class="sourceLineNo">468</span>  // ========================================================================<a name="line.468"></a>
+<span class="sourceLineNo">469</span><a name="line.469"></a>
+<span class="sourceLineNo">470</span>  /**<a name="line.470"></a>
+<span class="sourceLineNo">471</span>   * Builds<a name="line.471"></a>
+<span class="sourceLineNo">472</span>   * org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.ProcedureStoreTracker<a name="line.472"></a>
+<span class="sourceLineNo">473</span>   * protocol buffer from current state.<a name="line.473"></a>
+<span class="sourceLineNo">474</span>   */<a name="line.474"></a>
+<span class="sourceLineNo">475</span>  public ProcedureProtos.ProcedureStoreTracker toProto() throws IOException {<a name="line.475"></a>
+<span class="sourceLineNo">476</span>    ProcedureProtos.ProcedureStoreTracker.Builder builder =<a name="line.476"></a>
+<span class="sourceLineNo">477</span>        ProcedureProtos.ProcedureStoreTracker.newBuilder();<a name="line.477"></a>
+<span class="sourceLineNo">478</span>    for (Map.Entry&lt;Long, BitSetNode&gt; entry : map.entrySet()) {<a name="line.478"></a>
+<span class="sourceLineNo">479</span>      builder.addNode(entry.getValue().convert());<a name="line.479"></a>
+<span class="sourceLineNo">480</span>    }<a name="line.480"></a>
+<span class="sourceLineNo">481</span>    return builder.build();<a name="line.481"></a>
+<span class="sourceLineNo">482</span>  }<a name="line.482"></a>
+<span class="sourceLineNo">483</span>}<a name="line.483"></a>
 
 
 
index 5fc97ee..2cc0fc9 100644 (file)
 <span class="sourceLineNo">274</span>    this.keepDeletes = false;<a name="line.274"></a>
 <span class="sourceLineNo">275</span>    this.partial = false;<a name="line.275"></a>
 <span class="sourceLineNo">276</span>    this.map.clear();<a name="line.276"></a>
-<span class="sourceLineNo">277</span>    resetModified();<a name="line.277"></a>
-<span class="sourceLineNo">278</span>  }<a name="line.278"></a>
-<span class="sourceLineNo">279</span><a name="line.279"></a>
-<span class="sourceLineNo">280</span>  public boolean isModified(long procId) {<a name="line.280"></a>
-<span class="sourceLineNo">281</span>    final Map.Entry&lt;Long, BitSetNode&gt; entry = map.floorEntry(procId);<a name="line.281"></a>
-<span class="sourceLineNo">282</span>    return entry != null &amp;&amp; entry.getValue().contains(procId) &amp;&amp;<a name="line.282"></a>
-<span class="sourceLineNo">283</span>      entry.getValue().isModified(procId);<a name="line.283"></a>
-<span class="sourceLineNo">284</span>  }<a name="line.284"></a>
-<span class="sourceLineNo">285</span><a name="line.285"></a>
-<span class="sourceLineNo">286</span>  /**<a name="line.286"></a>
-<span class="sourceLineNo">287</span>   * If {@link #partial} is false, returns state from the bitmap. If no state is found for<a name="line.287"></a>
-<span class="sourceLineNo">288</span>   * {@code procId}, returns YES.<a name="line.288"></a>
-<span class="sourceLineNo">289</span>   * If partial is true, tracker doesn't have complete view of system state, so it returns MAYBE<a name="line.289"></a>
-<span class="sourceLineNo">290</span>   * if there is no update for the procedure or if it doesn't have a state in bitmap. Otherwise,<a name="line.290"></a>
-<span class="sourceLineNo">291</span>   * returns state from the bitmap.<a name="line.291"></a>
-<span class="sourceLineNo">292</span>   */<a name="line.292"></a>
-<span class="sourceLineNo">293</span>  public DeleteState isDeleted(long procId) {<a name="line.293"></a>
-<span class="sourceLineNo">294</span>    Map.Entry&lt;Long, BitSetNode&gt; entry = map.floorEntry(procId);<a name="line.294"></a>
-<span class="sourceLineNo">295</span>    if (entry != null &amp;&amp; entry.getValue().contains(procId)) {<a name="line.295"></a>
-<span class="sourceLineNo">296</span>      BitSetNode node = entry.getValue();<a name="line.296"></a>
-<span class="sourceLineNo">297</span>      DeleteState state = node.isDeleted(procId);<a name="line.297"></a>
-<span class="sourceLineNo">298</span>      return partial &amp;&amp; !node.isModified(procId) ? DeleteState.MAYBE : state;<a name="line.298"></a>
-<span class="sourceLineNo">299</span>    }<a name="line.299"></a>
-<span class="sourceLineNo">300</span>    return partial ? DeleteState.MAYBE : DeleteState.YES;<a name="line.300"></a>
-<span class="sourceLineNo">301</span>  }<a name="line.301"></a>
-<span class="sourceLineNo">302</span><a name="line.302"></a>
-<span class="sourceLineNo">303</span>  public long getActiveMinProcId() {<a name="line.303"></a>
-<span class="sourceLineNo">304</span>    Map.Entry&lt;Long, BitSetNode&gt; entry = map.firstEntry();<a name="line.304"></a>
-<span class="sourceLineNo">305</span>    return entry == null ? Procedure.NO_PROC_ID : entry.getValue().getActiveMinProcId();<a name="line.305"></a>
-<span class="sourceLineNo">306</span>  }<a name="line.306"></a>
-<span class="sourceLineNo">307</span><a name="line.307"></a>
-<span class="sourceLineNo">308</span>  public void setKeepDeletes(boolean keepDeletes) {<a name="line.308"></a>
-<span class="sourceLineNo">309</span>    this.keepDeletes = keepDeletes;<a name="line.309"></a>
-<span class="sourceLineNo">310</span>    // If not to keep deletes, remove the BitSetNodes which are empty (i.e. contains ids of deleted<a name="line.310"></a>
-<span class="sourceLineNo">311</span>    // procedures).<a name="line.311"></a>
-<span class="sourceLineNo">312</span>    if (!keepDeletes) {<a name="line.312"></a>
-<span class="sourceLineNo">313</span>      Iterator&lt;Map.Entry&lt;Long, BitSetNode&gt;&gt; it = map.entrySet().iterator();<a name="line.313"></a>
-<span class="sourceLineNo">314</span>      while (it.hasNext()) {<a name="line.314"></a>
-<span class="sourceLineNo">315</span>        Map.Entry&lt;Long, BitSetNode&gt; entry = it.next();<a name="line.315"></a>
-<span class="sourceLineNo">316</span>        if (entry.getValue().isEmpty()) {<a name="line.316"></a>
-<span class="sourceLineNo">317</span>          it.remove();<a name="line.317"></a>
-<span class="sourceLineNo">318</span>        }<a name="line.318"></a>
-<span class="sourceLineNo">319</span>      }<a name="line.319"></a>
-<span class="sourceLineNo">320</span>    }<a name="line.320"></a>
-<span class="sourceLineNo">321</span>  }<a name="line.321"></a>
-<span class="sourceLineNo">322</span><a name="line.322"></a>
-<span class="sourceLineNo">323</span>  public boolean isPartial() {<a name="line.323"></a>
-<span class="sourceLineNo">324</span>    return partial;<a name="line.324"></a>
-<span class="sourceLineNo">325</span>  }<a name="line.325"></a>
-<span class="sourceLineNo">326</span><a name="line.326"></a>
-<span class="sourceLineNo">327</span>  public void setPartialFlag(boolean isPartial) {<a name="line.327"></a>
-<span class="sourceLineNo">328</span>    if (this.partial &amp;&amp; !isPartial) {<a name="line.328"></a>
-<span class="sourceLineNo">329</span>      for (Map.Entry&lt;Long, BitSetNode&gt; entry : map.entrySet()) {<a name="line.329"></a>
-<span class="sourceLineNo">330</span>        entry.getValue().unsetPartialFlag();<a name="line.330"></a>
-<span class="sourceLineNo">331</span>      }<a name="line.331"></a>
-<span class="sourceLineNo">332</span>    }<a name="line.332"></a>
-<span class="sourceLineNo">333</span>    this.partial = isPartial;<a name="line.333"></a>
-<span class="sourceLineNo">334</span>  }<a name="line.334"></a>
-<span class="sourceLineNo">335</span><a name="line.335"></a>
-<span class="sourceLineNo">336</span>  /**<a name="line.336"></a>
-<span class="sourceLineNo">337</span>   * @return true, if no procedure is active, else false.<a name="line.337"></a>
-<span class="sourceLineNo">338</span>   */<a name="line.338"></a>
-<span class="sourceLineNo">339</span>  public boolean isEmpty() {<a name="line.339"></a>
-<span class="sourceLineNo">340</span>    for (Map.Entry&lt;Long, BitSetNode&gt; entry : map.entrySet()) {<a name="line.340"></a>
-<span class="sourceLineNo">341</span>      if (!entry.getValue().isEmpty()) {<a name="line.341"></a>
-<span class="sourceLineNo">342</span>        return false;<a name="line.342"></a>
-<span class="sourceLineNo">343</span>      }<a name="line.343"></a>
-<span class="sourceLineNo">344</span>    }<a name="line.344"></a>
-<span class="sourceLineNo">345</span>    return true;<a name="line.345"></a>
-<span class="sourceLineNo">346</span>  }<a name="line.346"></a>
-<span class="sourceLineNo">347</span><a name="line.347"></a>
-<span class="sourceLineNo">348</span>  /**<a name="line.348"></a>
-<span class="sourceLineNo">349</span>   * @return true if all procedure was modified or deleted since last call to<a name="line.349"></a>
-<span class="sourceLineNo">350</span>   *         {@link #resetModified()}.<a name="line.350"></a>
-<span class="sourceLineNo">351</span>   */<a name="line.351"></a>
-<span class="sourceLineNo">352</span>  public boolean isAllModified() {<a name="line.352"></a>
-<span class="sourceLineNo">353</span>    for (Map.Entry&lt;Long, BitSetNode&gt; entry : map.entrySet()) {<a name="line.353"></a>
-<span class="sourceLineNo">354</span>      if (!entry.getValue().isAllModified()) {<a name="line.354"></a>
-<span class="sourceLineNo">355</span>        return false;<a name="line.355"></a>
-<span class="sourceLineNo">356</span>      }<a name="line.356"></a>
-<span class="sourceLineNo">357</span>    }<a name="line.357"></a>
-<span class="sourceLineNo">358</span>    return true;<a name="line.358"></a>
-<span class="sourceLineNo">359</span>  }<a name="line.359"></a>
-<span class="sourceLineNo">360</span><a name="line.360"></a>
-<span class="sourceLineNo">361</span>  /**<a name="line.361"></a>
-<span class="sourceLineNo">362</span>   * Will be used when there are too many proc wal files. We will rewrite the states of the active<a name="line.362"></a>
-<span class="sourceLineNo">363</span>   * procedures in the oldest proc wal file so that we can delete it.<a name="line.363"></a>
-<span class="sourceLineNo">364</span>   * @return all the active procedure ids in this tracker.<a name="line.364"></a>
-<span class="sourceLineNo">365</span>   */<a name="line.365"></a>
-<span class="sourceLineNo">366</span>  public long[] getAllActiveProcIds() {<a name="line.366"></a>
-<span class="sourceLineNo">367</span>    return map.values().stream().map(BitSetNode::getActiveProcIds).filter(p -&gt; p.length &gt; 0)<a name="line.367"></a>
-<span class="sourceLineNo">368</span>      .flatMapToLong(LongStream::of).toArray();<a name="line.368"></a>
-<span class="sourceLineNo">369</span>  }<a name="line.369"></a>
-<span class="sourceLineNo">370</span><a name="line.370"></a>
-<span class="sourceLineNo">371</span>  /**<a name="line.371"></a>
-<span class="sourceLineNo">372</span>   * Clears the list of updated procedure ids. This doesn't affect global list of active<a name="line.372"></a>
-<span class="sourceLineNo">373</span>   * procedure ids.<a name="line.373"></a>
-<span class="sourceLineNo">374</span>   */<a name="line.374"></a>
-<span class="sourceLineNo">375</span>  public void resetModified() {<a name="line.375"></a>
-<span class="sourceLineNo">376</span>    for (Map.Entry&lt;Long, BitSetNode&gt; entry : map.entrySet()) {<a name="line.376"></a>
-<span class="sourceLineNo">377</span>      entry.getValue().resetModified();<a name="line.377"></a>
-<span class="sourceLineNo">378</span>    }<a name="line.378"></a>
-<span class="sourceLineNo">379</span>    minModifiedProcId = Long.MAX_VALUE;<a name="line.379"></a>
-<span class="sourceLineNo">380</span>    maxModifiedProcId = Long.MIN_VALUE;<a name="line.380"></a>
-<span class="sourceLineNo">381</span>  }<a name="line.381"></a>
-<span class="sourceLineNo">382</span><a name="line.382"></a>
-<span class="sourceLineNo">383</span>  private BitSetNode getOrCreateNode(long procId) {<a name="line.383"></a>
-<span class="sourceLineNo">384</span>    // If procId can fit in left node (directly or by growing it)<a name="line.384"></a>
-<span class="sourceLineNo">385</span>    BitSetNode leftNode = null;<a name="line.385"></a>
-<span class="sourceLineNo">386</span>    boolean leftCanGrow = false;<a name="line.386"></a>
-<span class="sourceLineNo">387</span>    Map.Entry&lt;Long, BitSetNode&gt; leftEntry = map.floorEntry(procId);<a name="line.387"></a>
-<span class="sourceLineNo">388</span>    if (leftEntry != null) {<a name="line.388"></a>
-<span class="sourceLineNo">389</span>      leftNode = leftEntry.getValue();<a name="line.389"></a>
-<span class="sourceLineNo">390</span>      if (leftNode.contains(procId)) {<a name="line.390"></a>
-<span class="sourceLineNo">391</span>        return leftNode;<a name="line.391"></a>
-<span class="sourceLineNo">392</span>      }<a name="line.392"></a>
-<span class="sourceLineNo">393</span>      leftCanGrow = leftNode.canGrow(procId);<a name="line.393"></a>
-<span class="sourceLineNo">394</span>    }<a name="line.394"></a>
-<span class="sourceLineNo">395</span><a name="line.395"></a>
-<span class="sourceLineNo">396</span>    // If procId can fit in right node (directly or by growing it)<a name="line.396"></a>
-<span class="sourceLineNo">397</span>    BitSetNode rightNode = null;<a name="line.397"></a>
-<span class="sourceLineNo">398</span>    boolean rightCanGrow = false;<a name="line.398"></a>
-<span class="sourceLineNo">399</span>    Map.Entry&lt;Long, BitSetNode&gt; rightEntry = map.ceilingEntry(procId);<a name="line.399"></a>
-<span class="sourceLineNo">400</span>    if (rightEntry != null) {<a name="line.400"></a>
-<span class="sourceLineNo">401</span>      rightNode = rightEntry.getValue();<a name="line.401"></a>
-<span class="sourceLineNo">402</span>      rightCanGrow = rightNode.canGrow(procId);<a name="line.402"></a>
-<span class="sourceLineNo">403</span>      if (leftNode != null) {<a name="line.403"></a>
-<span class="sourceLineNo">404</span>        if (leftNode.canMerge(rightNode)) {<a name="line.404"></a>
-<span class="sourceLineNo">405</span>          // merge left and right node<a name="line.405"></a>
-<span class="sourceLineNo">406</span>          return mergeNodes(leftNode, rightNode);<a name="line.406"></a>
-<span class="sourceLineNo">407</span>        }<a name="line.407"></a>
-<span class="sourceLineNo">408</span><a name="line.408"></a>
-<span class="sourceLineNo">409</span>        // If left and right nodes can not merge, decide which one to grow.<a name="line.409"></a>
-<span class="sourceLineNo">410</span>        if (leftCanGrow &amp;&amp; rightCanGrow) {<a name="line.410"></a>
-<span class="sourceLineNo">411</span>          if ((procId - leftNode.getEnd()) &lt;= (rightNode.getStart() - procId)) {<a name="line.411"></a>
-<span class="sourceLineNo">412</span>            return growNode(leftNode, procId);<a name="line.412"></a>
-<span class="sourceLineNo">413</span>          }<a name="line.413"></a>
-<span class="sourceLineNo">414</span>          return growNode(rightNode, procId);<a name="line.414"></a>
-<span class="sourceLineNo">415</span>        }<a name="line.415"></a>
-<span class="sourceLineNo">416</span>      }<a name="line.416"></a>
-<span class="sourceLineNo">417</span>    }<a name="line.417"></a>
-<span class="sourceLineNo">418</span><a name="line.418"></a>
-<span class="sourceLineNo">419</span>    // grow the left node<a name="line.419"></a>
-<span class="sourceLineNo">420</span>    if (leftCanGrow) {<a name="line.420"></a>
-<span class="sourceLineNo">421</span>      return growNode(leftNode, procId);<a name="line.421"></a>
-<span class="sourceLineNo">422</span>    }<a name="line.422"></a>
-<span class="sourceLineNo">423</span><a name="line.423"></a>
-<span class="sourceLineNo">424</span>    // grow the right node<a name="line.424"></a>
-<span class="sourceLineNo">425</span>    if (rightCanGrow) {<a name="line.425"></a>
-<span class="sourceLineNo">426</span>      return growNode(rightNode, procId);<a name="line.426"></a>
-<span class="sourceLineNo">427</span>    }<a name="line.427"></a>
-<span class="sourceLineNo">428</span><a name="line.428"></a>
-<span class="sourceLineNo">429</span>    // add new node if there are no left/right nodes which can be used.<a name="line.429"></a>
-<span class="sourceLineNo">430</span>    BitSetNode node = new BitSetNode(procId, partial);<a name="line.430"></a>
-<span class="sourceLineNo">431</span>    map.put(node.getStart(), node);<a name="line.431"></a>
-<span class="sourceLineNo">432</span>    return node;<a name="line.432"></a>
-<span class="sourceLineNo">433</span>  }<a name="line.433"></a>
-<span class="sourceLineNo">434</span><a name="line.434"></a>
-<span class="sourceLineNo">435</span>  /**<a name="line.435"></a>
-<span class="sourceLineNo">436</span>   * Grows {@code node} to contain {@code procId} and updates the map.<a name="line.436"></a>
-<span class="sourceLineNo">437</span>   * @return {@link BitSetNode} instance which contains {@code procId}.<a name="line.437"></a>
-<span class="sourceLineNo">438</span>   */<a name="line.438"></a>
-<span class="sourceLineNo">439</span>  private BitSetNode growNode(BitSetNode node, long procId) {<a name="line.439"></a>
-<span class="sourceLineNo">440</span>    map.remove(node.getStart());<a name="line.440"></a>
-<span class="sourceLineNo">441</span>    node.grow(procId);<a name="line.441"></a>
-<span class="sourceLineNo">442</span>    map.put(node.getStart(), node);<a name="line.442"></a>
-<span class="sourceLineNo">443</span>    return node;<a name="line.443"></a>
-<span class="sourceLineNo">444</span>  }<a name="line.444"></a>
-<span class="sourceLineNo">445</span><a name="line.445"></a>
-<span class="sourceLineNo">446</span>  /**<a name="line.446"></a>
-<span class="sourceLineNo">447</span>   * Merges {@code leftNode} &amp; {@code rightNode} and updates the map.<a name="line.447"></a>
-<span class="sourceLineNo">448</span>   */<a name="line.448"></a>
-<span class="sourceLineNo">449</span>  private BitSetNode mergeNodes(BitSetNode leftNode, BitSetNode rightNode) {<a name="line.449"></a>
-<span class="sourceLineNo">450</span>    assert leftNode.getStart() &lt; rightNode.getStart();<a name="line.450"></a>
-<span class="sourceLineNo">451</span>    leftNode.merge(rightNode);<a name="line.451"></a>
-<span class="sourceLineNo">452</span>    map.remove(rightNode.getStart());<a name="line.452"></a>
-<span class="sourceLineNo">453</span>    return leftNode;<a name="line.453"></a>
-<span class="sourceLineNo">454</span>  }<a name="line.454"></a>
-<span class="sourceLineNo">455</span><a name="line.455"></a>
-<span class="sourceLineNo">456</span>  public void dump() {<a name="line.456"></a>
-<span class="sourceLineNo">457</span>    System.out.println("map " + map.size());<a name="line.457"></a>
-<span class="sourceLineNo">458</span>    System.out.println("isAllModified " + isAllModified());<a name="line.458"></a>
-<span class="sourceLineNo">459</span>    System.out.println("isEmpty " + isEmpty());<a name="line.459"></a>
-<span class="sourceLineNo">460</span>    for (Map.Entry&lt;Long, BitSetNode&gt; entry : map.entrySet()) {<a name="line.460"></a>
-<span class="sourceLineNo">461</span>      entry.getValue().dump();<a name="line.461"></a>
-<span class="sourceLineNo">462</span>    }<a name="line.462"></a>
-<span class="sourceLineNo">463</span>  }<a name="line.463"></a>
-<span class="sourceLineNo">464</span><a name="line.464"></a>
-<span class="sourceLineNo">465</span>  // ========================================================================<a name="line.465"></a>
-<span class="sourceLineNo">466</span>  //  Convert to/from Protocol Buffer.<a name="line.466"></a>
-<span class="sourceLineNo">467</span>  // ========================================================================<a name="line.467"></a>
-<span class="sourceLineNo">468</span><a name="line.468"></a>
-<span class="sourceLineNo">469</span>  /**<a name="line.469"></a>
-<span class="sourceLineNo">470</span>   * Builds<a name="line.470"></a>
-<span class="sourceLineNo">471</span>   * org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.ProcedureStoreTracker<a name="line.471"></a>
-<span class="sourceLineNo">472</span>   * protocol buffer from current state.<a name="line.472"></a>
-<span class="sourceLineNo">473</span>   */<a name="line.473"></a>
-<span class="sourceLineNo">474</span>  public ProcedureProtos.ProcedureStoreTracker toProto() throws IOException {<a name="line.474"></a>
-<span class="sourceLineNo">475</span>    ProcedureProtos.ProcedureStoreTracker.Builder builder =<a name="line.475"></a>
-<span class="sourceLineNo">476</span>        ProcedureProtos.ProcedureStoreTracker.newBuilder();<a name="line.476"></a>
-<span class="sourceLineNo">477</span>    for (Map.Entry&lt;Long, BitSetNode&gt; entry : map.entrySet()) {<a name="line.477"></a>
-<span class="sourceLineNo">478</span>      builder.addNode(entry.getValue().convert());<a name="line.478"></a>
-<span class="sourceLineNo">479</span>    }<a name="line.479"></a>
-<span class="sourceLineNo">480</span>    return builder.build();<a name="line.480"></a>
-<span class="sourceLineNo">481</span>  }<a name="line.481"></a>
-<span class="sourceLineNo">482</span>}<a name="line.482"></a>
+<span class="sourceLineNo">277</span>    minModifiedProcId = Long.MAX_VALUE;<a name="line.277"></a>
+<span class="sourceLineNo">278</span>    maxModifiedProcId = Long.MIN_VALUE;<a name="line.278"></a>
+<span class="sourceLineNo">279</span>  }<a name="line.279"></a>
+<span class="sourceLineNo">280</span><a name="line.280"></a>
+<span class="sourceLineNo">281</span>  public boolean isModified(long procId) {<a name="line.281"></a>
+<span class="sourceLineNo">282</span>    final Map.Entry&lt;Long, BitSetNode&gt; entry = map.floorEntry(procId);<a name="line.282"></a>
+<span class="sourceLineNo">283</span>    return entry != null &amp;&amp; entry.getValue().contains(procId) &amp;&amp;<a name="line.283"></a>
+<span class="sourceLineNo">284</span>      entry.getValue().isModified(procId);<a name="line.284"></a>
+<span class="sourceLineNo">285</span>  }<a name="line.285"></a>
+<span class="sourceLineNo">286</span><a name="line.286"></a>
+<span class="sourceLineNo">287</span>  /**<a name="line.287"></a>
+<span class="sourceLineNo">288</span>   * If {@link #partial} is false, returns state from the bitmap. If no state is found for<a name="line.288"></a>
+<span class="sourceLineNo">289</span>   * {@code procId}, returns YES.<a name="line.289"></a>
+<span class="sourceLineNo">290</span>   * If partial is true, tracker doesn't have complete view of system state, so it returns MAYBE<a name="line.290"></a>
+<span class="sourceLineNo">291</span>   * if there is no update for the procedure or if it doesn't have a state in bitmap. Otherwise,<a name="line.291"></a>
+<span class="sourceLineNo">292</span>   * returns state from the bitmap.<a name="line.292"></a>
+<span class="sourceLineNo">293</span>   */<a name="line.293"></a>
+<span class="sourceLineNo">294</span>  public DeleteState isDeleted(long procId) {<a name="line.294"></a>
+<span class="sourceLineNo">295</span>    Map.Entry&lt;Long, BitSetNode&gt; entry = map.floorEntry(procId);<a name="line.295"></a>
+<span class="sourceLineNo">296</span>    if (entry != null &amp;&amp; entry.getValue().contains(procId)) {<a name="line.296"></a>
+<span class="sourceLineNo">297</span>      BitSetNode node = entry.getValue();<a name="line.297"></a>
+<span class="sourceLineNo">298</span>      DeleteState state = node.isDeleted(procId);<a name="line.298"></a>
+<span class="sourceLineNo">299</span>      return partial &amp;&amp; !node.isModified(procId) ? DeleteState.MAYBE : state;<a name="line.299"></a>
+<span class="sourceLineNo">300</span>    }<a name="line.300"></a>
+<span class="sourceLineNo">301</span>    return partial ? DeleteState.MAYBE : DeleteState.YES;<a name="line.301"></a>
+<span class="sourceLineNo">302</span>  }<a name="line.302"></a>
+<span class="sourceLineNo">303</span><a name="line.303"></a>
+<span class="sourceLineNo">304</span>  public long getActiveMinProcId() {<a name="line.304"></a>
+<span class="sourceLineNo">305</span>    Map.Entry&lt;Long, BitSetNode&gt; entry = map.firstEntry();<a name="line.305"></a>
+<span class="sourceLineNo">306</span>    return entry == null ? Procedure.NO_PROC_ID : entry.getValue().getActiveMinProcId();<a name="line.306"></a>
+<span class="sourceLineNo">307</span>  }<a name="line.307"></a>
+<span class="sourceLineNo">308</span><a name="line.308"></a>
+<span class="sourceLineNo">309</span>  public void setKeepDeletes(boolean keepDeletes) {<a name="line.309"></a>
+<span class="sourceLineNo">310</span>    this.keepDeletes = keepDeletes;<a name="line.310"></a>
+<span class="sourceLineNo">311</span>    // If not to keep deletes, remove the BitSetNodes which are empty (i.e. contains ids of deleted<a name="line.311"></a>
+<span class="sourceLineNo">312</span>    // procedures).<a name="line.312"></a>
+<span class="sourceLineNo">313</span>    if (!keepDeletes) {<a name="line.313"></a>
+<span class="sourceLineNo">314</span>      Iterator&lt;Map.Entry&lt;Long, BitSetNode&gt;&gt; it = map.entrySet().iterator();<a name="line.314"></a>
+<span class="sourceLineNo">315</span>      while (it.hasNext()) {<a name="line.315"></a>
+<span class="sourceLineNo">316</span>        Map.Entry&lt;Long, BitSetNode&gt; entry = it.next();<a name="line.316"></a>
+<span class="sourceLineNo">317</span>        if (entry.getValue().isEmpty()) {<a name="line.317"></a>
+<span class="sourceLineNo">318</span>          it.remove();<a name="line.318"></a>
+<span class="sourceLineNo">319</span>        }<a name="line.319"></a>
+<span class="sourceLineNo">320</span>      }<a name="line.320"></a>
+<span class="sourceLineNo">321</span>    }<a name="line.321"></a>
+<span class="sourceLineNo">322</span>  }<a name="line.322"></a>
+<span class="sourceLineNo">323</span><a name="line.323"></a>
+<span class="sourceLineNo">324</span>  public boolean isPartial() {<a name="line.324"></a>
+<span class="sourceLineNo">325</span>    return partial;<a name="line.325"></a>
+<span class="sourceLineNo">326</span>  }<a name="line.326"></a>
+<span class="sourceLineNo">327</span><a name="line.327"></a>
+<span class="sourceLineNo">328</span>  public void setPartialFlag(boolean isPartial) {<a name="line.328"></a>
+<span class="sourceLineNo">329</span>    if (this.partial &amp;&amp; !isPartial) {<a name="line.329"></a>
+<span class="sourceLineNo">330</span>      for (Map.Entry&lt;Long, BitSetNode&gt; entry : map.entrySet()) {<a name="line.330"></a>
+<span class="sourceLineNo">331</span>        entry.getValue().unsetPartialFlag();<a name="line.331"></a>
+<span class="sourceLineNo">332</span>      }<a name="line.332"></a>
+<span class="sourceLineNo">333</span>    }<a name="line.333"></a>
+<span class="sourceLineNo">334</span>    this.partial = isPartial;<a name="line.334"></a>
+<span class="sourceLineNo">335</span>  }<a name="line.335"></a>
+<span class="sourceLineNo">336</span><a name="line.336"></a>
+<span class="sourceLineNo">337</span>  /**<a name="line.337"></a>
+<span class="sourceLineNo">338</span>   * @return true, if no procedure is active, else false.<a name="line.338"></a>
+<span class="sourceLineNo">339</span>   */<a name="line.339"></a>
+<span class="sourceLineNo">340</span>  public boolean isEmpty() {<a name="line.340"></a>
+<span class="sourceLineNo">341</span>    for (Map.Entry&lt;Long, BitSetNode&gt; entry : map.entrySet()) {<a name="line.341"></a>
+<span class="sourceLineNo">342</span>      if (!entry.getValue().isEmpty()) {<a name="line.342"></a>
+<span class="sourceLineNo">343</span>        return false;<a name="line.343"></a>
+<span class="sourceLineNo">344</span>      }<a name="line.344"></a>
+<span class="sourceLineNo">345</span>    }<a name="line.345"></a>
+<span class="sourceLineNo">346</span>    return true;<a name="line.346"></a>
+<span class="sourceLineNo">347</span>  }<a name="line.347"></a>
+<span class="sourceLineNo">348</span><a name="line.348"></a>
+<span class="sourceLineNo">349</span>  /**<a name="line.349"></a>
+<span class="sourceLineNo">350</span>   * @return true if all procedure was modified or deleted since last call to<a name="line.350"></a>
+<span class="sourceLineNo">351</span>   *         {@link #resetModified()}.<a name="line.351"></a>
+<span class="sourceLineNo">352</span>   */<a name="line.352"></a>
+<span class="sourceLineNo">353</span>  public boolean isAllModified() {<a name="line.353"></a>
+<span class="sourceLineNo">354</span>    for (Map.Entry&lt;Long, BitSetNode&gt; entry : map.entrySet()) {<a name="line.354"></a>
+<span class="sourceLineNo">355</span>      if (!entry.getValue().isAllModified()) {<a name="line.355"></a>
+<span class="sourceLineNo">356</span>        return false;<a name="line.356"></a>
+<span class="sourceLineNo">357</span>      }<a name="line.357"></a>
+<span class="sourceLineNo">358</span>    }<a name="line.358"></a>
+<span class="sourceLineNo">359</span>    return true;<a name="line.359"></a>
+<span class="sourceLineNo">360</span>  }<a name="line.360"></a>
+<span class="sourceLineNo">361</span><a name="line.361"></a>
+<span class="sourceLineNo">362</span>  /**<a name="line.362"></a>
+<span class="sourceLineNo">363</span>   * Will be used when there are too many proc wal files. We will rewrite the states of the active<a name="line.363"></a>
+<span class="sourceLineNo">364</span>   * procedures in the oldest proc wal file so that we can delete it.<a name="line.364"></a>
+<span class="sourceLineNo">365</span>   * @return all the active procedure ids in this tracker.<a name="line.365"></a>
+<span class="sourceLineNo">366</span>   */<a name="line.366"></a>
+<span class="sourceLineNo">367</span>  public long[] getAllActiveProcIds() {<a name="line.367"></a>
+<span class="sourceLineNo">368</span>    return map.values().stream().map(BitSetNode::getActiveProcIds).filter(p -&gt; p.length &gt; 0)<a name="line.368"></a>
+<span class="sourceLineNo">369</span>      .flatMapToLong(LongStream::of).toArray();<a name="line.369"></a>
+<span class="sourceLineNo">370</span>  }<a name="line.370"></a>
+<span class="sourceLineNo">371</span><a name="line.371"></a>
+<span class="sourceLineNo">372</span>  /**<a name="line.372"></a>
+<span class="sourceLineNo">373</span>   * Clears the list of updated procedure ids. This doesn't affect global list of active<a name="line.373"></a>
+<span class="sourceLineNo">374</span>   * procedure ids.<a name="line.374"></a>
+<span class="sourceLineNo">375</span>   */<a name="line.375"></a>
+<span class="sourceLineNo">376</span>  public void resetModified() {<a name="line.376"></a>
+<span class="sourceLineNo">377</span>    for (Map.Entry&lt;Long, BitSetNode&gt; entry : map.entrySet()) {<a name="line.377"></a>
+<span class="sourceLineNo">378</span>      entry.getValue().resetModified();<a name="line.378"></a>
+<span class="sourceLineNo">379</span>    }<a name="line.379"></a>
+<span class="sourceLineNo">380</span>    minModifiedProcId = Long.MAX_VALUE;<a name="line.380"></a>
+<span class="sourceLineNo">381</span>    maxModifiedProcId = Long.MIN_VALUE;<a name="line.381"></a>
+<span class="sourceLineNo">382</span>  }<a name="line.382"></a>
+<span class="sourceLineNo">383</span><a name="line.383"></a>
+<span class="sourceLineNo">384</span>  private BitSetNode getOrCreateNode(long procId) {<a name="line.384"></a>
+<span class="sourceLineNo">385</span>    // If procId can fit in left node (directly or by growing it)<a name="line.385"></a>
+<span class="sourceLineNo">386</span>    BitSetNode leftNode = null;<a name="line.386"></a>
+<span class="sourceLineNo">387</span>    boolean leftCanGrow = false;<a name="line.387"></a>
+<span class="sourceLineNo">388</span>    Map.Entry&lt;Long, BitSetNode&gt; leftEntry = map.floorEntry(procId);<a name="line.388"></a>
+<span class="sourceLineNo">389</span>    if (leftEntry != null) {<a name="line.389"></a>
+<span class="sourceLineNo">390</span>      leftNode = leftEntry.getValue();<a name="line.390"></a>
+<span class="sourceLineNo">391</span>      if (leftNode.contains(procId)) {<a name="line.391"></a>
+<span class="sourceLineNo">392</span>        return leftNode;<a name="line.392"></a>
+<span class="sourceLineNo">393</span>      }<a name="line.393"></a>
+<span class="sourceLineNo">394</span>      leftCanGrow = leftNode.canGrow(procId);<a name="line.394"></a>
+<span class="sourceLineNo">395</span>    }<a name="line.395"></a>
+<span class="sourceLineNo">396</span><a name="line.396"></a>
+<span class="sourceLineNo">397</span>    // If procId can fit in right node (directly or by growing it)<a name="line.397"></a>
+<span class="sourceLineNo">398</span>    BitSetNode rightNode = null;<a name="line.398"></a>
+<span class="sourceLineNo">399</span>    boolean rightCanGrow = false;<a name="line.399"></a>
+<span class="sourceLineNo">400</span>    Map.Entry&lt;Long, BitSetNode&gt; rightEntry = map.ceilingEntry(procId);<a name="line.400"></a>
+<span class="sourceLineNo">401</span>    if (rightEntry != null) {<a name="line.401"></a>
+<span class="sourceLineNo">402</span>      rightNode = rightEntry.getValue();<a name="line.402"></a>
+<span class="sourceLineNo">403</span>      rightCanGrow = rightNode.canGrow(procId);<a name="line.403"></a>
+<span class="sourceLineNo">404</span>      if (leftNode != null) {<a name="line.404"></a>
+<span class="sourceLineNo">405</span>        if (leftNode.canMerge(rightNode)) {<a name="line.405"></a>
+<span class="sourceLineNo">406</span>          // merge left and right node<a name="line.406"></a>
+<span class="sourceLineNo">407</span>          return mergeNodes(leftNode, rightNode);<a name="line.407"></a>
+<span class="sourceLineNo">408</span>        }<a name="line.408"></a>
+<span class="sourceLineNo">409</span><a name="line.409"></a>
+<span class="sourceLineNo">410</span>        // If left and right nodes can not merge, decide which one to grow.<a name="line.410"></a>
+<span class="sourceLineNo">411</span>        if (leftCanGrow &amp;&amp; rightCanGrow) {<a name="line.411"></a>
+<span class="sourceLineNo">412</span>          if ((procId - leftNode.getEnd()) &lt;= (rightNode.getStart() - procId)) {<a name="line.412"></a>
+<span class="sourceLineNo">413</span>            return growNode(leftNode, procId);<a name="line.413"></a>
+<span class="sourceLineNo">414</span>          }<a name="line.414"></a>
+<span class="sourceLineNo">415</span>          return growNode(rightNode, procId);<a name="line.415"></a>
+<span class="sourceLineNo">416</span>        }<a name="line.416"></a>
+<span class="sourceLineNo">417</span>      }<a name="line.417"></a>
+<span class="sourceLineNo">418</span>    }<a name="line.418"></a>
+<span class="sourceLineNo">419</span><a name="line.419"></a>
+<span class="sourceLineNo">420</span>    // grow the left node<a name="line.420"></a>
+<span class="sourceLineNo">421</span>    if (leftCanGrow) {<a name="line.421"></a>
+<span class="sourceLineNo">422</span>      return growNode(leftNode, procId);<a name="line.422"></a>
+<span class="sourceLineNo">423</span>    }<a name="line.423"></a>
+<span class="sourceLineNo">424</span><a name="line.424"></a>
+<span class="sourceLineNo">425</span>    // grow the right node<a name="line.425"></a>
+<span class="sourceLineNo">426</span>    if (rightCanGrow) {<a name="line.426"></a>
+<span class="sourceLineNo">427</span>      return growNode(rightNode, procId);<a name="line.427"></a>
+<span class="sourceLineNo">428</span>    }<a name="line.428"></a>
+<span class="sourceLineNo">429</span><a name="line.429"></a>
+<span class="sourceLineNo">430</span>    // add new node if there are no left/right nodes which can be used.<a name="line.430"></a>
+<span class="sourceLineNo">431</span>    BitSetNode node = new BitSetNode(procId, partial);<a name="line.431"></a>
+<span class="sourceLineNo">432</span>    map.put(node.getStart(), node);<a name="line.432"></a>
+<span class="sourceLineNo">433</span>    return node;<a name="line.433"></a>
+<span class="sourceLineNo">434</span>  }<a name="line.434"></a>
+<span class="sourceLineNo">435</span><a name="line.435"></a>
+<span class="sourceLineNo">436</span>  /**<a name="line.436"></a>
+<span class="sourceLineNo">437</span>   * Grows {@code node} to contain {@code procId} and updates the map.<a name="line.437"></a>
+<span class="sourceLineNo">438</span>   * @return {@link BitSetNode} instance which contains {@code procId}.<a name="line.438"></a>
+<span class="sourceLineNo">439</span>   */<a name="line.439"></a>
+<span class="sourceLineNo">440</span>  private BitSetNode growNode(BitSetNode node, long procId) {<a name="line.440"></a>
+<span class="sourceLineNo">441</span>    map.remove(node.getStart());<a name="line.441"></a>
+<span class="sourceLineNo">442</span>    node.grow(procId);<a name="line.442"></a>
+<span class="sourceLineNo">443</span>    map.put(node.getStart(), node);<a name="line.443"></a>
+<span class="sourceLineNo">444</span>    return node;<a name="line.444"></a>
+<span class="sourceLineNo">445</span>  }<a name="line.445"></a>
+<span class="sourceLineNo">446</span><a name="line.446"></a>
+<span class="sourceLineNo">447</span>  /**<a name="line.447"></a>
+<span class="sourceLineNo">448</span>   * Merges {@code leftNode} &amp; {@code rightNode} and updates the map.<a name="line.448"></a>
+<span class="sourceLineNo">449</span>   */<a name="line.449"></a>
+<span class="sourceLineNo">450</span>  private BitSetNode mergeNodes(BitSetNode leftNode, BitSetNode rightNode) {<a name="line.450"></a>
+<span class="sourceLineNo">451</span>    assert leftNode.getStart() &lt; rightNode.getStart();<a name="line.451"></a>
+<span class="sourceLineNo">452</span>    leftNode.merge(rightNode);<a name="line.452"></a>
+<span class="sourceLineNo">453</span>    map.remove(rightNode.getStart());<a name="line.453"></a>
+<span class="sourceLineNo">454</span>    return leftNode;<a name="line.454"></a>
+<span class="sourceLineNo">455</span>  }<a name="line.455"></a>
+<span class="sourceLineNo">456</span><a name="line.456"></a>
+<span class="sourceLineNo">457</span>  public void dump() {<a name="line.457"></a>
+<span class="sourceLineNo">458</span>    System.out.println("map " + map.size());<a name="line.458"></a>
+<span class="sourceLineNo">459</span>    System.out.println("isAllModified " + isAllModified());<a name="line.459"></a>
+<span class="sourceLineNo">460</span>    System.out.println("isEmpty " + isEmpty());<a name="line.460"></a>
+<span class="sourceLineNo">461</span>    for (Map.Entry&lt;Long, BitSetNode&gt; entry : map.entrySet()) {<a name="line.461"></a>
+<span class="sourceLineNo">462</span>      entry.getValue().dump();<a name="line.462"></a>
+<span class="sourceLineNo">463</span>    }<a name="line.463"></a>
+<span class="sourceLineNo">464</span>  }<a name="line.464"></a>
+<span class="sourceLineNo">465</span><a name="line.465"></a>
+<span class="sourceLineNo">466</span>  // ========================================================================<a name="line.466"></a>
+<span class="sourceLineNo">467</span>  //  Convert to/from Protocol Buffer.<a name="line.467"></a>
+<span class="sourceLineNo">468</span>  // ========================================================================<a name="line.468"></a>
+<span class="sourceLineNo">469</span><a name="line.469"></a>
+<span class="sourceLineNo">470</span>  /**<a name="line.470"></a>
+<span class="sourceLineNo">471</span>   * Builds<a name="line.471"></a>
+<span class="sourceLineNo">472</span>   * org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.ProcedureStoreTracker<a name="line.472"></a>
+<span class="sourceLineNo">473</span>   * protocol buffer from current state.<a name="line.473"></a>
+<span class="sourceLineNo">474</span>   */<a name="line.474"></a>
+<span class="sourceLineNo">475</span>  public ProcedureProtos.ProcedureStoreTracker toProto() throws IOException {<a name="line.475"></a>
+<span class="sourceLineNo">476</span>    ProcedureProtos.ProcedureStoreTracker.Builder builder =<a name="line.476"></a>
+<span class="sourceLineNo">477</span>        ProcedureProtos.ProcedureStoreTracker.newBuilder();<a name="line.477"></a>
+<span class="sourceLineNo">478</span>    for (Map.Entry&lt;Long, BitSetNode&gt; entry : map.entrySet()) {<a name="line.478"></a>
+<span class="sourceLineNo">479</span>      builder.addNode(entry.getValue().convert());<a name="line.479"></a>
+<span class="sourceLineNo">480</span>    }<a name="line.480"></a>
+<span class="sourceLineNo">481</span>    return builder.build();<a name="line.481"></a>
+<span class="sourceLineNo">482</span>  }<a name="line.482"></a>
+<span class="sourceLineNo">483</span>}<a name="line.483"></a>
 
 
 
index 257263c..7a81ab8 100644 (file)
 <span class="sourceLineNo">088</span>      Loader loader) throws IOException {<a name="line.88"></a>
 <span class="sourceLineNo">089</span>    ProcedureWALFormatReader reader = new ProcedureWALFormatReader(tracker, loader);<a name="line.89"></a>
 <span class="sourceLineNo">090</span>    tracker.setKeepDeletes(true);<a name="line.90"></a>
-<span class="sourceLineNo">091</span>    try {<a name="line.91"></a>
-<span class="sourceLineNo">092</span>      // Ignore the last log which is current active log.<a name="line.92"></a>
-<span class="sourceLineNo">093</span>      while (logs.hasNext()) {<a name="line.93"></a>
-<span class="sourceLineNo">094</span>        ProcedureWALFile log = logs.next();<a name="line.94"></a>
-<span class="sourceLineNo">095</span>        log.open();<a name="line.95"></a>
-<span class="sourceLineNo">096</span>        try {<a name="line.96"></a>
-<span class="sourceLineNo">097</span>          reader.read(log);<a name="line.97"></a>
-<span class="sourceLineNo">098</span>        } finally {<a name="line.98"></a>
-<span class="sourceLineNo">099</span>          log.close();<a name="line.99"></a>
-<span class="sourceLineNo">100</span>        }<a name="line.100"></a>
-<span class="sourceLineNo">101</span>      }<a name="line.101"></a>
-<span class="sourceLineNo">102</span>      reader.finish();<a name="line.102"></a>
-<span class="sourceLineNo">103</span><a name="line.103"></a>
-<span class="sourceLineNo">104</span>      // The tracker is now updated with all the procedures read from the logs<a name="line.104"></a>
-<span class="sourceLineNo">105</span>      if (tracker.isPartial()) {<a name="line.105"></a>
-<span class="sourceLineNo">106</span>        tracker.setPartialFlag(false);<a name="line.106"></a>
-<span class="sourceLineNo">107</span>      }<a name="line.107"></a>
-<span class="sourceLineNo">108</span>      tracker.resetModified();<a name="line.108"></a>
-<span class="sourceLineNo">109</span>    } finally {<a name="line.109"></a>
-<span class="sourceLineNo">110</span>      tracker.setKeepDeletes(false);<a name="line.110"></a>
-<span class="sourceLineNo">111</span>    }<a name="line.111"></a>
-<span class="sourceLineNo">112</span>  }<a name="line.112"></a>
-<span class="sourceLineNo">113</span><a name="line.113"></a>
-<span class="sourceLineNo">114</span>  public static void writeHeader(OutputStream stream, ProcedureWALHeader header)<a name="line.114"></a>
-<span class="sourceLineNo">115</span>      throws IOException {<a name="line.115"></a>
-<span class="sourceLineNo">116</span>    header.writeDelimitedTo(stream);<a name="line.116"></a>
-<span class="sourceLineNo">117</span>  }<a name="line.117"></a>
-<span class="sourceLineNo">118</span><a name="line.118"></a>
-<span class="sourceLineNo">119</span>  /*<a name="line.119"></a>
-<span class="sourceLineNo">120</span>   * +-----------------+<a name="line.120"></a>
-<span class="sourceLineNo">121</span>   * | END OF WAL DATA | &lt;---+<a name="line.121"></a>
-<span class="sourceLineNo">122</span>   * +-----------------+     |<a name="line.122"></a>
-<span class="sourceLineNo">123</span>   * |                 |     |<a name="line.123"></a>
-<span class="sourceLineNo">124</span>   * |     Tracker     |     |<a name="line.124"></a>
-<span class="sourceLineNo">125</span>   * |                 |     |<a name="line.125"></a>
-<span class="sourceLineNo">126</span>   * +-----------------+     |<a name="line.126"></a>
-<span class="sourceLineNo">127</span>   * |     version     |     |<a name="line.127"></a>
-<span class="sourceLineNo">128</span>   * +-----------------+     |<a name="line.128"></a>
-<span class="sourceLineNo">129</span>   * |  TRAILER_MAGIC  |     |<a name="line.129"></a>
-<span class="sourceLineNo">130</span>   * +-----------------+     |<a name="line.130"></a>
-<span class="sourceLineNo">131</span>   * |      offset     |-----+<a name="line.131"></a>
-<span class="sourceLineNo">132</span>   * +-----------------+<a name="line.132"></a>
-<span class="sourceLineNo">133</span>   */<a name="line.133"></a>
-<span class="sourceLineNo">134</span>  public static long writeTrailer(FSDataOutputStream stream, ProcedureStoreTracker tracker)<a name="line.134"></a>
-<span class="sourceLineNo">135</span>      throws IOException {<a name="line.135"></a>
-<span class="sourceLineNo">136</span>    long offset = stream.getPos();<a name="line.136"></a>
-<span class="sourceLineNo">137</span><a name="line.137"></a>
-<span class="sourceLineNo">138</span>    // Write EOF Entry<a name="line.138"></a>
-<span class="sourceLineNo">139</span>    ProcedureWALEntry.newBuilder()<a name="line.139"></a>
-<span class="sourceLineNo">140</span>      .setType(ProcedureWALEntry.Type.PROCEDURE_WAL_EOF)<a name="line.140"></a>
-<span class="sourceLineNo">141</span>      .build().writeDelimitedTo(stream);<a name="line.141"></a>
+<span class="sourceLineNo">091</span>    // Ignore the last log which is current active log.<a name="line.91"></a>
+<span class="sourceLineNo">092</span>    while (logs.hasNext()) {<a name="line.92"></a>
+<span class="sourceLineNo">093</span>      ProcedureWALFile log = logs.next();<a name="line.93"></a>
+<span class="sourceLineNo">094</span>      log.open();<a name="line.94"></a>
+<span class="sourceLineNo">095</span>      try {<a name="line.95"></a>
+<span class="sourceLineNo">096</span>        reader.read(log);<a name="line.96"></a>
+<span class="sourceLineNo">097</span>      } finally {<a name="line.97"></a>
+<span class="sourceLineNo">098</span>        log.close();<a name="line.98"></a>
+<span class="sourceLineNo">099</span>      }<a name="line.99"></a>
+<span class="sourceLineNo">100</span>    }<a name="line.100"></a>
+<span class="sourceLineNo">101</span>    reader.finish();<a name="line.101"></a>
+<span class="sourceLineNo">102</span><a name="line.102"></a>
+<span class="sourceLineNo">103</span>    // The tracker is now updated with all the procedures read from the logs<a name="line.103"></a>
+<span class="sourceLineNo">104</span>    if (tracker.isPartial()) {<a name="line.104"></a>
+<span class="sourceLineNo">105</span>      tracker.setPartialFlag(false);<a name="line.105"></a>
+<span class="sourceLineNo">106</span>    }<a name="line.106"></a>
+<span class="sourceLineNo">107</span>    tracker.resetModified();<a name="line.107"></a>
+<span class="sourceLineNo">108</span>    tracker.setKeepDeletes(false);<a name="line.108"></a>
+<span class="sourceLineNo">109</span>  }<a name="line.109"></a>
+<span class="sourceLineNo">110</span><a name="line.110"></a>
+<span class="sourceLineNo">111</span>  public static void writeHeader(OutputStream stream, ProcedureWALHeader header)<a name="line.111"></a>
+<span class="sourceLineNo">112</span>      throws IOException {<a name="line.112"></a>
+<span class="sourceLineNo">113</span>    header.writeDelimitedTo(stream);<a name="line.113"></a>
+<span class="sourceLineNo">114</span>  }<a name="line.114"></a>
+<span class="sourceLineNo">115</span><a name="line.115"></a>
+<span class="sourceLineNo">116</span>  /*<a name="line.116"></a>
+<span class="sourceLineNo">117</span>   * +-----------------+<a name="line.117"></a>
+<span class="sourceLineNo">118</span>   * | END OF WAL DATA | &lt;---+<a name="line.118"></a>
+<span class="sourceLineNo">119</span>   * +-----------------+     |<a name="line.119"></a>
+<span class="sourceLineNo">120</span>   * |                 |     |<a name="line.120"></a>
+<span class="sourceLineNo">121</span>   * |     Tracker     |     |<a name="line.121"></a>
+<span class="sourceLineNo">122</span>   * |                 |     |<a name="line.122"></a>
+<span class="sourceLineNo">123</span>   * +-----------------+     |<a name="line.123"></a>
+<span class="sourceLineNo">124</span>   * |     version     |     |<a name="line.124"></a>
+<span class="sourceLineNo">125</span>   * +-----------------+     |<a name="line.125"></a>
+<span class="sourceLineNo">126</span>   * |  TRAILER_MAGIC  |     |<a name="line.126"></a>
+<span class="sourceLineNo">127</span>   * +-----------------+     |<a name="line.127"></a>
+<span class="sourceLineNo">128</span>   * |      offset     |-----+<a name="line.128"></a>
+<span class="sourceLineNo">129</span>   * +-----------------+<a name="line.129"></a>
+<span class="sourceLineNo">130</span>   */<a name="line.130"></a>
+<span class="sourceLineNo">131</span>  public static long writeTrailer(FSDataOutputStream stream, ProcedureStoreTracker tracker)<a name="line.131"></a>
+<span class="sourceLineNo">132</span>      throws IOException {<a name="line.132"></a>
+<span class="sourceLineNo">133</span>    long offset = stream.getPos();<a name="line.133"></a>
+<span class="sourceLineNo">134</span><a name="line.134"></a>
+<span class="sourceLineNo">135</span>    // Write EOF Entry<a name="line.135"></a>
+<span class="sourceLineNo">136</span>    ProcedureWALEntry.newBuilder()<a name="line.136"></a>
+<span class="sourceLineNo">137</span>      .setType(ProcedureWALEntry.Type.PROCEDURE_WAL_EOF)<a name="line.137"></a>
+<span class="sourceLineNo">138</span>      .build().writeDelimitedTo(stream);<a name="line.138"></a>
+<span class="sourceLineNo">139</span><a name="line.139"></a>
+<span class="sourceLineNo">140</span>    // Write Tracker<a name="line.140"></a>
+<span class="sourceLineNo">141</span>    tracker.toProto().writeDelimitedTo(stream);<a name="line.141"></a>
 <span class="sourceLineNo">142</span><a name="line.142"></a>
-<span class="sourceLineNo">143</span>    // Write Tracker<a name="line.143"></a>
-<span class="sourceLineNo">144</span>    tracker.toProto().writeDelimitedTo(stream);<a name="line.144"></a>
-<span class="sourceLineNo">145</span><a name="line.145"></a>
-<span class="sourceLineNo">146</span>    stream.write(TRAILER_VERSION);<a name="line.146"></a>
-<span class="sourceLineNo">147</span>    StreamUtils.writeLong(stream, TRAILER_MAGIC);<a name="line.147"></a>
-<span class="sourceLineNo">148</span>    StreamUtils.writeLong(stream, offset);<a name="line.148"></a>
-<span class="sourceLineNo">149</span>    return stream.getPos() - offset;<a name="line.149"></a>
-<span class="sourceLineNo">150</span>  }<a name="line.150"></a>
-<span class="sourceLineNo">151</span><a name="line.151"></a>
-<span class="sourceLineNo">152</span>  public static ProcedureWALHeader readHeader(InputStream stream)<a name="line.152"></a>
-<span class="sourceLineNo">153</span>      throws IOException {<a name="line.153"></a>
-<span class="sourceLineNo">154</span>    ProcedureWALHeader header;<a name="line.154"></a>
-<span class="sourceLineNo">155</span>    try {<a name="line.155"></a>
-<span class="sourceLineNo">156</span>      header = ProcedureWALHeader.parseDelimitedFrom(stream);<a name="line.156"></a>
-<span class="sourceLineNo">157</span>    } catch (InvalidProtocolBufferException e) {<a name="line.157"></a>
-<span class="sourceLineNo">158</span>      throw new InvalidWALDataException(e);<a name="line.158"></a>
-<span class="sourceLineNo">159</span>    }<a name="line.159"></a>
-<span class="sourceLineNo">160</span><a name="line.160"></a>
-<span class="sourceLineNo">161</span>    if (header == null) {<a name="line.161"></a>
-<span class="sourceLineNo">162</span>      throw new InvalidWALDataException("No data available to read the Header");<a name="line.162"></a>
-<span class="sourceLineNo">163</span>    }<a name="line.163"></a>
-<span class="sourceLineNo">164</span><a name="line.164"></a>
-<span class="sourceLineNo">165</span>    if (header.getVersion() &lt; 0 || header.getVersion() != HEADER_VERSION) {<a name="line.165"></a>
-<span class="sourceLineNo">166</span>      throw new InvalidWALDataException("Invalid Header version. got " + header.getVersion() +<a name="line.166"></a>
-<span class="sourceLineNo">167</span>          " expected " + HEADER_VERSION);<a name="line.167"></a>
-<span class="sourceLineNo">168</span>    }<a name="line.168"></a>
-<span class="sourceLineNo">169</span><a name="line.169"></a>
-<span class="sourceLineNo">170</span>    if (header.getType() &lt; 0 || header.getType() &gt; LOG_TYPE_MAX_VALID) {<a name="line.170"></a>
-<span class="sourceLineNo">171</span>      throw new InvalidWALDataException("Invalid header type. got " + header.getType());<a name="line.171"></a>
-<span class="sourceLineNo">172</span>    }<a name="line.172"></a>
+<span class="sourceLineNo">143</span>    stream.write(TRAILER_VERSION);<a name="line.143"></a>
+<span class="sourceLineNo">144</span>    StreamUtils.writeLong(stream, TRAILER_MAGIC);<a name="line.144"></a>
+<span class="sourceLineNo">145</span>    StreamUtils.writeLong(stream, offset);<a name="line.145"></a>
+<span class="sourceLineNo">146</span>    return stream.getPos() - offset;<a name="line.146"></a>
+<span class="sourceLineNo">147</span>  }<a name="line.147"></a>
+<span class="sourceLineNo">148</span><a name="line.148"></a>
+<span class="sourceLineNo">149</span>  public static ProcedureWALHeader readHeader(InputStream stream)<a name="line.149"></a>
+<span class="sourceLineNo">150</span>      throws IOException {<a name="line.150"></a>
+<span class="sourceLineNo">151</span>    ProcedureWALHeader header;<a name="line.151"></a>
+<span class="sourceLineNo">152</span>    try {<a name="line.152"></a>
+<span class="sourceLineNo">153</span>      header = ProcedureWALHeader.parseDelimitedFrom(stream);<a name="line.153"></a>
+<span class="sourceLineNo">154</span>    } catch (InvalidProtocolBufferException e) {<a name="line.154"></a>
+<span class="sourceLineNo">155</span>      throw new InvalidWALDataException(e);<a name="line.155"></a>
+<span class="sourceLineNo">156</span>    }<a name="line.156"></a>
+<span class="sourceLineNo">157</span><a name="line.157"></a>
+<span class="sourceLineNo">158</span>    if (header == null) {<a name="line.158"></a>
+<span class="sourceLineNo">159</span>      throw new InvalidWALDataException("No data available to read the Header");<a name="line.159"></a>
+<span class="sourceLineNo">160</span>    }<a name="line.160"></a>
+<span class="sourceLineNo">161</span><a name="line.161"></a>
+<span class="sourceLineNo">162</span>    if (header.getVersion() &lt; 0 || header.getVersion() != HEADER_VERSION) {<a name="line.162"></a>
+<span class="sourceLineNo">163</span>      throw new InvalidWALDataException("Invalid Header version. got " + header.getVersion() +<a name="line.163"></a>
+<span class="sourceLineNo">164</span>          " expected " + HEADER_VERSION);<a name="line.164"></a>
+<span class="sourceLineNo">165</span>    }<a name="line.165"></a>
+<span class="sourceLineNo">166</span><a name="line.166"></a>
+<span class="sourceLineNo">167</span>    if (header.getType() &lt; 0 || header.getType() &gt; LOG_TYPE_MAX_VALID) {<a name="line.167"></a>
+<span class="sourceLineNo">168</span>      throw new InvalidWALDataException("Invalid header type. got " + header.getType());<a name="line.168"></a>
+<span class="sourceLineNo">169</span>    }<a name="line.169"></a>
+<span class="sourceLineNo">170</span><a name="line.170"></a>
+<span class="sourceLineNo">171</span>    return header;<a name="line.171"></a>
+<span class="sourceLineNo">172</span>  }<a name="line.172"></a>
 <span class="sourceLineNo">173</span><a name="line.173"></a>
-<span class="sourceLineNo">174</span>    return header;<a name="line.174"></a>
-<span class="sourceLineNo">175</span>  }<a name="line.175"></a>
-<span class="sourceLineNo">176</span><a name="line.176"></a>
-<span class="sourceLineNo">177</span>  public static ProcedureWALTrailer readTrailer(FSDataInputStream stream, long startPos, long size)<a name="line.177"></a>
-<span class="sourceLineNo">178</span>      throws IOException {<a name="line.178"></a>
-<span class="sourceLineNo">179</span>    // Beginning of the Trailer Jump. 17 = 1 byte version + 8 byte magic + 8 byte offset<a name="line.179"></a>
-<span class="sourceLineNo">180</span>    long trailerPos = size - 17;<a name="line.180"></a>
-<span class="sourceLineNo">181</span><a name="line.181"></a>
-<span class="sourceLineNo">182</span>    if (trailerPos &lt; startPos) {<a name="line.182"></a>
-<span class="sourceLineNo">183</span>      throw new InvalidWALDataException("Missing trailer: size=" + size + " startPos=" + startPos);<a name="line.183"></a>
-<span class="sourceLineNo">184</span>    }<a name="line.184"></a>
-<span class="sourceLineNo">185</span><a name="line.185"></a>
-<span class="sourceLineNo">186</span>    stream.seek(trailerPos);<a name="line.186"></a>
-<span class="sourceLineNo">187</span>    int version = stream.read();<a name="line.187"></a>
-<span class="sourceLineNo">188</span>    if (version != TRAILER_VERSION) {<a name="line.188"></a>
-<span class="sourceLineNo">189</span>      throw new InvalidWALDataException("Invalid Trailer version. got " + version +<a name="line.189"></a>
-<span class="sourceLineNo">190</span>          " expected " + TRAILER_VERSION);<a name="line.190"></a>
-<span class="sourceLineNo">191</span>    }<a name="line.191"></a>
-<span class="sourceLineNo">192</span><a name="line.192"></a>
-<span class="sourceLineNo">193</span>    long magic = StreamUtils.readLong(stream);<a name="line.193"></a>
-<span class="sourceLineNo">194</span>    if (magic != TRAILER_MAGIC) {<a name="line.194"></a>
-<span class="sourceLineNo">195</span>      throw new InvalidWALDataException("Invalid Trailer magic. got " + magic +<a name="line.195"></a>
-<span class="sourceLineNo">196</span>          " expected " + TRAILER_MAGIC);<a name="line.196"></a>
-<span class="sourceLineNo">197</span>    }<a name="line.197"></a>
+<span class="sourceLineNo">174</span>  public static ProcedureWALTrailer readTrailer(FSDataInputStream stream, long startPos, long size)<a name="line.174"></a>
+<span class="sourceLineNo">175</span>      throws IOException {<a name="line.175"></a>
+<span class="sourceLineNo">176</span>    // Beginning of the Trailer Jump. 17 = 1 byte version + 8 byte magic + 8 byte offset<a name="line.176"></a>
+<span class="sourceLineNo">177</span>    long trailerPos = size - 17;<a name="line.177"></a>
+<span class="sourceLineNo">178</span><a name="line.178"></a>
+<span class="sourceLineNo">179</span>    if (trailerPos &lt; startPos) {<a name="line.179"></a>
+<span class="sourceLineNo">180</span>      throw new InvalidWALDataException("Missing trailer: size=" + size + " startPos=" + startPos);<a name="line.180"></a>
+<span class="sourceLineNo">181</span>    }<a name="line.181"></a>
+<span class="sourceLineNo">182</span><a name="line.182"></a>
+<span class="sourceLineNo">183</span>    stream.seek(trailerPos);<a name="line.183"></a>
+<span class="sourceLineNo">184</span>    int version = stream.read();<a name="line.184"></a>
+<span class="sourceLineNo">185</span>    if (version != TRAILER_VERSION) {<a name="line.185"></a>
+<span class="sourceLineNo">186</span>      throw new InvalidWALDataException("Invalid Trailer version. got " + version +<a name="line.186"></a>
+<span class="sourceLineNo">187</span>          " expected " + TRAILER_VERSION);<a name="line.187"></a>
+<span class="sourceLineNo">188</span>    }<a name="line.188"></a>
+<span class="sourceLineNo">189</span><a name="line.189"></a>
+<span class="sourceLineNo">190</span>    long magic = StreamUtils.readLong(stream);<a name="line.190"></a>
+<span class="sourceLineNo">191</span>    if (magic != TRAILER_MAGIC) {<a name="line.191"></a>
+<span class="sourceLineNo">192</span>      throw new InvalidWALDataException("Invalid Trailer magic. got " + magic +<a name="line.192"></a>
+<span class="sourceLineNo">193</span>          " expected " + TRAILER_MAGIC);<a name="line.193"></a>
+<span class="sourceLineNo">194</span>    }<a name="line.194"></a>
+<span class="sourceLineNo">195</span><a name="line.195"></a>
+<span class="sourceLineNo">196</span>    long trailerOffset = StreamUtils.readLong(stream);<a name="line.196"></a>
+<span class="sourceLineNo">197</span>    stream.seek(trailerOffset);<a name="line.197"></a>
 <span class="sourceLineNo">198</span><a name="line.198"></a>
-<span class="sourceLineNo">199</span>    long trailerOffset = StreamUtils.readLong(stream);<a name="line.199"></a>
-<span class="sourceLineNo">200</span>    stream.seek(trailerOffset);<a name="line.200"></a>
-<span class="sourceLineNo">201</span><a name="line.201"></a>
-<span class="sourceLineNo">202</span>    ProcedureWALEntry entry = readEntry(stream);<a name="line.202"></a>
-<span class="sourceLineNo">203</span>    if (entry.getType() != ProcedureWALEntry.Type.PROCEDURE_WAL_EOF) {<a name="line.203"></a>
-<span class="sourceLineNo">204</span>      throw new InvalidWALDataException("Invalid Trailer begin");<a name="line.204"></a>
-<span class="sourceLineNo">205</span>    }<a name="line.205"></a>
-<span class="sourceLineNo">206</span><a name="line.206"></a>
-<span class="sourceLineNo">207</span>    ProcedureWALTrailer trailer = ProcedureWALTrailer.newBuilder()<a name="line.207"></a>
-<span class="sourceLineNo">208</span>      .setVersion(version)<a name="line.208"></a>
-<span class="sourceLineNo">209</span>      .setTrackerPos(stream.getPos())<a name="line.209"></a>
-<span class="sourceLineNo">210</span>      .build();<a name="line.210"></a>
-<span class="sourceLineNo">211</span>    return trailer;<a name="line.211"></a>
-<span class="sourceLineNo">212</span>  }<a name="line.212"></a>
-<span class="sourceLineNo">213</span><a name="line.213"></a>
-<span class="sourceLineNo">214</span>  public static ProcedureWALEntry readEntry(InputStream stream) throws IOException {<a name="line.214"></a>
-<span class="sourceLineNo">215</span>    return ProcedureWALEntry.parseDelimitedFrom(stream);<a name="line.215"></a>
-<span class="sourceLineNo">216</span>  }<a name="line.216"></a>
-<span class="sourceLineNo">217</span><a name="line.217"></a>
-<span class="sourceLineNo">218</span>  public static void writeEntry(ByteSlot slot, ProcedureWALEntry.Type type,<a name="line.218"></a>
-<span class="sourceLineNo">219</span>      Procedure&lt;?&gt; proc, Procedure&lt;?&gt;[] subprocs) throws IOException {<a name="line.219"></a>
-<span class="sourceLineNo">220</span>    final ProcedureWALEntry.Builder builder = ProcedureWALEntry.newBuilder();<a name="line.220"></a>
-<span class="sourceLineNo">221</span>    builder.setType(type);<a name="line.221"></a>
-<span class="sourceLineNo">222</span>    builder.addProcedure(ProcedureUtil.convertToProtoProcedure(proc));<a name="line.222"></a>
-<span class="sourceLineNo">223</span>    if (subprocs != null) {<a name="line.223"></a>
-<span class="sourceLineNo">224</span>      for (int i = 0; i &lt; subprocs.length; ++i) {<a name="line.224"></a>
-<span class="sourceLineNo">225</span>        builder.addProcedure(ProcedureUtil.convertToProtoProcedure(subprocs[i]));<a name="line.225"></a>
-<span class="sourceLineNo">226</span>      }<a name="line.226"></a>
-<span class="sourceLineNo">227</span>    }<a name="line.227"></a>
-<span class="sourceLineNo">228</span>    builder.build().writeDelimitedTo(slot);<a name="line.228"></a>
-<span class="sourceLineNo">229</span>  }<a name="line.229"></a>
-<span class="sourceLineNo">230</span><a name="line.230"></a>
-<span class="sourceLineNo">231</span>  public static void writeInsert(ByteSlot slot, Procedure&lt;?&gt; proc)<a name="line.231"></a>
-<span class="sourceLineNo">232</span>      throws IOException {<a name="line.232"></a>
-<span class="sourceLineNo">233</span>    writeEntry(slot, ProcedureWALEntry.Type.PROCEDURE_WAL_INIT, proc, null);<a name="line.233"></a>
-<span class="sourceLineNo">234</span>  }<a name="line.234"></a>
-<span class="sourceLineNo">235</span><a name="line.235"></a>
-<span class="sourceLineNo">236</span>  public static void writeInsert(ByteSlot slot, Procedure&lt;?&gt; proc, Procedure&lt;?&gt;[] subprocs)<a name="line.236"></a>
-<span class="sourceLineNo">237</span>      throws IOException {<a name="line.237"></a>
-<span class="sourceLineNo">238</span>    writeEntry(slot, ProcedureWALEntry.Type.PROCEDURE_WAL_INSERT, proc, subprocs);<a name="line.238"></a>
-<span class="sourceLineNo">239</span>  }<a name="line.239"></a>
-<span class="sourceLineNo">240</span><a name="line.240"></a>
-<span class="sourceLineNo">241</span>  public static void writeUpdate(ByteSlot slot, Procedure&lt;?&gt; proc)<a name="line.241"></a>
-<span class="sourceLineNo">242</span>      throws IOException {<a name="line.242"></a>
-<span class="sourceLineNo">243</span>    writeEntry(slot, ProcedureWALEntry.Type.PROCEDURE_WAL_UPDATE, proc, null);<a name="line.243"></a>
-<span class="sourceLineNo">244</span>  }<a name="line.244"></a>
-<span class="sourceLineNo">245</span><a name="line.245"></a>
-<span class="sourceLineNo">246</span>  public static void writeDelete(ByteSlot slot, long procId)<a name="line.246"></a>
-<span class="sourceLineNo">247</span>      throws IOException {<a name="line.247"></a>
-<span class="sourceLineNo">248</span>    final ProcedureWALEntry.Builder builder = ProcedureWALEntry.newBuilder();<a name="line.248"></a>
-<span class="sourceLineNo">249</span>    builder.setType(ProcedureWALEntry.Type.PROCEDURE_WAL_DELETE);<a name="line.249"></a>
-<span class="sourceLineNo">250</span>    builder.setProcId(procId);<a name="line.250"></a>
-<span class="sourceLineNo">251</span>    builder.build().writeDelimitedTo(slot);<a name="line.251"></a>
-<span class="sourceLineNo">252</span>  }<a name="line.252"></a>
-<span class="sourceLineNo">253</span><a name="line.253"></a>
-<span class="sourceLineNo">254</span>  public static void writeDelete(ByteSlot slot, Procedure&lt;?&gt; proc, long[] subprocs)<a name="line.254"></a>
-<span class="sourceLineNo">255</span>      throws IOException {<a name="line.255"></a>
-<span class="sourceLineNo">256</span>    final ProcedureWALEntry.Builder builder = ProcedureWALEntry.newBuilder();<a name="line.256"></a>
-<span class="sourceLineNo">257</span>    builder.setType(ProcedureWALEntry.Type.PROCEDURE_WAL_DELETE);<a name="line.257"></a>
-<span class="sourceLineNo">258</span>    builder.setProcId(proc.getProcId());<a name="line.258"></a>
-<span class="sourceLineNo">259</span>    if (subprocs != null) {<a name="line.259"></a>
-<span class="sourceLineNo">260</span>      builder.addProcedure(ProcedureUtil.convertToProtoProcedure(proc));<a name="line.260"></a>
-<span class="sourceLineNo">261</span>      for (int i = 0; i &lt; subprocs.length; ++i) {<a name="line.261"></a>
-<span class="sourceLineNo">262</span>        builder.addChildId(subprocs[i]);<a name="line.262"></a>
-<span class="sourceLineNo">263</span>      }<a name="line.263"></a>
-<span class="sourceLineNo">264</span>    }<a name="line.264"></a>
-<span class="sourceLineNo">265</span>    builder.build().writeDelimitedTo(slot);<a name="line.265"></a>
-<span class="sourceLineNo">266</span>  }<a name="line.266"></a>
-<span class="sourceLineNo">267</span>}<a name="line.267"></a>
+<span class="sourceLineNo">199</span>    ProcedureWALEntry entry = readEntry(stream);<a name="line.199"></a>
+<span class="sourceLineNo">200</span>    if (entry.getType() != ProcedureWALEntry.Type.PROCEDURE_WAL_EOF) {<a name="line.200"></a>
+<span class="sourceLineNo">201</span>      throw new InvalidWALDataException("Invalid Trailer begin");<a name="line.201"></a>
+<span class="sourceLineNo">202</span>    }<a name="line.202"></a>
+<span class="sourceLineNo">203</span><a name="line.203"></a>
+<span class="sourceLineNo">204</span>    ProcedureWALTrailer trailer = ProcedureWALTrailer.newBuilder()<a name="line.204"></a>
+<span class="sourceLineNo">205</span>      .setVersion(version)<a name="line.205"></a>
+<span class="sourceLineNo">206</span>      .setTrackerPos(stream.getPos())<a name="line.206"></a>
+<span class="sourceLineNo">207</span>      .build();<a name="line.207"></a>
+<span class="sourceLineNo">208</span>    return trailer;<a name="line.208"></a>
+<span class="sourceLineNo">209</span>  }<a name="line.209"></a>
+<span class="sourceLineNo">210</span><a name="line.210"></a>
+<span class="sourceLineNo">211</span>  public static ProcedureWALEntry readEntry(InputStream stream) throws IOException {<a name="line.211"></a>
+<span class="sourceLineNo">212</span>    return ProcedureWALEntry.parseDelimitedFrom(stream);<a name="line.212"></a>
+<span class="sourceLineNo">213</span>  }<a name="line.213"></a>
+<span class="sourceLineNo">214</span><a name="line.214"></a>
+<span class="sourceLineNo">215</span>  public static void writeEntry(ByteSlot slot, ProcedureWALEntry.Type type,<a name="line.215"></a>
+<span class="sourceLineNo">216</span>      Procedure&lt;?&gt; proc, Procedure&lt;?&gt;[] subprocs) throws IOException {<a name="line.216"></a>
+<span class="sourceLineNo">217</span>    final ProcedureWALEntry.Builder builder = ProcedureWALEntry.newBuilder();<a name="line.217"></a>
+<span class="sourceLineNo">218</span>    builder.setType(type);<a name="line.218"></a>
+<span class="sourceLineNo">219</span>    builder.addProcedure(ProcedureUtil.convertToProtoProcedure(proc));<a name="line.219"></a>
+<span class="sourceLineNo">220</span>    if (subprocs != null) {<a name="line.220"></a>
+<span class="sourceLineNo">221</span>      for (int i = 0; i &lt; subprocs.length; ++i) {<a name="line.221"></a>
+<span class="sourceLineNo">222</span>        builder.addProcedure(ProcedureUtil.convertToProtoProcedure(subprocs[i]));<a name="line.222"></a>
+<span class="sourceLineNo">223</span>      }<a name="line.223"></a>
+<span class="sourceLineNo">224</span>    }<a name="line.224"></a>
+<span class="sourceLineNo">225</span>    builder.build().writeDelimitedTo(slot);<a name="line.225"></a>
+<span class="sourceLineNo">226</span>  }<a name="line.226"></a>
+<span class="sourceLineNo">227</span><a name="line.227"></a>
+<span class="sourceLineNo">228</span>  public static void writeInsert(ByteSlot slot, Procedure&lt;?&gt; proc)<a name="line.228"></a>
+<span class="sourceLineNo">229</span>      throws IOException {<a name="line.229"></a>
+<span class="sourceLineNo">230</span>    writeEntry(slot, ProcedureWALEntry.Type.PROCEDURE_WAL_INIT, proc, null);<a name="line.230"></a>
+<span class="sourceLineNo">231</span>  }<a name="line.231"></a>
+<span class="sourceLineNo">232</span><a name="line.232"></a>
+<span class="sourceLineNo">233</span>  public static void writeInsert(ByteSlot slot, Procedure&lt;?&gt; proc, Procedure&lt;?&gt;[] subprocs)<a name="line.233"></a>
+<span class="sourceLineNo">234</span>      throws IOException {<a name="line.234"></a>
+<span class="sourceLineNo">235</span>    writeEntry(slot, ProcedureWALEntry.Type.PROCEDURE_WAL_INSERT, proc, subprocs);<a name="line.235"></a>
+<span class="sourceLineNo">236</span>  }<a name="line.236"></a>
+<span class="sourceLineNo">237</span><a name="line.237"></a>
+<span class="sourceLineNo">238</span>  public static void writeUpdate(ByteSlot slot, Procedure&lt;?&gt; proc)<a name="line.238"></a>
+<span class="sourceLineNo">239</span>      throws IOException {<a name="line.239"></a>
+<span class="sourceLineNo">240</span>    writeEntry(slot, ProcedureWALEntry.Type.PROCEDURE_WAL_UPDATE, proc, null);<a name="line.240"></a>
+<span class="sourceLineNo">241</span>  }<a name="line.241"></a>
+<span class="sourceLineNo">242</span><a name="line.242"></a>
+<span class="sourceLineNo">243</span>  public static void writeDelete(ByteSlot slot, long procId)<a name="line.243"></a>
+<span class="sourceLineNo">244</span>      throws IOException {<a name="line.244"></a>
+<span class="sourceLineNo">245</span>    final ProcedureWALEntry.Builder builder = ProcedureWALEntry.newBuilder();<a name="line.245"></a>
+<span class="sourceLineNo">246</span>    builder.setType(ProcedureWALEntry.Type.PROCEDURE_WAL_DELETE);<a name="line.246"></a>
+<span class="sourceLineNo">247</span>    builder.setProcId(procId);<a name="line.247"></a>
+<span class="sourceLineNo">248</span>    builder.build().writeDelimitedTo(slot);<a name="line.248"></a>
+<span class="sourceLineNo">249</span>  }<a name="line.249"></a>
+<span class="sourceLineNo">250</span><a name="line.250"></a>
+<span class="sourceLineNo">251</span>  public static void writeDelete(ByteSlot slot, Procedure&lt;?&gt; proc, long[] subprocs)<a name="line.251"></a>
+<span class="sourceLineNo">252</span>      throws IOException {<a name="line.252"></a>
+<span class="sourceLineNo">253</span>    final ProcedureWALEntry.Builder builder = ProcedureWALEntry.newBuilder();<a name="line.253"></a>
+<span class="sourceLineNo">254</span>    builder.setType(ProcedureWALEntry.Type.PROCEDURE_WAL_DELETE);<a name="line.254"></a>
+<span class="sourceLineNo">255</span>    builder.setProcId(proc.getProcId());<a name="line.255"></a>
+<span class="sourceLineNo">256</span>    if (subprocs != null) {<a name="line.256"></a>
+<span class="sourceLineNo">257</span>      builder.addProcedure(ProcedureUtil.convertToProtoProcedure(proc));<a name="line.257"></a>
+<span class="sourceLineNo">258</span>      for (int i = 0; i &lt; subprocs.length; ++i) {<a name="line.258"></a>
+<span class="sourceLineNo">259</span>        builder.addChildId(subprocs[i]);<a name="line.259"></a>
+<span class="sourceLineNo">260</span>      }<a name="line.260"></a>
+<span class="sourceLineNo">261</span>    }<a name="line.261"></a>
+<span class="sourceLineNo">262</span>    builder.build().writeDelimitedTo(slot);<a name="line.262"></a>
+<span class="sourceLineNo">263</span>  }<a name="line.263"></a>
+<span class="sourceLineNo">264</span>}<a name="line.264"></a>
 
 
 
index 257263c..7a81ab8 100644 (file)
 <span class="sourceLineNo">088</span>      Loader loader) throws IOException {<a name="line.88"></a>
 <span class="sourceLineNo">089</span>    ProcedureWALFormatReader reader = new ProcedureWALFormatReader(tracker, loader);<a name="line.89"></a>
 <span class="sourceLineNo">090</span>    tracker.setKeepDeletes(true);<a name="line.90"></a>
-<span class="sourceLineNo">091</span>    try {<a name="line.91"></a>
-<span class="sourceLineNo">092</span>      // Ignore the last log which is current active log.<a name="line.92"></a>
-<span class="sourceLineNo">093</span>      while (logs.hasNext()) {<a name="line.93"></a>
-<span class="sourceLineNo">094</span>        ProcedureWALFile log = logs.next();<a name="line.94"></a>
-<span class="sourceLineNo">095</span>        log.open();<a name="line.95"></a>
-<span class="sourceLineNo">096</span>        try {<a name="line.96"></a>
-<span class="sourceLineNo">097</span>          reader.read(log);<a name="line.97"></a>
-<span class="sourceLineNo">098</span>        } finally {<a name="line.98"></a>
-<span class="sourceLineNo">099</span>          log.close();<a name="line.99"></a>
-<span class="sourceLineNo">100</span>        }<a name="line.100"></a>
-<span class="sourceLineNo">101</span>      }<a name="line.101"></a>
-<span class="sourceLineNo">102</span>      reader.finish();<a name="line.102"></a>
-<span class="sourceLineNo">103</span><a name="line.103"></a>
-<span class="sourceLineNo">104</span>      // The tracker is now updated with all the procedures read from the logs<a name="line.104"></a>
-<span class="sourceLineNo">105</span>      if (tracker.isPartial()) {<a name="line.105"></a>
-<span class="sourceLineNo">106</span>        tracker.setPartialFlag(false);<a name="line.106"></a>
-<span class="sourceLineNo">107</span>      }<a name="line.107"></a>
-<span class="sourceLineNo">108</span>      tracker.resetModified();<a name="line.108"></a>
-<span class="sourceLineNo">109</span>    } finally {<a name="line.109"></a>
-<span class="sourceLineNo">110</span>      tracker.setKeepDeletes(false);<a name="line.110"></a>
-<span class="sourceLineNo">111</span>    }<a name="line.111"></a>
-<span class="sourceLineNo">112</span>  }<a name="line.112"></a>
-<span class="sourceLineNo">113</span><a name="line.113"></a>
-<span class="sourceLineNo">114</span>  public static void writeHeader(OutputStream stream, ProcedureWALHeader header)<a name="line.114"></a>
-<span class="sourceLineNo">115</span>      throws IOException {<a name="line.115"></a>
-<span class="sourceLineNo">116</span>    header.writeDelimitedTo(stream);<a name="line.116"></a>
-<span class="sourceLineNo">117</span>  }<a name="line.117"></a>
-<span class="sourceLineNo">118</span><a name="line.118"></a>
-<span class="sourceLineNo">119</span>  /*<a name="line.119"></a>
-<span class="sourceLineNo">120</span>   * +-----------------+<a name="line.120"></a>
-<span class="sourceLineNo">121</span>   * | END OF WAL DATA | &lt;---+<a name="line.121"></a>
-<span class="sourceLineNo">122</span>   * +-----------------+     |<a name="line.122"></a>
-<span class="sourceLineNo">123</span>   * |                 |     |<a name="line.123"></a>
-<span class="sourceLineNo">124</span>   * |     Tracker     |     |<a name="line.124"></a>
-<span class="sourceLineNo">125</span>   * |                 |     |<a name="line.125"></a>
-<span class="sourceLineNo">126</span>   * +-----------------+     |<a name="line.126"></a>
-<span class="sourceLineNo">127</span>   * |     version     |     |<a name="line.127"></a>
-<span class="sourceLineNo">128</span>   * +-----------------+     |<a name="line.128"></a>
-<span class="sourceLineNo">129</span>   * |  TRAILER_MAGIC  |     |<a name="line.129"></a>
-<span class="sourceLineNo">130</span>   * +-----------------+     |<a name="line.130"></a>
-<span class="sourceLineNo">131</span>   * |      offset     |-----+<a name="line.131"></a>
-<span class="sourceLineNo">132</span>   * +-----------------+<a name="line.132"></a>
-<span class="sourceLineNo">133</span>   */<a name="line.133"></a>
-<span class="sourceLineNo">134</span>  public static long writeTrailer(FSDataOutputStream stream, ProcedureStoreTracker tracker)<a name="line.134"></a>
-<span class="sourceLineNo">135</span>      throws IOException {<a name="line.135"></a>
-<span class="sourceLineNo">136</span>    long offset = stream.getPos();<a name="line.136"></a>
-<span class="sourceLineNo">137</span><a name="line.137"></a>
-<span class="sourceLineNo">138</span>    // Write EOF Entry<a name="line.138"></a>
-<span class="sourceLineNo">139</span>    ProcedureWALEntry.newBuilder()<a name="line.139"></a>
-<span class="sourceLineNo">140</span>      .setType(ProcedureWALEntry.Type.PROCEDURE_WAL_EOF)<a name="line.140"></a>
-<span class="sourceLineNo">141</span>      .build().writeDelimitedTo(stream);<a name="line.141"></a>
+<span class="sourceLineNo">091</span>    // Ignore the last log which is current active log.<a name="line.91"></a>
+<span class="sourceLineNo">092</span>    while (logs.hasNext()) {<a name="line.92"></a>
+<span class="sourceLineNo">093</span>      ProcedureWALFile log = logs.next();<a name="line.93"></a>
+<span class="sourceLineNo">094</span>      log.open();<a name="line.94"></a>
+<span class="sourceLineNo">095</span>      try {<a name="line.95"></a>
+<span class="sourceLineNo">096</span>        reader.read(log);<a name="line.96"></a>
+<span class="sourceLineNo">097</span>      } finally {<a name="line.97"></a>
+<span class="sourceLineNo">098</span>        log.close();<a name="line.98"></a>
+<span class="sourceLineNo">099</span>      }<a name="line.99"></a>
+<span class="sourceLineNo">100</span>    }<a name="line.100"></a>
+<span class="sourceLineNo">101</span>    reader.finish();<a name="line.101"></a>
+<span class="sourceLineNo">102</span><a name="line.102"></a>
+<span class="sourceLineNo">103</span>    // The tracker is now updated with all the procedures read from the logs<a name="line.103"></a>
+<span class="sourceLineNo">104</span>    if (tracker.isPartial()) {<a name="line.104"></a>
+<span class="sourceLineNo">105</span>      tracker.setPartialFlag(false);<a name="line.105"></a>
+<span class="sourceLineNo">106</span>    }<a name="line.106"></a>
+<span class="sourceLineNo">107</span>    tracker.resetModified();<a name="line.107"></a>
+<span class="sourceLineNo">108</span>    tracker.setKeepDeletes(false);<a name="line.108"></a>
+<span class="sourceLineNo">109</span>  }<a name="line.109"></a>
+<span class="sourceLineNo">110</span><a name="line.110"></a>
+<span class="sourceLineNo">111</span>  public static void writeHeader(OutputStream stream, ProcedureWALHeader header)<a name="line.111"></a>
+<span class="sourceLineNo">112</span>      throws IOException {<a name="line.112"></a>
+<span class="sourceLineNo">113</span>    header.writeDelimitedTo(stream);<a name="line.113"></a>
+<span class="sourceLineNo">114</span>  }<a name="line.114"></a>
+<span class="sourceLineNo">115</span><a name="line.115"></a>
+<span class="sourceLineNo">116</span>  /*<a name="line.116"></a>
+<span class="sourceLineNo">117</span>   * +-----------------+<a name="line.117"></a>
+<span class="sourceLineNo">118</span>   * | END OF WAL DATA | &lt;---+<a name="line.118"></a>
+<span class="sourceLineNo">119</span>   * +-----------------+     |<a name="line.119"></a>
+<span class="sourceLineNo">120</span>   * |                 |     |<a name="line.120"></a>
+<span class="sourceLineNo">121</span>   * |     Tracker     |     |<a name="line.121"></a>
+<span class="sourceLineNo">122</span>   * |                 |     |<a name="line.122"></a>
+<span class="sourceLineNo">123</span>   * +-----------------+     |<a name="line.123"></a>
+<span class="sourceLineNo">124</span>   * |     version     |     |<a name="line.124"></a>
+<span class="sourceLineNo">125</span>   * +-----------------+     |<a name="line.125"></a>
+<span class="sourceLineNo">126</span>   * |  TRAILER_MAGIC  |     |<a name="line.126"></a>
+<span class="sourceLineNo">127</span>   * +-----------------+     |<a name="line.127"></a>
+<span class="sourceLineNo">128</span>   * |      offset     |-----+<a name="line.128"></a>
+<span class="sourceLineNo">129</span>   * +-----------------+<a name="line.129"></a>
+<span class="sourceLineNo">130</span>   */<a name="line.130"></a>
+<span class="sourceLineNo">131</span>  public static long writeTrailer(FSDataOutputStream stream, ProcedureStoreTracker tracker)<a name="line.131"></a>
+<span class="sourceLineNo">132</span>      throws IOException {<a name="line.132"></a>
+<span class="sourceLineNo">133</span>    long offset = stream.getPos();<a name="line.133"></a>
+<span class="sourceLineNo">134</span><a name="line.134"></a>
+<span class="sourceLineNo">135</span>    // Write EOF Entry<a name="line.135"></a>
+<span class="sourceLineNo">136</span>    ProcedureWALEntry.newBuilder()<a name="line.136"></a>
+<span class="sourceLineNo">137</span>      .setType(ProcedureWALEntry.Type.PROCEDURE_WAL_EOF)<a name="line.137"></a>
+<span class="sourceLineNo">138</span>      .build().writeDelimitedTo(stream);<a name="line.138"></a>
+<span class="sourceLineNo">139</span><a name="line.139"></a>
+<span class="sourceLineNo">140</span>    // Write Tracker<a name="line.140"></a>
+<span class="sourceLineNo">141</span>    tracker.toProto().writeDelimitedTo(stream);<a name="line.141"></a>
 <span class="sourceLineNo">142</span><a name="line.142"></a>
-<span class="sourceLineNo">143</span>    // Write Tracker<a name="line.143"></a>
-<span class="sourceLineNo">144</span>    tracker.toProto().writeDelimitedTo(stream);<a name="line.144"></a>
-<span class="sourceLineNo">145</span><a name="line.145"></a>
-<span class="sourceLineNo">146</span>    stream.write(TRAILER_VERSION);<a name="line.146"></a>
-<span class="sourceLineNo">147</span>    StreamUtils.writeLong(stream, TRAILER_MAGIC);<a name="line.147"></a>
-<span class="sourceLineNo">148</span>    StreamUtils.writeLong(stream, offset);<a name="line.148"></a>
-<span class="sourceLineNo">149</span>    return stream.getPos() - offset;<a name="line.149"></a>
-<span class="sourceLineNo">150</span>  }<a name="line.150"></a>
-<span class="sourceLineNo">151</span><a name="line.151"></a>
-<span class="sourceLineNo">152</span>  public static ProcedureWALHeader readHeader(InputStream stream)<a name="line.152"></a>
-<span class="sourceLineNo">153</span>      throws IOException {<a name="line.153"></a>
-<span class="sourceLineNo">154</span>    ProcedureWALHeader header;<a name="line.154"></a>
-<span class="sourceLineNo">155</span>    try {<a name="line.155"></a>
-<span class="sourceLineNo">156</span>      header = ProcedureWALHeader.parseDelimitedFrom(stream);<a name="line.156"></a>
-<span class="sourceLineNo">157</span>    } catch (InvalidProtocolBufferException e) {<a name="line.157"></a>
-<span class="sourceLineNo">158</span>      throw new InvalidWALDataException(e);<a name="line.158"></a>
-<span class="sourceLineNo">159</span>    }<a name="line.159"></a>
-<span class="sourceLineNo">160</span><a name="line.160"></a>
-<span class="sourceLineNo">161</span>    if (header == null) {<a name="line.161"></a>
-<span class="sourceLineNo">162</span>      throw new InvalidWALDataException("No data available to read the Header");<a name="line.162"></a>
-<span class="sourceLineNo">163</span>    }<a name="line.163"></a>
-<span class="sourceLineNo">164</span><a name="line.164"></a>
-<span class="sourceLineNo">165</span>    if (header.getVersion() &lt; 0 || header.getVersion() != HEADER_VERSION) {<a name="line.165"></a>
-<span class="sourceLineNo">166</span>      throw new InvalidWALDataException("Invalid Header version. got " + header.getVersion() +<a name="line.166"></a>
-<span class="sourceLineNo">167</span>          " expected " + HEADER_VERSION);<a name="line.167"></a>
-<span class="sourceLineNo">168</span>    }<a name="line.168"></a>
-<span class="sourceLineNo">169</span><a name="line.169"></a>
-<span class="sourceLineNo">170</span>    if (header.getType() &lt; 0 || header.getType() &gt; LOG_TYPE_MAX_VALID) {<a name="line.170"></a>
-<span class="sourceLineNo">171</span>      throw new InvalidWALDataException("Invalid header type. got " + header.getType());<a name="line.171"></a>
-<span class="sourceLineNo">172</span>    }<a name="line.172"></a>
+<span class="sourceLineNo">143</span>    stream.write(TRAILER_VERSION);<a name="line.143"></a>
+<span class="sourceLineNo">144</span>    StreamUtils.writeLong(stream, TRAILER_MAGIC);<a name="line.144"></a>
+<span class="sourceLineNo">145</span>    StreamUtils.writeLong(stream, offset);<a name="line.145"></a>
+<span class="sourceLineNo">146</span>    return stream.getPos() - offset;<a name="line.146"></a>
+<span class="sourceLineNo">147</span>  }<a name="line.147"></a>
+<span class="sourceLineNo">148</span><a name="line.148"></a>
+<span class="sourceLineNo">149</span>  public static ProcedureWALHeader readHeader(InputStream stream)<a name="line.149"></a>
+<span class="sourceLineNo">150</span>      throws IOException {<a name="line.150"></a>
+<span class="sourceLineNo">151</span>    ProcedureWALHeader header;<a name="line.151"></a>
+<span class="sourceLineNo">152</span>    try {<a name="line.152"></a>
+<span class="sourceLineNo">153</span>      header = ProcedureWALHeader.parseDelimitedFrom(stream);<a name="line.153"></a>
+<span class="sourceLineNo">154</span>    } catch (InvalidProtocolBufferException e) {<a name="line.154"></a>
+<span class="sourceLineNo">155</span>      throw new InvalidWALDataException(e);<a name="line.155"></a>
+<span class="sourceLineNo">156</span>    }<a name="line.156"></a>
+<span class="sourceLineNo">157</span><a name="line.157"></a>
+<span class="sourceLineNo">158</span>    if (header == null) {<a name="line.158"></a>
+<span class="sourceLineNo">159</span>      throw new InvalidWALDataException("No data available to read the Header");<a name="line.159"></a>
+<span class="sourceLineNo">160</span>    }<a name="line.160"></a>
+<span class="sourceLineNo">161</span><a name="line.161"></a>
+<span class="sourceLineNo">162</span>    if (header.getVersion() &lt; 0 || header.getVersion() != HEADER_VERSION) {<a name="line.162"></a>
+<span class="sourceLineNo">163</span>      throw new InvalidWALDataException("Invalid Header version. got " + header.getVersion() +<a name="line.163"></a>
+<span class="sourceLineNo">164</span>          " expected " + HEADER_VERSION);<a name="line.164"></a>
+<span class="sourceLineNo">165</span>    }<a name="line.165"></a>
+<span class="sourceLineNo">166</span><a name="line.166"></a>
+<span class="sourceLineNo">167</span>    if (header.getType() &lt; 0 || header.getType() &gt; LOG_TYPE_MAX_VALID) {<a name="line.167"></a>
+<span class="sourceLineNo">168</span>      throw new InvalidWALDataException("Invalid header type. got " + header.getType());<a name="line.168"></a>
+<span class="sourceLineNo">169</span>    }<a name="line.169"></a>
+<span class="sourceLineNo">170</span><a name="line.170"></a>
+<span class="sourceLineNo">171</span>    return header;<a name="line.171"></a>
+<span class="sourceLineNo">172</span>  }<a name="line.172"></a>
 <span class="sourceLineNo">173</span><a name="line.173"></a>
-<span class="sourceLineNo">174</span>    return header;<a name="line.174"></a>
-<span class="sourceLineNo">175</span>  }<a name="line.175"></a>
-<span class="sourceLineNo">176</span><a name="line.176"></a>
-<span class="sourceLineNo">177</span>  public static ProcedureWALTrailer readTrailer(FSDataInputStream stream, long startPos, long size)<a name="line.177"></a>
-<span class="sourceLineNo">178</span>      throws IOException {<a name="line.178"></a>
-<span class="sourceLineNo">179</span>    // Beginning of the Trailer Jump. 17 = 1 byte version + 8 byte magic + 8 byte offset<a name="line.179"></a>
-<span class="sourceLineNo">180</span>    long trailerPos = size - 17;<a name="line.180"></a>
-<span class="sourceLineNo">181</span><a name="line.181"></a>
-<span class="sourceLineNo">182</span>    if (trailerPos &lt; startPos) {<a name="line.182"></a>
-<span class="sourceLineNo">183</span>      throw new InvalidWALDataException("Missing trailer: size=" + size + " startPos=" + startPos);<a name="line.183"></a>
-<span class="sourceLineNo">184</span>    }<a name="line.184"></a>
-<span class="sourceLineNo">185</span><a name="line.185"></a>
-<span class="sourceLineNo">186</span>    stream.seek(trailerPos);<a name="line.186"></a>
-<span class="sourceLineNo">187</span>    int version = stream.read();<a name="line.187"></a>
-<span class="sourceLineNo">188</span>    if (version != TRAILER_VERSION) {<a name="line.188"></a>
-<span class="sourceLineNo">189</span>      throw new InvalidWALDataException("Invalid Trailer version. got " + version +<a name="line.189"></a>
-<span class="sourceLineNo">190</span>          " expected " + TRAILER_VERSION);<a name="line.190"></a>
-<span class="sourceLineNo">191</span>    }<a name="line.191"></a>
-<span class="sourceLineNo">192</span><a name="line.192"></a>
-<span class="sourceLineNo">193</span>    long magic = StreamUtils.readLong(stream);<a name="line.193"></a>
-<span class="sourceLineNo">194</span>    if (magic != TRAILER_MAGIC) {<a name="line.194"></a>
-<span class="sourceLineNo">195</span>      throw new InvalidWALDataException("Invalid Trailer magic. got " + magic +<a name="line.195"></a>
-<span class="sourceLineNo">196</span>          " expected " + TRAILER_MAGIC);<a name="line.196"></a>
-<span class="sourceLineNo">197</span>    }<a name="line.197"></a>
+<span class="sourceLineNo">174</span>  public static ProcedureWALTrailer readTrailer(FSDataInputStream stream, long startPos, long size)<a name="line.174"></a>
+<span class="sourceLineNo">175</span>      throws IOException {<a name="line.175"></a>
+<span class="sourceLineNo">176</span>    // Beginning of the Trailer Jump. 17 = 1 byte version + 8 byte magic + 8 byte offset<a name="line.176"></a>
+<span class="sourceLineNo">177</span>    long trailerPos = size - 17;<a name="line.177"></a>
+<span class="sourceLineNo">178</span><a name="line.178"></a>
+<span class="sourceLineNo">179</span>    if (trailerPos &lt; startPos) {<a name="line.179"></a>
+<span class="sourceLineNo">180</span>      throw new InvalidWALDataException("Missing trailer: size=" + size + " startPos=" + startPos);<a name="line.180"></a>
+<span class="sourceLineNo">181</span>    }<a name="line.181"></a>
+<span class="sourceLineNo">182</span><a name="line.182"></a>
+<span class="sourceLineNo">183</span>    stream.seek(trailerPos);<a name="line.183"></a>
+<span class="sourceLineNo">184</span>    int version = stream.read();<a name="line.184"></a>
+<span class="sourceLineNo">185</span>    if (version != TRAILER_VERSION) {<a name="line.185"></a>
+<span class="sourceLineNo">186</span>      throw new InvalidWALDataException("Invalid Trailer version. got " + version +<a name="line.186"></a>
+<span class="sourceLineNo">187</span>          " expected " + TRAILER_VERSION);<a name="line.187"></a>
+<span class="sourceLineNo">188</span>    }<a name="line.188"></a>
+<span class="sourceLineNo">189</span><a name="line.189"></a>
+<span class="sourceLineNo">190</span>    long magic = StreamUtils.readLong(stream);<a name="line.190"></a>
+<span class="sourceLineNo">191</span>    if (magic != TRAILER_MAGIC) {<a name="line.191"></a>
+<span class="sourceLineNo">192</span>      throw new InvalidWALDataException("Invalid Trailer magic. got " + magic +<a name="line.192"></a>
+<span class="sourceLineNo">193</span>          " expected " + TRAILER_MAGIC);<a name="line.193"></a>
+<span class="sourceLineNo">194</span>    }<a name="line.194"></a>
+<span class="sourceLineNo">195</span><a name="line.195"></a>
+<span class="sourceLineNo">196</span>    long trailerOffset = StreamUtils.readLong(stream);<a name="line.196"></a>
+<span class="sourceLineNo">197</span>    stream.seek(trailerOffset);<a name="line.197"></a>
 <span class="sourceLineNo">198</span><a name="line.198"></a>
-<span class="sourceLineNo">199</span>    long trailerOffset = StreamUtils.readLong(stream);<a name="line.199"></a>
-<span class="sourceLineNo">200</span>    stream.seek(trailerOffset);<a name="line.200"></a>
-<span class="sourceLineNo">201</span><a name="line.201"></a>
-<span class="sourceLineNo">202</span>    ProcedureWALEntry entry = readEntry(stream);<a name="line.202"></a>
-<span class="sourceLineNo">203</span>    if (entry.getType() != ProcedureWALEntry.Type.PROCEDURE_WAL_EOF) {<a name="line.203"></a>
-<span class="sourceLineNo">204</span>      throw new InvalidWALDataException("Invalid Trailer begin");<a name="line.204"></a>
-<span class="sourceLineNo">205</span>    }<a name="line.205"></a>
-<span class="sourceLineNo">206</span><a name="line.206"></a>
-<span class="sourceLineNo">207</span>    ProcedureWALTrailer trailer = ProcedureWALTrailer.newBuilder()<a name="line.207"></a>
-<span class="sourceLineNo">208</span>      .setVersion(version)<a name="line.208"></a>
-<span class="sourceLineNo">209</span>      .setTrackerPos(stream.getPos())<a name="line.209"></a>
-<span class="sourceLineNo">210</span>      .build();<a name="line.210"></a>
-<span class="sourceLineNo">211</span>    return trailer;<a name="line.211"></a>
-<span class="sourceLineNo">212</span>  }<a name="line.212"></a>
-<span class="sourceLineNo">213</span><a name="line.213"></a>
-<span class="sourceLineNo">214</span>  public static ProcedureWALEntry readEntry(InputStream stream) throws IOException {<a name="line.214"></a>
-<span class="sourceLineNo">215</span>    return ProcedureWALEntry.parseDelimitedFrom(stream);<a name="line.215"></a>
-<span class="sourceLineNo">216</span>  }<a name="line.216"></a>
-<span class="sourceLineNo">217</span><a name="line.217"></a>
-<span class="sourceLineNo">218</span>  public static void writeEntry(ByteSlot slot, ProcedureWALEntry.Type type,<a name="line.218"></a>
-<span class="sourceLineNo">219</span>      Procedure&lt;?&gt; proc, Procedure&lt;?&gt;[] subprocs) throws IOException {<a name="line.219"></a>
-<span class="sourceLineNo">220</span>    final ProcedureWALEntry.Builder builder = ProcedureWALEntry.newBuilder();<a name="line.220"></a>
-<span class="sourceLineNo">221</span>    builder.setType(type);<a name="line.221"></a>
-<span class="sourceLineNo">222</span>    builder.addProcedure(ProcedureUtil.convertToProtoProcedure(proc));<a name="line.222"></a>
-<span class="sourceLineNo">223</span>    if (subprocs != null) {<a name="line.223"></a>
-<span class="sourceLineNo">224</span>      for (int i = 0; i &lt; subprocs.length; ++i) {<a name="line.224"></a>
-<span class="sourceLineNo">225</span>        builder.addProcedure(ProcedureUtil.convertToProtoProcedure(subprocs[i]));<a name="line.225"></a>
-<span class="sourceLineNo">226</span>      }<a name="line.226"></a>
-<span class="sourceLineNo">227</span>    }<a name="line.227"></a>
-<span class="sourceLineNo">228</span>    builder.build().writeDelimitedTo(slot);<a name="line.228"></a>
-<span class="sourceLineNo">229</span>  }<a name="line.229"></a>
-<span class="sourceLineNo">230</span><a name="line.230"></a>
-<span class="sourceLineNo">231</span>  public static void writeInsert(ByteSlot slot, Procedure&lt;?&gt; proc)<a name="line.231"></a>
-<span class="sourceLineNo">232</span>      throws IOException {<a name="line.232"></a>
-<span class="sourceLineNo">233</span>    writeEntry(slot, ProcedureWALEntry.Type.PROCEDURE_WAL_INIT, proc, null);<a name="line.233"></a>
-<span class="sourceLineNo">234</span>  }<a name="line.234"></a>
-<span class="sourceLineNo">235</span><a name="line.235"></a>
-<span class="sourceLineNo">236</span>  public static void writeInsert(ByteSlot slot, Procedure&lt;?&gt; proc, Procedure&lt;?&gt;[] subprocs)<a name="line.236"></a>
-<span class="sourceLineNo">237</span>      throws IOException {<a name="line.237"></a>
-<span class="sourceLineNo">238</span>    writeEntry(slot, ProcedureWALEntry.Type.PROCEDURE_WAL_INSERT, proc, subprocs);<a name="line.238"></a>
-<span class="sourceLineNo">239</span>  }<a name="line.239"></a>
-<span class="sourceLineNo">240</span><a name="line.240"></a>
-<span class="sourceLineNo">241</span>  public static void writeUpdate(ByteSlot slot, Procedure&lt;?&gt; proc)<a name="line.241"></a>
-<span class="sourceLineNo">242</span>      throws IOException {<a name="line.242"></a>
-<span class="sourceLineNo">243</span>    writeEntry(slot, ProcedureWALEntry.Type.PROCEDURE_WAL_UPDATE, proc, null);<a name="line.243"></a>
-<span class="sourceLineNo">244</span>  }<a name="line.244"></a>
-<span class="sourceLineNo">245</span><a name="line.245"></a>
-<span class="sourceLineNo">246</span>  public static void writeDelete(ByteSlot slot, long procId)<a name="line.246"></a>
-<span class="sourceLineNo">247</span>      throws IOException {<a name="line.247"></a>
-<span class="sourceLineNo">248</span>    final ProcedureWALEntry.Builder builder = ProcedureWALEntry.newBuilder();<a name="line.248"></a>
-<span class="sourceLineNo">249</span>    builder.setType(ProcedureWALEntry.Type.PROCEDURE_WAL_DELETE);<a name="line.249"></a>
-<span class="sourceLineNo">250</span>    builder.setProcId(procId);<a name="line.250"></a>
-<span class="sourceLineNo">251</span>    builder.build().writeDelimitedTo(slot);<a name="line.251"></a>
-<span class="sourceLineNo">252</span>  }<a name="line.252"></a>
-<span class="sourceLineNo">253</span><a name="line.253"></a>
-<span class="sourceLineNo">254</span>  public static void writeDelete(ByteSlot slot, Procedure&lt;?&gt; proc, long[] subprocs)<a name="line.254"></a>
-<span class="sourceLineNo">255</span>      throws IOException {<a name="line.255"></a>
-<span class="sourceLineNo">256</span>    final ProcedureWALEntry.Builder builder = ProcedureWALEntry.newBuilder();<a name="line.256"></a>
-<span class="sourceLineNo">257</span>    builder.setType(ProcedureWALEntry.Type.PROCEDURE_WAL_DELETE);<a name="line.257"></a>
-<span class="sourceLineNo">258</span>    builder.setProcId(proc.getProcId());<a name="line.258"></a>
-<span class="sourceLineNo">259</span>    if (subprocs != null) {<a name="line.259"></a>
-<span class="sourceLineNo">260</span>      builder.addProcedure(ProcedureUtil.convertToProtoProcedure(proc));<a name="line.260"></a>
-<span class="sourceLineNo">261</span>      for (int i = 0; i &lt; subprocs.length; ++i) {<a name="line.261"></a>
-<span class="sourceLineNo">262</span>        builder.addChildId(subprocs[i]);<a name="line.262"></a>
-<span class="sourceLineNo">263</span>      }<a name="line.263"></a>
-<span class="sourceLineNo">264</span>    }<a name="line.264"></a>
-<span class="sourceLineNo">265</span>    builder.build().writeDelimitedTo(slot);<a name="line.265"></a>
-<span class="sourceLineNo">266</span>  }<a name="line.266"></a>
-<span class="sourceLineNo">267</span>}<a name="line.267"></a>
+<span class="sourceLineNo">199</span>    ProcedureWALEntry entry = readEntry(stream);<a name="line.199"></a>
+<span class="sourceLineNo">200</span>    if (entry.getType() != ProcedureWALEntry.Type.PROCEDURE_WAL_EOF) {<a name="line.200"></a>
+<span class="sourceLineNo">201</span>      throw new InvalidWALDataException("Invalid Trailer begin");<a name="line.201"></a>
+<span class="sourceLineNo">202</span>    }<a name="line.202"></a>
+<span class="sourceLineNo">203</span><a name="line.203"></a>
+<span class="sourceLineNo">204</span>    ProcedureWALTrailer trailer = ProcedureWALTrailer.newBuilder()<a name="line.204"></a>
+<span class="sourceLineNo">205</span>      .setVersion(version)<a name="line.205"></a>
+<span class="sourceLineNo">206</span>      .setTrackerPos(stream.getPos())<a name="line.206"></a>
+<span class="sourceLineNo">207</span>      .build();<a name="line.207"></a>
+<span class="sourceLineNo">208</span>    return trailer;<a name="line.208"></a>
+<span class="sourceLineNo">209</span>  }<a name="line.209"></a>
+<span class="sourceLineNo">210</span><a name="line.210"></a>
+<span class="sourceLineNo">211</span>  public static ProcedureWALEntry readEntry(InputStream stream) throws IOException {<a name="line.211"></a>
+<span class="sourceLineNo">212</span>    return ProcedureWALEntry.parseDelimitedFrom(stream);<a name="line.212"></a>
+<span class="sourceLineNo">213</span>  }<a name="line.213"></a>
+<span class="sourceLineNo">214</span><a name="line.214"></a>
+<span class="sourceLineNo">215</span>  public static void writeEntry(ByteSlot slot, ProcedureWALEntry.Type type,<a name="line.215"></a>
+<span class="sourceLineNo">216</span>      Procedure&lt;?&gt; proc, Procedure&lt;?&gt;[] subprocs) throws IOException {<a name="line.216"></a>
+<span class="sourceLineNo">217</span>    final ProcedureWALEntry.Builder builder = ProcedureWALEntry.newBuilder();<a name="line.217"></a>
+<span class="sourceLineNo">218</span>    builder.setType(type);<a name="line.218"></a>
+<span class="sourceLineNo">219</span>    builder.addProcedure(ProcedureUtil.convertToProtoProcedure(proc));<a name="line.219"></a>
+<span class="sourceLineNo">220</span>    if (subprocs != null) {<a name="line.220"></a>
+<span class="sourceLineNo">221</span>      for (int i = 0; i &lt; subprocs.length; ++i) {<a name="line.221"></a>
+<span class="sourceLineNo">222</span>        builder.addProcedure(ProcedureUtil.convertToProtoProcedure(subprocs[i]));<a name="line.222"></a>
+<span class="sourceLineNo">223</span>      }<a name="line.223"></a>
+<span class="sourceLineNo">224</span>    }<a name="line.224"></a>
+<span class="sourceLineNo">225</span>    builder.build().writeDelimitedTo(slot);<a name="line.225"></a>
+<span class="sourceLineNo">226</span>  }<a name="line.226"></a>
+<span class="sourceLineNo">227</span><a name="line.227"></a>
+<span class="sourceLineNo">228</span>  public static void writeInsert(ByteSlot slot, Procedure&lt;?&gt; proc)<a name="line.228"></a>
+<span class="sourceLineNo">229</span>      throws IOException {<a name="line.229"></a>
+<span class="sourceLineNo">230</span>    writeEntry(slot, ProcedureWALEntry.Type.PROCEDURE_WAL_INIT, proc, null);<a name="line.230"></a>
+<span class="sourceLineNo">231</span>  }<a name="line.231"></a>
+<span class="sourceLineNo">232</span><a name="line.232"></a>
+<span class="sourceLineNo">233</span>  public static void writeInsert(ByteSlot slot, Procedure&lt;?&gt; proc, Procedure&lt;?&gt;[] subprocs)<a name="line.233"></a>
+<span class="sourceLineNo">234</span>      throws IOException {<a name="line.234"></a>
+<span class="sourceLineNo">235</span>    writeEntry(slot, ProcedureWALEntry.Type.PROCEDURE_WAL_INSERT, proc, subprocs);<a name="line.235"></a>
+<span class="sourceLineNo">236</span>  }<a name="line.236"></a>
+<span class="sourceLineNo">237</span><a name="line.237"></a>
+<span class="sourceLineNo">238</span>  public static void writeUpdate(ByteSlot slot, Procedure&lt;?&gt; proc)<a name="line.238"></a>
+<span class="sourceLineNo">239</span>      throws IOException {<a name="line.239"></a>
+<span class="sourceLineNo">240</span>    writeEntry(slot, ProcedureWALEntry.Type.PROCEDURE_WAL_UPDATE, proc, null);<a name="line.240"></a>
+<span class="sourceLineNo">241</span>  }<a name="line.241"></a>
+<span class="sourceLineNo">242</span><a name="line.242"></a>
+<span class="sourceLineNo">243</span>  public static void writeDelete(ByteSlot slot, long procId)<a name="line.243"></a>
+<span class="sourceLineNo">244</span>      throws IOException {<a name="line.244"></a>
+<span class="sourceLineNo">245</span>    final ProcedureWALEntry.Builder builder = ProcedureWALEntry.newBuilder();<a name="line.245"></a>
+<span class="sourceLineNo">246</span>    builder.setType(ProcedureWALEntry.Type.PROCEDURE_WAL_DELETE);<a name="line.246"></a>
+<span class="sourceLineNo">247</span>    builder.setProcId(procId);<a name="line.247"></a>
+<span class="sourceLineNo">248</span>    builder.build().writeDelimitedTo(slot);<a name="line.248"></a>
+<span class="sourceLineNo">249</span>  }<a name="line.249"></a>
+<span class="sourceLineNo">250</span><a name="line.250"></a>
+<span class="sourceLineNo">251</span>  public static void writeDelete(ByteSlot slot, Procedure&lt;?&gt; proc, long[] subprocs)<a name="line.251"></a>
+<span class="sourceLineNo">252</span>      throws IOException {<a name="line.252"></a>
+<span class="sourceLineNo">253</span>    final ProcedureWALEntry.Builder builder = ProcedureWALEntry.newBuilder();<a name="line.253"></a>
+<span class="sourceLineNo">254</span>    builder.setType(ProcedureWALEntry.Type.PROCEDURE_WAL_DELETE);<a name="line.254"></a>
+<span class="sourceLineNo">255</span>    builder.setProcId(proc.getProcId());<a name="line.255"></a>
+<span class="sourceLineNo">256</span>    if (subprocs != null) {<a name="line.256"></a>
+<span class="sourceLineNo">257</span>      builder.addProcedure(ProcedureUtil.convertToProtoProcedure(proc));<a name="line.257"></a>
+<span class="sourceLineNo">258</span>      for (int i = 0; i &lt; subprocs.length; ++i) {<a name="line.258"></a>
+<span class="sourceLineNo">259</span>        builder.addChildId(subprocs[i]);<a name="line.259"></a>
+<span class="sourceLineNo">260</span>      }<a name="line.260"></a>
+<span class="sourceLineNo">261</span>    }<a name="line.261"></a>
+<span class="sourceLineNo">262</span>    builder.build().writeDelimitedTo(slot);<a name="line.262"></a>
+<span class="sourceLineNo">263</span>  }<a name="line.263"></a>
+<span class="sourceLineNo">264</span>}<a name="line.264"></a>
 
 
 
index 257263c..7a81ab8 100644 (file)
 <span class="sourceLineNo">088</span>      Loader loader) throws IOException {<a name="line.88"></a>
 <span class="sourceLineNo">089</span>    ProcedureWALFormatReader reader = new ProcedureWALFormatReader(tracker, loader);<a name="line.89"></a>
 <span class="sourceLineNo">090</span>    tracker.setKeepDeletes(true);<a name="line.90"></a>
-<span class="sourceLineNo">091</span>    try {<a name="line.91"></a>
-<span class="sourceLineNo">092</span>      // Ignore the last log which is current active log.<a name="line.92"></a>
-<span class="sourceLineNo">093</span>      while (logs.hasNext()) {<a name="line.93"></a>
-<span class="sourceLineNo">094</span>        ProcedureWALFile log = logs.next();<a name="line.94"></a>
-<span class="sourceLineNo">095</span>        log.open();<a name="line.95"></a>
-<span class="sourceLineNo">096</span>        try {<a name="line.96"></a>
-<span class="sourceLineNo">097</span>          reader.read(log);<a name="line.97"></a>
-<span class="sourceLineNo">098</span>        } finally {<a name="line.98"></a>
-<span class="sourceLineNo">099</span>          log.close();<a name="line.99"></a>
-<span class="sourceLineNo">100</span>        }<a name="line.100"></a>
-<span class="sourceLineNo">101</span>      }<a name="line.101"></a>
-<span class="sourceLineNo">102</span>      reader.finish();<a name="line.102"></a>
-<span class="sourceLineNo">103</span><a name="line.103"></a>
-<span class="sourceLineNo">104</span>      // The tracker is now updated with all the procedures read from the logs<a name="line.104"></a>
-<span class="sourceLineNo">105</span>      if (tracker.isPartial()) {<a name="line.105"></a>
-<span class="sourceLineNo">106</span>        tracker.setPartialFlag(false);<a name="line.106"></a>
-<span class="sourceLineNo">107</span>      }<a name="line.107"></a>
-<span class="sourceLineNo">108</span>      tracker.resetModified();<a name="line.108"></a>
-<span class="sourceLineNo">109</span>    } finally {<a name="line.109"></a>
-<span class="sourceLineNo">110</span>      tracker.setKeepDeletes(false);<a name="line.110"></a>
-<span class="sourceLineNo">111</span>    }<a name="line.111"></a>
-<span class="sourceLineNo">112</span>  }<a name="line.112"></a>
-<span class="sourceLineNo">113</span><a name="line.113"></a>
-<span class="sourceLineNo">114</span>  public static void writeHeader(OutputStream stream, ProcedureWALHeader header)<a name="line.114"></a>
-<span class="sourceLineNo">115</span>      throws IOException {<a name="line.115"></a>
-<span class="sourceLineNo">116</span>    header.writeDelimitedTo(stream);<a name="line.116"></a>
-<span class="sourceLineNo">117</span>  }<a name="line.117"></a>
-<span class="sourceLineNo">118</span><a name="line.118"></a>
-<span class="sourceLineNo">119</span>  /*<a name="line.119"></a>
-<span class="sourceLineNo">120</span>   * +-----------------+<a name="line.120"></a>
-<span class="sourceLineNo">121</span>   * | END OF WAL DATA | &lt;---+<a name="line.121"></a>
-<span class="sourceLineNo">122</span>   * +-----------------+     |<a name="line.122"></a>
-<span class="sourceLineNo">123</span>   * |                 |     |<a name="line.123"></a>
-<span class="sourceLineNo">124</span>   * |     Tracker     |     |<a name="line.124"></a>
-<span class="sourceLineNo">125</span>   * |                 |     |<a name="line.125"></a>
-<span class="sourceLineNo">126</span>   * +-----------------+     |<a name="line.126"></a>
-<span class="sourceLineNo">127</span>   * |     version     |     |<a name="line.127"></a>
-<span class="sourceLineNo">128</span>   * +-----------------+     |<a name="line.128"></a>
-<span class="sourceLineNo">129</span>   * |  TRAILER_MAGIC  |     |<a name="line.129"></a>
-<span class="sourceLineNo">130</span>   * +-----------------+     |<a name="line.130"></a>
-<span class="sourceLineNo">131</span>   * |      offset     |-----+<a name="line.131"></a>
-<span class="sourceLineNo">132</span>   * +-----------------+<a name="line.132"></a>
-<span class="sourceLineNo">133</span>   */<a name="line.133"></a>
-<span class="sourceLineNo">134</span>  public static long writeTrailer(FSDataOutputStream stream, ProcedureStoreTracker tracker)<a name="line.134"></a>
-<span class="sourceLineNo">135</span>      throws IOException {<a name="line.135"></a>
-<span class="sourceLineNo">136</span>    long offset = stream.getPos();<a name="line.136"></a>
-<span class="sourceLineNo">137</span><a name="line.137"></a>
-<span class="sourceLineNo">138</span>    // Write EOF Entry<a name="line.138"></a>
-<span class="sourceLineNo">139</span>    ProcedureWALEntry.newBuilder()<a name="line.139"></a>
-<span class="sourceLineNo">140</span>      .setType(ProcedureWALEntry.Type.PROCEDURE_WAL_EOF)<a name="line.140"></a>
-<span class="sourceLineNo">141</span>      .build().writeDelimitedTo(stream);<a name="line.141"></a>
+<span class="sourceLineNo">091</span>    // Ignore the last log which is current active log.<a name="line.91"></a>
+<span class="sourceLineNo">092</span>    while (logs.hasNext()) {<a name="line.92"></a>
+<span class="sourceLineNo">093</span>      ProcedureWALFile log = logs.next();<a name="line.93"></a>
+<span class="sourceLineNo">094</span>      log.open();<a name="line.94"></a>
+<span class="sourceLineNo">095</span>      try {<a name="line.95"></a>
+<span class="sourceLineNo">096</span>        reader.read(log);<a name="line.96"></a>
+<span class="sourceLineNo">097</span>      } finally {<a name="line.97"></a>
+<span class="sourceLineNo">098</span>        log.close();<a name="line.98"></a>
+<span class="sourceLineNo">099</span>      }<a name="line.99"></a>
+<span class="sourceLineNo">100</span>    }<a name="line.100"></a>
+<span class="sourceLineNo">101</span>    reader.finish();<a name="line.101"></a>
+<span class="sourceLineNo">102</span><a name="line.102"></a>
+<span class="sourceLineNo">103</span>    // The tracker is now updated with all the procedures read from the logs<a name="line.103"></a>
+<span class="sourceLineNo">104</span>    if (tracker.isPartial()) {<a name="line.104"></a>
+<span class="sourceLineNo">105</span>      tracker.setPartialFlag(false);<a name="line.105"></a>
+<span class="sourceLineNo">106</span>    }<a name="line.106"></a>
+<span class="sourceLineNo">107</span>    tracker.resetModified();<a name="line.107"></a>
+<span class="sourceLineNo">108</span>    tracker.setKeepDeletes(false);<a name="line.108"></a>
+<span class="sourceLineNo">109</span>  }<a name="line.109"></a>
+<span class="sourceLineNo">110</span><a name="line.110"></a>
+<span class="sourceLineNo">111</span>  public static void writeHeader(OutputStream stream, ProcedureWALHeader header)<a name="line.111"></a>
+<span class="sourceLineNo">112</span>      throws IOException {<a name="line.112"></a>
+<span class="sourceLineNo">113</span>    header.writeDelimitedTo(stream);<a name="line.113"></a>
+<span class="sourceLineNo">114</span>  }<a name="line.114"></a>
+<span class="sourceLineNo">115</span><a name="line.115"></a>
+<span class="sourceLineNo">116</span>  /*<a name="line.116"></a>
+<span class="sourceLineNo">117</span>   * +-----------------+<a name="line.117"></a>
+<span class="sourceLineNo">118</span>   * | END OF WAL DATA | &lt;---+<a name="line.118"></a>
+<span class="sourceLineNo">119</span>   * +-----------------+     |<a name="line.119"></a>
+<span class="sourceLineNo">120</span>   * |                 |     |<a name="line.120"></a>
+<span class="sourceLineNo">121</span>   * |     Tracker     |     |<a name="line.121"></a>
+<span class="sourceLineNo">122</span>   * |                 |     |<a name="line.122"></a>
+<span class="sourceLineNo">123</span>   * +-----------------+     |<a name="line.123"></a>
+<span class="sourceLineNo">124</span>   * |     version     |     |<a name="line.124"></a>
+<span class="sourceLineNo">125</span>   * +-----------------+     |<a name="line.125"></a>
+<span class="sourceLineNo">126</span>   * |  TRAILER_MAGIC  |     |<a name="line.126"></a>
+<span class="sourceLineNo">127</span>   * +-----------------+     |<a name="line.127"></a>
+<span class="sourceLineNo">128</span>   * |      offset     |-----+<a name="line.128"></a>
+<span class="sourceLineNo">129</span>   * +-----------------+<a name="line.129"></a>
+<span class="sourceLineNo">130</span>   */<a name="line.130"></a>
+<span class="sourceLineNo">131</span>  public static long writeTrailer(FSDataOutputStream stream, ProcedureStoreTracker tracker)<a name="line.131"></a>
+<span class="sourceLineNo">132</span>      throws IOException {<a name="line.132"></a>
+<span class="sourceLineNo">133</span>    long offset = stream.getPos();<a name="line.133"></a>
+<span class="sourceLineNo">134</span><a name="line.134"></a>
+<span class="sourceLineNo">135</span>    // Write EOF Entry<a name="line.135"></a>
+<span class="sourceLineNo">136</span>    ProcedureWALEntry.newBuilder()<a name="line.136"></a>
+<span class="sourceLineNo">137</span>      .setType(ProcedureWALEntry.Type.PROCEDURE_WAL_EOF)<a name="line.137"></a>
+<span class="sourceLineNo">138</span>      .build().writeDelimitedTo(stream);<a name="line.138"></a>
+<span class="sourceLineNo">139</span><a name="line.139"></a>
+<span class="sourceLineNo">140</span>    // Write Tracker<a name="line.140"></a>
+<span class="sourceLineNo">141</span>    tracker.toProto().writeDelimitedTo(stream);<a name="line.141"></a>
 <span class="sourceLineNo">142</span><a name="line.142"></a>
-<span class="sourceLineNo">143</span>    // Write Tracker<a name="line.143"></a>
-<span class="sourceLineNo">144</span>    tracker.toProto().writeDelimitedTo(stream);<a name="line.144"></a>
-<span class="sourceLineNo">145</span><a name="line.145"></a>
-<span class="sourceLineNo">146</span>    stream.write(TRAILER_VERSION);<a name="line.146"></a>
-<span class="sourceLineNo">147</span>    StreamUtils.writeLong(stream, TRAILER_MAGIC);<a name="line.147"></a>
-<span class="sourceLineNo">148</span>    StreamUtils.writeLong(stream, offset);<a name="line.148"></a>
-<span class="sourceLineNo">149</span>    return stream.getPos() - offset;<a name="line.149"></a>
-<span class="sourceLineNo">150</span>  }<a name="line.150"></a>
-<span class="sourceLineNo">151</span><a name="line.151"></a>
-<span class="sourceLineNo">152</span>  public static ProcedureWALHeader readHeader(InputStream stream)<a name="line.152"></a>
-<span class="sourceLineNo">153</span>      throws IOException {<a name="line.153"></a>
-<span class="sourceLineNo">154</span>    ProcedureWALHeader header;<a name="line.154"></a>
-<span class="sourceLineNo">155</span>    try {<a name="line.155"></a>
-<span class="sourceLineNo">156</span>      header = ProcedureWALHeader.parseDelimitedFrom(stream);<a name="line.156"></a>
-<span class="sourceLineNo">157</span>    } catch (InvalidProtocolBufferException e) {<a name="line.157"></a>
-<span class="sourceLineNo">158</span>      throw new InvalidWALDataException(e);<a name="line.158"></a>
-<span class="sourceLineNo">159</span>    }<a name="line.159"></a>
-<span class="sourceLineNo">160</span><a name="line.160"></a>
-<span class="sourceLineNo">161</span>    if (header == null) {<a name="line.161"></a>
-<span class="sourceLineNo">162</span>      throw new InvalidWALDataException("No data available to read the Header");<a name="line.162"></a>
-<span class="sourceLineNo">163</span>    }<a name="line.163"></a>
-<span class="sourceLineNo">164</span><a name="line.164"></a>
-<span class="sourceLineNo">165</span>    if (header.getVersion() &lt; 0 || header.getVersion() != HEADER_VERSION) {<a name="line.165"></a>
-<span class="sourceLineNo">166</span>      throw new InvalidWALDataException("Invalid Header version. got " + header.getVersion() +<a name="line.166"></a>
-<span class="sourceLineNo">167</span>          " expected " + HEADER_VERSION);<a name="line.167"></a>
-<span class="sourceLineNo">168</span>    }<a name="line.168"></a>
-<span class="sourceLineNo">169</span><a name="line.169"></a>
-<span class="sourceLineNo">170</span>    if (header.getType() &lt; 0 || header.getType() &gt; LOG_TYPE_MAX_VALID) {<a name="line.170"></a>
-<span class="sourceLineNo">171</span>      throw new InvalidWALDataException("Invalid header type. got " + header.getType());<a name="line.171"></a>
-<span class="sourceLineNo">172</span>    }<a name="line.172"></a>
+<span class="sourceLineNo">143</span>    stream.write(TRAILER_VERSION);<a name="line.143"></a>
+<span class="sourceLineNo">144</span>    StreamUtils.writeLong(stream, TRAILER_MAGIC);<a name="line.144"></a>
+<span class="sourceLineNo">145</span>    StreamUtils.writeLong(stream, offset);<a name="line.145"></a>
+<span class="sourceLineNo">146</span>    return stream.getPos() - offset;<a name="line.146"></a>
+<span class="sourceLineNo">147</span>  }<a name="line.147"></a>
+<span class="sourceLineNo">148</span><a name="line.148"></a>
+<span class="sourceLineNo">149</span>  public static ProcedureWALHeader readHeader(InputStream stream)<a name="line.149"></a>
+<span class="sourceLineNo">150</span>      throws IOException {<a name="line.150"></a>
+<span class="sourceLineNo">151</span>    ProcedureWALHeader header;<a name="line.151"></a>
+<span class="sourceLineNo">152</span>    try {<a name="line.152"></a>
+<span class="sourceLineNo">153</span>      header = ProcedureWALHeader.parseDelimitedFrom(stream);<a name="line.153"></a>
+<span class="sourceLineNo">154</span>    } catch (InvalidProtocolBufferException e) {<a name="line.154"></a>
+<span class="sourceLineNo">155</span>      throw new InvalidWALDataException(e);<a name="line.155"></a>
+<span class="sourceLineNo">156</span>    }<a name="line.156"></a>
+<span class="sourceLineNo">157</span><a name="line.157"></a>
+<span class="sourceLineNo">158</span>    if (header == null) {<a name="line.158"></a>
+<span class="sourceLineNo">159</span>      throw new InvalidWALDataException("No data available to read the Header");<a name="line.159"></a>
+<span class="sourceLineNo">160</span>    }<a name="line.160"></a>
+<span class="sourceLineNo">161</span><a name="line.161"></a>
+<span class="sourceLineNo">162</span>    if (header.getVersion() &lt; 0 || header.getVersion() != HEADER_VERSION) {<a name="line.162"></a>
+<span class="sourceLineNo">163</span>      throw new InvalidWALDataException("Invalid Header version. got " + header.getVersion() +<a name="line.163"></a>
+<span class="sourceLineNo">164</span>          " expected " + HEADER_VERSION);<a name="line.164"></a>
+<span class="sourceLineNo">165</span>    }<a name="line.165"></a>
+<span class="sourceLineNo">166</span><a name="line.166"></a>
+<span class="sourceLineNo">167</span>    if (header.getType() &lt; 0 || header.getType() &gt; LOG_TYPE_MAX_VALID) {<a name="line.167"></a>
+<span class="sourceLineNo">168</span>      throw new InvalidWALDataException("Invalid header type. got " + header.getType());<a name="line.168"></a>
+<span class="sourceLineNo">169</span>    }<a name="line.169"></a>
+<span class="sourceLineNo">170</span><a name="line.170"></a>
+<span class="sourceLineNo">171</span>    return header;<a name="line.171"></a>
+<span class="sourceLineNo">172</span>  }<a name="line.172"></a>
 <span class="sourceLineNo">173</span><a name="line.173"></a>
-<span class="sourceLineNo">174</span>    return header;<a name="line.174"></a>
-<span class="sourceLineNo">175</span>  }<a name="line.175"></a>
-<span class="sourceLineNo">176</span><a name="line.176"></a>
-<span class="sourceLineNo">177</span>  public static ProcedureWALTrailer readTrailer(FSDataInputStream stream, long startPos, long size)<a name="line.177"></a>
-<span class="sourceLineNo">178</span>      throws IOException {<a name="line.178"></a>
-<span class="sourceLineNo">179</span>    // Beginning of the Trailer Jump. 17 = 1 byte version + 8 byte magic + 8 byte offset<a name="line.179"></a>
-<span class="sourceLineNo">180</span>    long trailerPos = size - 17;<a name="line.180"></a>
-<span class="sourceLineNo">181</span><a name="line.181"></a>
-<span class="sourceLineNo">182</span>    if (trailerPos &lt; startPos) {<a name="line.182"></a>
-<span class="sourceLineNo">183</span>      throw new InvalidWALDataException("Missing trailer: size=" + size + " startPos=" + startPos);<a name="line.183"></a>
-<span class="sourceLineNo">184</span>    }<a name="line.184"></a>
-<span class="sourceLineNo">185</span><a name="line.185"></a>
-<span class="sourceLineNo">186</span>    stream.seek(trailerPos);<a name="line.186"></a>
-<span class="sourceLineNo">187</span>    int version = stream.read();<a name="line.187"></a>
-<span class="sourceLineNo">188</span>    if (version != TRAILER_VERSION) {<a name="line.188"></a>
-<span class="sourceLineNo">189</span>      throw new InvalidWALDataException("Invalid Trailer version. got " + version +<a name="line.189"></a>
-<span class="sourceLineNo">190</span>          " expected " + TRAILER_VERSION);<a name="line.190"></a>
-<span class="sourceLineNo">191</span>    }<a name="line.191"></a>
-<span class="sourceLineNo">192</span><a name="line.192"></a>
-<span class="sourceLineNo">193</span>    long magic = StreamUtils.readLong(stream);<a name="line.193"></a>
-<span class="sourceLineNo">194</span>    if (magic != TRAILER_MAGIC) {<a name="line.194"></a>
-<span class="sourceLineNo">195</span>      throw new InvalidWALDataException("Invalid Trailer magic. got " + magic +<a name="line.195"></a>
-<span class="sourceLineNo">196</span>          " expected " + TRAILER_MAGIC);<a name="line.196"></a>
-<span class="sourceLineNo">197</span>    }<a name="line.197"></a>
+<span class="sourceLineNo">174</span>  public static ProcedureWALTrailer readTrailer(FSDataInputStream stream, long startPos, long size)<a name="line.174"></a>
+<span class="sourceLineNo">175</span>      throws IOException {<a name="line.175"></a>
+<span class="sourceLineNo">176</span>    // Beginning of the Trailer Jump. 17 = 1 byte version + 8 byte magic + 8 byte offset<a name="line.176"></a>
+<span class="sourceLineNo">177</span>    long trailerPos = size - 17;<a name="line.177"></a>
+<span class="sourceLineNo">178</span><a name="line.178"></a>
+<span class="sourceLineNo">179</span>    if (trailerPos &lt; startPos) {<a name="line.179"></a>
+<span class="sourceLineNo">180</span>      throw new InvalidWALDataException("Missing trailer: size=" + size + " startPos=" + startPos);<a name="line.180"></a>
+<span class="sourceLineNo">181</span>    }<a name="line.181"></a>
+<span class="sourceLineNo">182</span><a name="line.182"></a>
+<span class="sourceLineNo">183</span>    stream.seek(trailerPos);<a name="line.183"></a>
+<span class="sourceLineNo">184</span>    int version = stream.read();<a name="line.184"></a>
+<span class="sourceLineNo">185</span>    if (version != TRAILER_VERSION) {<a name="line.185"></a>
+<span class="sourceLineNo">186</span>      throw new InvalidWALDataException("Invalid Trailer version. got " + version +<a name="line.186"></a>
+<span class="sourceLineNo">187</span>          " expected " + TRAILER_VERSION);<a name="line.187"></a>
+<span class="sourceLineNo">188</span>    }<a name="line.188"></a>
+<span class="sourceLineNo">189</span><a name="line.189"></a>
+<span class="sourceLineNo">190</span>    long magic = StreamUtils.readLong(stream);<a name="line.190"></a>
+<span class="sourceLineNo">191</span>    if (magic != TRAILER_MAGIC) {<a name="line.191"></a>
+<span class="sourceLineNo">192</span>      throw new InvalidWALDataException("Invalid Trailer magic. got " + magic +<a name="line.192"></a>
+<span class="sourceLineNo">193</span>          " expected " + TRAILER_MAGIC);<a name="line.193"></a>
+<span class="sourceLineNo">194</span>    }<a name="line.194"></a>
+<span class="sourceLineNo">195</span><a name="line.195"></a>
+<span class="sourceLineNo">196</span>    long trailerOffset = StreamUtils.readLong(stream);<a name="line.196"></a>
+<span class="sourceLineNo">197</span>    stream.seek(trailerOffset);<a name="line.197"></a>
 <span class="sourceLineNo">198</span><a name="line.198"></a>
-<span class="sourceLineNo">199</span>    long trailerOffset = StreamUtils.readLong(stream);<a name="line.199"></a>
-<span class="sourceLineNo">200</span>    stream.seek(trailerOffset);<a name="line.200"></a>
-<span class="sourceLineNo">201</span><a name="line.201"></a>
-<span class="sourceLineNo">202</span>    ProcedureWALEntry entry = readEntry(stream);<a name="line.202"></a>
-<span class="sourceLineNo">203</span>    if (entry.getType() != ProcedureWALEntry.Type.PROCEDURE_WAL_EOF) {<a name="line.203"></a>
-<span class="sourceLineNo">204</span>      throw new InvalidWALDataException("Invalid Trailer begin");<a name="line.204"></a>
-<span class="sourceLineNo">205</span>    }<a name="line.205"></a>
-<span class="sourceLineNo">206</span><a name="line.206"></a>
-<span class="sourceLineNo">207</span>    ProcedureWALTrailer trailer = ProcedureWALTrailer.newBuilder()<a name="line.207"></a>
-<span class="sourceLineNo">208</span>      .setVersion(version)<a name="line.208"></a>
-<span class="sourceLineNo">209</span>      .setTrackerPos(stream.getPos())<a name="line.209"></a>
-<span class="sourceLineNo">210</span>      .build();<a name="line.210"></a>
-<span class="sourceLineNo">211</span>    return trailer;<a name="line.211"></a>
-<span class="sourceLineNo">212</span>  }<a name="line.212"></a>
-<span class="sourceLineNo">213</span><a name="line.213"></a>
-<span class="sourceLineNo">214</span>  public static ProcedureWALEntry readEntry(InputStream stream) throws IOException {<a name="line.214"></a>
-<span class="sourceLineNo">215</span>    return ProcedureWALEntry.parseDelimitedFrom(stream);<a name="line.215"></a>
-<span class="sourceLineNo">216</span>  }<a name="line.216"></a>
-<span class="sourceLineNo">217</span><a name="line.217"></a>
-<span class="sourceLineNo">218</span>  public static void writeEntry(ByteSlot slot, ProcedureWALEntry.Type type,<a name="line.218"></a>
-<span class="sourceLineNo">219</span>      Procedure&lt;?&gt; proc, Procedure&lt;?&gt;[] subprocs) throws IOException {<a name="line.219"></a>
-<span class="sourceLineNo">220</span>    final ProcedureWALEntry.Builder builder = ProcedureWALEntry.newBuilder();<a name="line.220"></a>
-<span class="sourceLineNo">221</span>    builder.setType(type);<a name="line.221"></a>
-<span class="sourceLineNo">222</span>    builder.addProcedure(ProcedureUtil.convertToProtoProcedure(proc));<a name="line.222"></a>
-<span class="sourceLineNo">223</span>    if (subprocs != null) {<a name="line.223"></a>
-<span class="sourceLineNo">224</span>      for (int i = 0; i &lt; subprocs.length; ++i) {<a name="line.224"></a>
-<span class="sourceLineNo">225</span>        builder.addProcedure(ProcedureUtil.convertToProtoProcedure(subprocs[i]));<a name="line.225"></a>
-<span class="sourceLineNo">226</span>      }<a name="line.226"></a>
-<span class="sourceLineNo">227</span>    }<a name="line.227"></a>
-<span class="sourceLineNo">228</span>    builder.build().writeDelimitedTo(slot);<a name="line.228"></a>
-<span class="sourceLineNo">229</span>  }<a name="line.229"></a>
-<span class="sourceLineNo">230</span><a name="line.230"></a>
-<span class="sourceLineNo">231</span>  public static void writeInsert(ByteSlot slot, Procedure&lt;?&gt; proc)<a name="line.231"></a>
-<span class="sourceLineNo">232</span>      throws IOException {<a name="line.232"></a>
-<span class="sourceLineNo">233</span>    writeEntry(slot, ProcedureWALEntry.Type.PROCEDURE_WAL_INIT, proc, null);<a name="line.233"></a>
-<span class="sourceLineNo">234</span>  }<a name="line.234"></a>
-<span class="sourceLineNo">235</span><a name="line.235"></a>
-<span class="sourceLineNo">236</span>  public static void writeInsert(ByteSlot slot, Procedure&lt;?&gt; proc, Procedure&lt;?&gt;[] subprocs)<a name="line.236"></a>
-<span class="sourceLineNo">237</span>      throws IOException {<a name="line.237"></a>
-<span class="sourceLineNo">238</span>    writeEntry(slot, ProcedureWALEntry.Type.PROCEDURE_WAL_INSERT, proc, subprocs);<a name="line.238"></a>
-<span class="sourceLineNo">239</span>  }<a name="line.239"></a>
-<span class="sourceLineNo">240</span><a name="line.240"></a>
-<span class="sourceLineNo">241</span>  public static void writeUpdate(ByteSlot slot, Procedure&lt;?&gt; proc)<a name="line.241"></a>
-<span class="sourceLineNo">242</span>      throws IOException {<a name="line.242"></a>
-<span class="sourceLineNo">243</span>    writeEntry(slot, ProcedureWALEntry.Type.PROCEDURE_WAL_UPDATE, proc, null);<a name="line.243"></a>
-<span class="sourceLineNo">244</span>  }<a name="line.244"></a>
-<span class="sourceLineNo">245</span><a name="line.245"></a>
-<span class="sourceLineNo">246</span>  public static void writeDelete(ByteSlot slot, long procId)<a name="line.246"></a>
-<span class="sourceLineNo">247</span>      throws IOException {<a name="line.247"></a>
-<span class="sourceLineNo">248</span>    final ProcedureWALEntry.Builder builder = ProcedureWALEntry.newBuilder();<a name="line.248"></a>
-<span class="sourceLineNo">249</span>    builder.setType(ProcedureWALEntry.Type.PROCEDURE_WAL_DELETE);<a name="line.249"></a>
-<span class="sourceLineNo">250</span>    builder.setProcId(procId);<a name="line.250"></a>
-<span class="sourceLineNo">251</span>    builder.build().writeDelimitedTo(slot);<a name="line.251"></a>
-<span class="sourceLineNo">252</span>  }<a name="line.252"></a>
-<span class="sourceLineNo">253</span><a name="line.253"></a>
-<span class="sourceLineNo">254</span>  public static void writeDelete(ByteSlot slot, Procedure&lt;?&gt; proc, long[] subprocs)<a name="line.254"></a>
-<span class="sourceLineNo">255</span>      throws IOException {<a name="line.255"></a>
-<span class="sourceLineNo">256</span>    final ProcedureWALEntry.Builder builder = ProcedureWALEntry.newBuilder();<a name="line.256"></a>
-<span class="sourceLineNo">257</span>    builder.setType(ProcedureWALEntry.Type.PROCEDURE_WAL_DELETE);<a name="line.257"></a>
-<span class="sourceLineNo">258</span>    builder.setProcId(proc.getProcId());<a name="line.258"></a>
-<span class="sourceLineNo">259</span>    if (subprocs != null) {<a name="line.259"></a>
-<span class="sourceLineNo">260</span>      builder.addProcedure(ProcedureUtil.convertToProtoProcedure(proc));<a name="line.260"></a>
-<span class="sourceLineNo">261</span>      for (int i = 0; i &lt; subprocs.length; ++i) {<a name="line.261"></a>
-<span class="sourceLineNo">262</span>        builder.addChildId(subprocs[i]);<a name="line.262"></a>
-<span class="sourceLineNo">263</span>      }<a name="line.263"></a>
-<span class="sourceLineNo">264</span>    }<a name="line.264"></a>
-<span class="sourceLineNo">265</span>    builder.build().writeDelimitedTo(slot);<a name="line.265"></a>
-<span class="sourceLineNo">266</span>  }<a name="line.266"></a>
-<span class="sourceLineNo">267</span>}<a name="line.267"></a>
+<span class="sourceLineNo">199</span>    ProcedureWALEntry entry = readEntry(stream);<a name="line.199"></a>
+<span class="sourceLineNo">200</span>    if (entry.getType() != ProcedureWALEntry.Type.PROCEDURE_WAL_EOF) {<a name="line.200"></a>
+<span class="sourceLineNo">201</span>      throw new InvalidWALDataException("Invalid Trailer begin");<a name="line.201"></a>
+<span class="sourceLineNo">202</span>    }<a name="line.202"></a>
+<span class="sourceLineNo">203</span><a name="line.203"></a>
+<span class="sourceLineNo">204</span>    ProcedureWALTrailer trailer = ProcedureWALTrailer.newBuilder()<a name="line.204"></a>
+<span class="sourceLineNo">205</span>      .setVersion(version)<a name="line.205"></a>
+<span class="sourceLineNo">206</span>      .setTrackerPos(stream.getPos())<a name="line.206"></a>
+<span class="sourceLineNo">207</span>      .build();<a name="line.207"></a>
+<span class="sourceLineNo">208</span>    return trailer;<a name="line.208"></a>
+<span class="sourceLineNo">209</span>  }<a name="line.209"></a>
+<span class="sourceLineNo">210</span><a name="line.210"></a>
+<span class="sourceLineNo">211</span>  public static ProcedureWALEntry readEntry(InputStream stream) throws IOException {<a name="line.211"></a>
+<span class="sourceLineNo">212</span>    return ProcedureWALEntry.parseDelimitedFrom(stream);<a name="line.212"></a>
+<span class="sourceLineNo">213</span>  }<a name="line.213"></a>
+<span class="sourceLineNo">214</span><a name="line.214"></a>
+<span class="sourceLineNo">215</span>  public static void writeEntry(ByteSlot slot, ProcedureWALEntry.Type type,<a name="line.215"></a>
+<span class="sourceLineNo">216</span>      Procedure&lt;?&gt; proc, Procedure&lt;?&gt;[] subprocs) throws IOException {<a name="line.216"></a>
+<span class="sourceLineNo">217</span>    final ProcedureWALEntry.Builder builder = ProcedureWALEntry.newBuilder();<a name="line.217"></a>
+<span class="sourceLineNo">218</span>    builder.setType(type);<a name="line.218"></a>
+<span class="sourceLineNo">219</span>    builder.addProcedure(ProcedureUtil.convertToProtoProcedure(proc));<a name="line.219"></a>
+<span class="sourceLineNo">220</span>    if (subprocs != null) {<a name="line.220"></a>
+<span class="sourceLineNo">221</span>      for (int i = 0; i &lt; subprocs.length; ++i) {<a name="line.221"></a>
+<span class="sourceLineNo">222</span>        builder.addProcedure(ProcedureUtil.convertToProtoProcedure(subprocs[i]));<a name="line.222"></a>
+<span class="sourceLineNo">223</span>      }<a name="line.223"></a>
+<span class="sourceLineNo">224</span>    }<a name="line.224"></a>
+<span class="sourceLineNo">225</span>    builder.build().writeDelimitedTo(slot);<a name="line.225"></a>
+<span class="sourceLineNo">226</span>  }<a name="line.226"></a>
+<span class="sourceLineNo">227</span><a name="line.227"></a>
+<span class="sourceLineNo">228</span>  public static void writeInsert(ByteSlot slot, Procedure&lt;?&gt; proc)<a name="line.228"></a>
+<span class="sourceLineNo">229</span>      throws IOException {<a name="line.229"></a>
+<span class="sourceLineNo">230</span>    writeEntry(slot, ProcedureWALEntry.Type.PROCEDURE_WAL_INIT, proc, null);<a name="line.230"></a>
+<span class="sourceLineNo">231</span>  }<a name="line.231"></a>
+<span class="sourceLineNo">232</span><a name="line.232"></a>
+<span class="sourceLineNo">233</span>  public static void writeInsert(ByteSlot slot, Procedure&lt;?&gt; proc, Procedure&lt;?&gt;[] subprocs)<a name="line.233"></a>
+<span class="sourceLineNo">234</span>      throws IOException {<a name="line.234"></a>
+<span class="sourceLineNo">235</span>    writeEntry(slot, ProcedureWALEntry.Type.PROCEDURE_WAL_INSERT, proc, subprocs);<a name="line.235"></a>
+<span class="sourceLineNo">236</span>  }<a name="line.236"></a>
+<span class="sourceLineNo">237</span><a name="line.237"></a>
+<span class="sourceLineNo">238</span>  public static void writeUpdate(ByteSlot slot, Procedure&lt;?&gt; proc)<a name="line.238"></a>
+<span class="sourceLineNo">239</span>      throws IOException {<a name="line.239"></a>
+<span class="sourceLineNo">240</span>    writeEntry(slot, ProcedureWALEntry.Type.PROCEDURE_WAL_UPDATE, proc, null);<a name="line.240"></a>
+<span class="sourceLineNo">241</span>  }<a name="line.241"></a>
+<span class="sourceLineNo">242</span><a name="line.242"></a>
+<span class="sourceLineNo">243</span>  public static void writeDelete(ByteSlot slot, long procId)<a name="line.243"></a>
+<span class="sourceLineNo">244</span>      throws IOException {<a name="line.244"></a>
+<span class="sourceLineNo">245</span>    final ProcedureWALEntry.Builder builder = ProcedureWALEntry.newBuilder();<a name="line.245"></a>
+<span class="sourceLineNo">246</span>    builder.setType(ProcedureWALEntry.Type.PROCEDURE_WAL_DELETE);<a name="line.246"></a>
+<span class="sourceLineNo">247</span>    builder.setProcId(procId);<a name="line.247"></a>
+<span class="sourceLineNo">248</span>    builder.build().writeDelimitedTo(slot);<a name="line.248"></a>
+<span class="sourceLineNo">249</span>  }<a name="line.249"></a>
+<span class="sourceLineNo">250</span><a name="line.250"></a>
+<span class="sourceLineNo">251</span>  public static void writeDelete(ByteSlot slot, Procedure&lt;?&gt; proc, long[] subprocs)<a name="line.251"></a>
+<span class="sourceLineNo">252</span>      throws IOException {<a name="line.252"></a>
+<span class="sourceLineNo">253</span>    final ProcedureWALEntry.Builder builder = ProcedureWALEntry.newBuilder();<a name="line.253"></a>
+<span class="sourceLineNo">254</span>    builder.setType(ProcedureWALEntry.Type.PROCEDURE_WAL_DELETE);<a name="line.254"></a>
+<span class="sourceLineNo">255</span>    builder.setProcId(proc.getProcId());<a name="line.255"></a>
+<span class="sourceLineNo">256</span>    if (subprocs != null) {<a name="line.256"></a>
+<span class="sourceLineNo">257</span>      builder.addProcedure(ProcedureUtil.convertToProtoProcedure(proc));<a name="line.257"></a>
+<span class="sourceLineNo">258</span>      for (int i = 0; i &lt; subprocs.length; ++i) {<a name="line.258"></a>
+<span class="sourceLineNo">259</span>        builder.addChildId(subprocs[i]);<a name="line.259"></a>
+<span class="sourceLineNo">260</span>      }<a name="line.260"></a>
+<span class="sourceLineNo">261</span>    }<a name="line.261"></a>
+<span class="sourceLineNo">262</span>    builder.build().writeDelimitedTo(slot);<a name="line.262"></a>
+<span class="sourceLineNo">263</span>  }<a name="line.263"></a>
+<span class="sourceLineNo">264</span>}<a name="line.264"></a>
 
 
 
index ab175b6..72a3459 100644 (file)
 <span class="sourceLineNo">448</span>    lock.lock();<a name="line.448"></a>
 <span class="sourceLineNo">449</span>    try {<a name="line.449"></a>
 <span class="sourceLineNo">450</span>      if (logs.isEmpty()) {<a name="line.450"></a>
-<span class="sourceLineNo">451</span>        throw new RuntimeException("recoverLease() must be called before loading data");<a name="line.451"></a>
+<span class="sourceLineNo">451</span>        throw new IllegalStateException("recoverLease() must be called before loading data");<a name="line.451"></a>
 <span class="sourceLineNo">452</span>      }<a name="line.452"></a>
 <span class="sourceLineNo">453</span><a name="line.453"></a>
 <span class="sourceLineNo">454</span>      // Nothing to do, If we have only the current log.<a name="line.454"></a>
 <span class="sourceLineNo">455</span>      if (logs.size() == 1) {<a name="line.455"></a>
 <span class="sourceLineNo">456</span>        LOG.debug("No state logs to replay.");<a name="line.456"></a>
 <span class="sourceLineNo">457</span>        loader.setMaxProcId(0);<a name="line.457"></a>
-<span class="sourceLineNo">458</span>        return;<a name="line.458"></a>
-<span class="sourceLineNo">459</span>      }<a name="line.459"></a>
-<span class="sourceLineNo">460</span><a name="line.460"></a>
-<span class="sourceLineNo">461</span>      // Load the old logs<a name="line.461"></a>
-<span class="sourceLineNo">462</span>      Iterator&lt;ProcedureWALFile&gt; it = logs.descendingIterator();<a name="line.462"></a>
-<span class="sourceLineNo">463</span>      it.next(); // Skip the current log<a name="line.463"></a>
-<span class="sourceLineNo">464</span><a name="line.464"></a>
-<span class="sourceLineNo">465</span>      ProcedureWALFormat.load(it, storeTracker, new ProcedureWALFormat.Loader() {<a name="line.465"></a>
-<span class="sourceLineNo">466</span><a name="line.466"></a>
-<span class="sourceLineNo">467</span>        @Override<a name="line.467"></a>
-<span class="sourceLineNo">468</span>        public void setMaxProcId(long maxProcId) {<a name="line.468"></a>
-<span class="sourceLineNo">469</span>          loader.setMaxProcId(maxProcId);<a name="line.469"></a>
-<span class="sourceLineNo">470</span>        }<a name="line.470"></a>
-<span class="sourceLineNo">471</span><a name="line.471"></a>
-<span class="sourceLineNo">472</span>        @Override<a name="line.472"></a>
-<span class="sourceLineNo">473</span>        public void load(ProcedureIterator procIter) throws IOException {<a name="line.473"></a>
-<span class="sourceLineNo">474</span>          loader.load(procIter);<a name="line.474"></a>
-<span class="sourceLineNo">475</span>        }<a name="line.475"></a>
-<span class="sourceLineNo">476</span><a name="line.476"></a>
-<span class="sourceLineNo">477</span>        @Override<a name="line.477"></a>
-<span class="sourceLineNo">478</span>        public void handleCorrupted(ProcedureIterator procIter) throws IOException {<a name="line.478"></a>
-<span class="sourceLineNo">479</span>          loader.handleCorrupted(procIter);<a name="line.479"></a>
-<span class="sourceLineNo">480</span>        }<a name="line.480"></a>
-<span class="sourceLineNo">481</span><a name="line.481"></a>
-<span class="sourceLineNo">482</span>        @Override<a name="line.482"></a>
-<span class="sourceLineNo">483</span>        public void markCorruptedWAL(ProcedureWALFile log, IOException e) {<a name="line.483"></a>
-<span class="sourceLineNo">484</span>          if (corruptedLogs == null) {<a name="line.484"></a>
-<span class="sourceLineNo">485</span>            corruptedLogs = new HashSet&lt;&gt;();<a name="line.485"></a>
-<span class="sourceLineNo">486</span>          }<a name="line.486"></a>
-<span class="sourceLineNo">487</span>          corruptedLogs.add(log);<a name="line.487"></a>
-<span class="sourceLineNo">488</span>          // TODO: sideline corrupted log<a name="line.488"></a>
-<span class="sourceLineNo">489</span>        }<a name="line.489"></a>
-<span class="sourceLineNo">490</span>      });<a name="line.490"></a>
-<span class="sourceLineNo">491</span>    } finally {<a name="line.491"></a>
-<span class="sourceLineNo">492</span>      try {<a name="line.492"></a>
-<span class="sourceLineNo">493</span>        // try to cleanup inactive wals and complete the operation<a name="line.493"></a>
-<span class="sourceLineNo">494</span>        buildHoldingCleanupTracker();<a name="line.494"></a>
-<span class="sourceLineNo">495</span>        tryCleanupLogsOnLoad();<a name="line.495"></a>
-<span class="sourceLineNo">496</span>        loading.set(false);<a name="line.496"></a>
-<span class="sourceLineNo">497</span>      } finally {<a name="line.497"></a>
-<span class="sourceLineNo">498</span>        lock.unlock();<a name="line.498"></a>
-<span class="sourceLineNo">499</span>      }<a name="line.499"></a>
-<span class="sourceLineNo">500</span>    }<a name="line.500"></a>
-<span class="sourceLineNo">501</span>  }<a name="line.501"></a>
-<span class="sourceLineNo">502</span><a name="line.502"></a>
-<span class="sourceLineNo">503</span>  private void tryCleanupLogsOnLoad() {<a name="line.503"></a>
-<span class="sourceLineNo">504</span>    // nothing to cleanup.<a name="line.504"></a>
-<span class="sourceLineNo">505</span>    if (logs.size() &lt;= 1) {<a name="line.505"></a>
-<span class="sourceLineNo">506</span>      return;<a name="line.506"></a>
-<span class="sourceLineNo">507</span>    }<a name="line.507"></a>
+<span class="sourceLineNo">458</span>        loading.set(false);<a name="line.458"></a>
+<span class="sourceLineNo">459</span>        return;<a name="line.459"></a>
+<span class="sourceLineNo">460</span>      }<a name="line.460"></a>
+<span class="sourceLineNo">461</span><a name="line.461"></a>
+<span class="sourceLineNo">462</span>      // Load the old logs<a name="line.462"></a>
+<span class="sourceLineNo">463</span>      Iterator&lt;ProcedureWALFile&gt; it = logs.descendingIterator();<a name="line.463"></a>
+<span class="sourceLineNo">464</span>      it.next(); // Skip the current log<a name="line.464"></a>
+<span class="sourceLineNo">465</span><a name="line.465"></a>
+<span class="sourceLineNo">466</span>      ProcedureWALFormat.load(it, storeTracker, new ProcedureWALFormat.Loader() {<a name="line.466"></a>
+<span class="sourceLineNo">467</span><a name="line.467"></a>
+<span class="sourceLineNo">468</span>        @Override<a name="line.468"></a>
+<span class="sourceLineNo">469</span>        public void setMaxProcId(long maxProcId) {<a name="line.469"></a>
+<span class="sourceLineNo">470</span>          loader.setMaxProcId(maxProcId);<a name="line.470"></a>
+<span class="sourceLineNo">471</span>        }<a name="line.471"></a>
+<span class="sourceLineNo">472</span><a name="line.472"></a>
+<span class="sourceLineNo">473</span>        @Override<a name="line.473"></a>
+<span class="sourceLineNo">474</span>        public void load(ProcedureIterator procIter) throws IOException {<a name="line.474"></a>
+<span class="sourceLineNo">475</span>          loader.load(procIter);<a name="line.475"></a>
+<span class="sourceLineNo">476</span>        }<a name="line.476"></a>
+<span class="sourceLineNo">477</span><a name="line.477"></a>
+<span class="sourceLineNo">478</span>        @Override<a name="line.478"></a>
+<span class="sourceLineNo">479</span>        public void handleCorrupted(ProcedureIterator procIter) throws IOException {<a name="line.479"></a>
+<span class="sourceLineNo">480</span>          loader.handleCorrupted(procIter);<a name="line.480"></a>
+<span class="sourceLineNo">481</span>        }<a name="line.481"></a>
+<span class="sourceLineNo">482</span><a name="line.482"></a>
+<span class="sourceLineNo">483</span>        @Override<a name="line.483"></a>
+<span class="sourceLineNo">484</span>        public void markCorruptedWAL(ProcedureWALFile log, IOException e) {<a name="line.484"></a>
+<span class="sourceLineNo">485</span>          if (corruptedLogs == null) {<a name="line.485"></a>
+<span class="sourceLineNo">486</span>            corruptedLogs = new HashSet&lt;&gt;();<a name="line.486"></a>
+<span class="sourceLineNo">487</span>          }<a name="line.487"></a>
+<span class="sourceLineNo">488</span>          corruptedLogs.add(log);<a name="line.488"></a>
+<span class="sourceLineNo">489</span>          // TODO: sideline corrupted log<a name="line.489"></a>
+<span class="sourceLineNo">490</span>        }<a name="line.490"></a>
+<span class="sourceLineNo">491</span>      });<a name="line.491"></a>
+<span class="sourceLineNo">492</span>      // if we fail when loading, we should prevent persisting the storeTracker later in the stop<a name="line.492"></a>
+<span class="sourceLineNo">493</span>      // method. As it may happen that, we have finished constructing the modified and deleted bits,<a name="line.493"></a>
+<span class="sourceLineNo">494</span>      // but before we call resetModified, we fail, then if we persist the storeTracker then when<a name="line.494"></a>
+<span class="sourceLineNo">495</span>      // restarting, we will consider that all procedures have been included in this file and delete<a name="line.495"></a>
+<span class="sourceLineNo">496</span>      // all the previous files. Obviously this not correct. So here we will only set loading to<a name="line.496"></a>
+<span class="sourceLineNo">497</span>      // false when we successfully loaded all the procedures, and when closing we will skip<a name="line.497"></a>
+<span class="sourceLineNo">498</span>      // persisting the store tracker. And also, this will prevent the sync thread to do<a name="line.498"></a>
+<span class="sourceLineNo">499</span>      // periodicRoll, where we may also clean old logs.<a name="line.499"></a>
+<span class="sourceLineNo">500</span>      loading.set(false);<a name="line.500"></a>
+<span class="sourceLineNo">501</span>      // try to cleanup inactive wals and complete the operation<a name="line.501"></a>
+<span class="sourceLineNo">502</span>      buildHoldingCleanupTracker();<a name="line.502"></a>
+<span class="sourceLineNo">503</span>      tryCleanupLogsOnLoad();<a name="line.503"></a>
+<span class="sourceLineNo">504</span>    } finally {<a name="line.504"></a>
+<span class="sourceLineNo">505</span>      lock.unlock();<a name="line.505"></a>
+<span class="sourceLineNo">506</span>    }<a name="line.506"></a>
+<span class="sourceLineNo">507</span>  }<a name="line.507"></a>
 <span class="sourceLineNo">508</span><a name="line.508"></a>
-<span class="sourceLineNo">509</span>    // the config says to not cleanup wals on load.<a name="line.509"></a>
-<span class="sourceLineNo">510</span>    if (!conf.getBoolean(EXEC_WAL_CLEANUP_ON_LOAD_CONF_KEY,<a name="line.510"></a>
-<span class="sourceLineNo">511</span>      DEFAULT_EXEC_WAL_CLEANUP_ON_LOAD_CONF_KEY)) {<a name="line.511"></a>
-<span class="sourceLineNo">512</span>      LOG.debug("WALs cleanup on load is not enabled: " + getActiveLogs());<a name="line.512"></a>
-<span class="sourceLineNo">513</span>      return;<a name="line.513"></a>
-<span class="sourceLineNo">514</span>    }<a name="line.514"></a>
-<span class="sourceLineNo">515</span><a name="line.515"></a>
-<span class="sourceLineNo">516</span>    try {<a name="line.516"></a>
-<span class="sourceLineNo">517</span>      periodicRoll();<a name="line.517"></a>
-<span class="sourceLineNo">518</span>    } catch (IOException e) {<a name="line.518"></a>
-<span class="sourceLineNo">519</span>      LOG.warn("Unable to cleanup logs on load: " + e.getMessage(), e);<a name="line.519"></a>
+<span class="sourceLineNo">509</span>  private void tryCleanupLogsOnLoad() {<a name="line.509"></a>
+<span class="sourceLineNo">510</span>    // nothing to cleanup.<a name="line.510"></a>
+<span class="sourceLineNo">511</span>    if (logs.size() &lt;= 1) {<a name="line.511"></a>
+<span class="sourceLineNo">512</span>      return;<a name="line.512"></a>
+<span class="sourceLineNo">513</span>    }<a name="line.513"></a>
+<span class="sourceLineNo">514</span><a name="line.514"></a>
+<span class="sourceLineNo">515</span>    // the config says to not cleanup wals on load.<a name="line.515"></a>
+<span class="sourceLineNo">516</span>    if (!conf.getBoolean(EXEC_WAL_CLEANUP_ON_LOAD_CONF_KEY,<a name="line.516"></a>
+<span class="sourceLineNo">517</span>      DEFAULT_EXEC_WAL_CLEANUP_ON_LOAD_CONF_KEY)) {<a name="line.517"></a>
+<span class="sourceLineNo">518</span>      LOG.debug("WALs cleanup on load is not enabled: " + getActiveLogs());<a name="line.518"></a>
+<span class="sourceLineNo">519</span>      return;<a name="line.519"></a>
 <span class="sourceLineNo">520</span>    }<a name="line.520"></a>
-<span class="sourceLineNo">521</span>  }<a name="line.521"></a>
-<span class="sourceLineNo">522</span><a name="line.522"></a>
-<span class="sourceLineNo">523</span>  @Override<a name="line.523"></a>
-<span class="sourceLineNo">524</span>  public void insert(Procedure&lt;?&gt; proc, Procedure&lt;?&gt;[] subprocs) {<a name="line.524"></a>
-<span class="sourceLineNo">525</span>    if (LOG.isTraceEnabled()) {<a name="line.525"></a>
-<span class="sourceLineNo">526</span>      LOG.trace("Insert " + proc + ", subproc=" + Arrays.toString(subprocs));<a name="line.526"></a>
-<span class="sourceLineNo">527</span>    }<a name="line.527"></a>
+<span class="sourceLineNo">521</span><a name="line.521"></a>
+<span class="sourceLineNo">522</span>    try {<a name="line.522"></a>
+<span class="sourceLineNo">523</span>      periodicRoll();<a name="line.523"></a>
+<span class="sourceLineNo">524</span>    } catch (IOException e) {<a name="line.524"></a>
+<span class="sourceLineNo">525</span>      LOG.warn("Unable to cleanup logs on load: " + e.getMessage(), e);<a name="line.525"></a>
+<span class="sourceLineNo">526</span>    }<a name="line.526"></a>
+<span class="sourceLineNo">527</span>  }<a name="line.527"></a>
 <span class="sourceLineNo">528</span><a name="line.528"></a>
-<span class="sourceLineNo">529</span>    ByteSlot slot = acquireSlot();<a name="line.529"></a>
-<span class="sourceLineNo">530</span>    try {<a name="line.530"></a>
-<span class="sourceLineNo">531</span>      // Serialize the insert<a name="line.531"></a>
-<span class="sourceLineNo">532</span>      long[] subProcIds = null;<a name="line.532"></a>
-<span class="sourceLineNo">533</span>      if (subprocs != null) {<a name="line.533"></a>
-<span class="sourceLineNo">534</span>        ProcedureWALFormat.writeInsert(slot, proc, subprocs);<a name="line.534"></a>
-<span class="sourceLineNo">535</span>        subProcIds = new long[subprocs.length];<a name="line.535"></a>
-<span class="sourceLineNo">536</span>        for (int i = 0; i &lt; subprocs.length; ++i) {<a name="line.536"></a>
-<span class="sourceLineNo">537</span>          subProcIds[i] = subprocs[i].getProcId();<a name="line.537"></a>
-<span class="sourceLineNo">538</span>        }<a name="line.538"></a>
-<span class="sourceLineNo">539</span>      } else {<a name="line.539"></a>
-<span class="sourceLineNo">540</span>        assert !proc.hasParent();<a name="line.540"></a>
-<span class="sourceLineNo">541</span>        ProcedureWALFormat.writeInsert(slot, proc);<a name="line.541"></a>
-<span class="sourceLineNo">542</span>      }<a name="line.542"></a>
-<span class="sourceLineNo">543</span><a name="line.543"></a>
-<span class="sourceLineNo">544</span>      // Push the transaction data and wait until it is persisted<a name="line.544"></a>
-<span class="sourceLineNo">545</span>      pushData(PushType.INSERT, slot, proc.getProcId(), subProcIds);<a name="line.545"></a>
-<span class="sourceLineNo">546</span>    } catch (IOException e) {<a name="line.546"></a>
-<span class="sourceLineNo">547</span>      // We are not able to serialize the procedure.<a name="line.547"></a>
-<span class="sourceLineNo">548</span>      // this is a code error, and we are not able to go on.<a name="line.548"></a>
-<span class="sourceLineNo">549</span>      LOG.error(HBaseMarkers.FATAL, "Unable to serialize one of the procedure: proc=" +<a name="line.549"></a>
-<span class="sourceLineNo">550</span>          proc + ", subprocs=" + Arrays.toString(subprocs), e);<a name="line.550"></a>
-<span class="sourceLineNo">551</span>      throw new RuntimeException(e);<a name="line.551"></a>
-<span class="sourceLineNo">552</span>    } finally {<a name="line.552"></a>
-<span class="sourceLineNo">553</span>      releaseSlot(slot);<a name="line.553"></a>
-<span class="sourceLineNo">554</span>    }<a name="line.554"></a>
-<span class="sourceLineNo">555</span>  }<a name="line.555"></a>
-<span class="sourceLineNo">556</span><a name="line.556"></a>
-<span class="sourceLineNo">557</span>  @Override<a name="line.557"></a>
-<span class="sourceLineNo">558</span>  public void insert(Procedure&lt;?&gt;[] procs) {<a name="line.558"></a>
-<span class="sourceLineNo">559</span>    if (LOG.isTraceEnabled()) {<a name="line.559"></a>
-<span class="sourceLineNo">560</span>      LOG.trace("Insert " + Arrays.toString(procs));<a name="line.560"></a>
-<span class="sourceLineNo">561</span>    }<a name="line.561"></a>
+<span class="sourceLineNo">529</span>  @Override<a name="line.529"></a>
+<span class="sourceLineNo">530</span>  public void insert(Procedure&lt;?&gt; proc, Procedure&lt;?&gt;[] subprocs) {<a name="line.530"></a>
+<span class="sourceLineNo">531</span>    if (LOG.isTraceEnabled()) {<a name="line.531"></a>
+<span class="sourceLineNo">532</span>      LOG.trace("Insert " + proc + ", subproc=" + Arrays.toString(subprocs));<a name="line.532"></a>
+<span class="sourceLineNo">533</span>    }<a name="line.533"></a>
+<span class="sourceLineNo">534</span><a name="line.534"></a>
+<span class="sourceLineNo">535</span>    ByteSlot slot = acquireSlot();<a name="line.535"></a>
+<span class="sourceLineNo">536</span>    try {<a name="line.536"></a>
+<span class="sourceLineNo">537</span>      // Serialize the insert<a name="line.537"></a>
+<span class="sourceLineNo">538</span>      long[] subProcIds = null;<a name="line.538"></a>
+<span class="sourceLineNo">539</span>      if (subprocs != null) {<a name="line.539"></a>
+<span class="sourceLineNo">540</span>        ProcedureWALFormat.writeInsert(slot, proc, subprocs);<a name="line.540"></a>
+<span class="sourceLineNo">541</span>        subProcIds = new long[subprocs.length];<a name="line.541"></a>
+<span class="sourceLineNo">542</span>        for (int i = 0; i &lt; subprocs.length; ++i) {<a name="line.542"></a>
+<span class="sourceLineNo">543</span>          subProcIds[i] = subprocs[i].getProcId();<a name="line.543"></a>
+<span class="sourceLineNo">544</span>        }<a name="line.544"></a>
+<span class="sourceLineNo">545</span>      } else {<a name="line.545"></a>
+<span class="sourceLineNo">546</span>        assert !proc.hasParent();<a name="line.546"></a>
+<span class="sourceLineNo">547</span>        ProcedureWALFormat.writeInsert(slot, proc);<a name="line.547"></a>
+<span class="sourceLineNo">548</span>      }<a name="line.548"></a>
+<span class="sourceLineNo">549</span><a name="line.549"></a>
+<span class="sourceLineNo">550</span>      // Push the transaction data and wait until it is persisted<a name="line.550"></a>
+<span class="sourceLineNo">551</span>      pushData(PushType.INSERT, slot, proc.getProcId(), subProcIds);<a name="line.551"></a>
+<span class="sourceLineNo">552</span>    } catch (IOException e) {<a name="line.552"></a>
+<span class="sourceLineNo">553</span>      // We are not able to serialize the procedure.<a name="line.553"></a>
+<span class="sourceLineNo">554</span>      // this is a code error, and we are not able to go on.<a name="line.554"></a>
+<span class="sourceLineNo">555</span>      LOG.error(HBaseMarkers.FATAL, "Unable to serialize one of the procedure: proc=" +<a name="line.555"></a>
+<span class="sourceLineNo">556</span>          proc + ", subprocs=" + Arrays.toString(subprocs), e);<a name="line.556"></a>
+<span class="sourceLineNo">557</span>      throw new RuntimeException(e);<a name="line.557"></a>
+<span class="sourceLineNo">558</span>    } finally {<a name="line.558"></a>
+<span class="sourceLineNo">559</span>      releaseSlot(slot);<a name="line.559"></a>
+<span class="sourceLineNo">560</span>    }<a name="line.560"></a>
+<span class="sourceLineNo">561</span>  }<a name="line.561"></a>
 <span class="sourceLineNo">562</span><a name="line.562"></a>
-<span class="sourceLineNo">563</span>    ByteSlot slot = acquireSlot();<a name="line.563"></a>
-<span class="sourceLineNo">564</span>    try {<a name="line.564"></a>
-<span class="sourceLineNo">565</span>      // Serialize the insert<a name="line.565"></a>
-<span class="sourceLineNo">566</span>      long[] procIds = new long[procs.length];<a name="line.566"></a>
-<span class="sourceLineNo">567</span>      for (int i = 0; i &lt; procs.length; ++i) {<a name="line.567"></a>
-<span class="sourceLineNo">568</span>        assert !procs[i].hasParent();<a name="line.568"></a>
-<span class="sourceLineNo">569</span>        procIds[i] = procs[i].getProcId();<a name="line.569"></a>
-<span class="sourceLineNo">570</span>        ProcedureWALFormat.writeInsert(slot, procs[i]);<a name="line.570"></a>
-<span class="sourceLineNo">571</span>      }<a name="line.571"></a>
-<span class="sourceLineNo">572</span><a name="line.572"></a>
-<span class="sourceLineNo">573</span>      // Push the transaction data and wait until it is persisted<a name="line.573"></a>
-<span class="sourceLineNo">574</span>      pushData(PushType.INSERT, slot, Procedure.NO_PROC_ID, procIds);<a name="line.574"></a>
-<span class="sourceLineNo">575</span>    } catch (IOException e) {<a name="line.575"></a>
-<span class="sourceLineNo">576</span>      // We are not able to serialize the procedure.<a name="line.576"></a>
-<span class="sourceLineNo">577</span>      // this is a code error, and we are not able to go on.<a name="line.577"></a>
-<span class="sourceLineNo">578</span>      LOG.error(HBaseMarkers.FATAL, "Unable to serialize one of the procedure: " +<a name="line.578"></a>
-<span class="sourceLineNo">579</span>          Arrays.toString(procs), e);<a name="line.579"></a>
-<span class="sourceLineNo">580</span>      throw new RuntimeException(e);<a name="line.580"></a>
-<span class="sourceLineNo">581</span>    } finally {<a name="line.581"></a>
-<span class="sourceLineNo">582</span>      releaseSlot(slot);<a name="line.582"></a>
-<span class="sourceLineNo">583</span>    }<a name="line.583"></a>
-<span class="sourceLineNo">584</span>  }<a name="line.584"></a>
-<span class="sourceLineNo">585</span><a name="line.585"></a>
-<span class="sourceLineNo">586</span>  @Override<a name="line.586"></a>
-<span class="sourceLineNo">587</span>  public void update(Procedure&lt;?&gt; proc) {<a name="line.587"></a>
-<span class="sourceLineNo">588</span>    if (LOG.isTraceEnabled()) {<a name="line.588"></a>
-<span class="sourceLineNo">589</span>      LOG.trace("Update " + proc);<a name="line.589"></a>
-<span class="sourceLineNo">590</span>    }<a name="line.590"></a>
+<span class="sourceLineNo">563</span>  @Override<a name="line.563"></a>
+<span class="sourceLineNo">564</span>  public void insert(Procedure&lt;?&gt;[] procs) {<a name="line.564"></a>
+<span class="sourceLineNo">565</span>    if (LOG.isTraceEnabled()) {<a name="line.565"></a>
+<span class="sourceLineNo">566</span>      LOG.trace("Insert " + Arrays.toString(procs));<a name="line.566"></a>
+<span class="sourceLineNo">567</span>    }<a name="line.567"></a>
+<span class="sourceLineNo">568</span><a name="line.568"></a>
+<span class="sourceLineNo">569</span>    ByteSlot slot = acquireSlot();<a name="line.569"></a>
+<span class="sourceLineNo">570</span>    try {<a name="line.570"></a>
+<span class="sourceLineNo">571</span>      // Serialize the insert<a name="line.571"></a>
+<span class="sourceLineNo">572</span>      long[] procIds = new long[procs.length];<a name="line.572"></a>
+<span class="sourceLineNo">573</span>      for (int i = 0; i &lt; procs.length; ++i) {<a name="line.573"></a>
+<span class="sourceLineNo">574</span>        assert !procs[i].hasParent();<a name="line.574"></a>
+<span class="sourceLineNo">575</span>        procIds[i] = procs[i].getProcId();<a name="line.575"></a>
+<span class="sourceLineNo">576</span>        ProcedureWALFormat.writeInsert(slot, procs[i]);<a name="line.576"></a>
+<span class="sourceLineNo">577</span>      }<a name="line.577"></a>
+<span class="sourceLineNo">578</span><a name="line.578"></a>
+<span class="sourceLineNo">579</span>      // Push the transaction data and wait until it is persisted<a name="line.579"></a>
+<span class="sourceLineNo">580</span>      pushData(PushType.INSERT, slot, Procedure.NO_PROC_ID, procIds);<a name="line.580"></a>
+<span class="sourceLineNo">581</span>    } catch (IOException e) {<a name="line.581"></a>
+<span class="sourceLineNo">582</span>      // We are not able to serialize the procedure.<a name="line.582"></a>
+<span class="sourceLineNo">583</span>      // this is a code error, and we are not able to go on.<a name="line.583"></a>
+<span class="sourceLineNo">584</span>      LOG.error(HBaseMarkers.FATAL, "Unable to serialize one of the procedure: " +<a name="line.584"></a>
+<span class="sourceLineNo">585</span>          Arrays.toString(procs), e);<a name="line.585"></a>
+<span class="sourceLineNo">586</span>      throw new RuntimeException(e);<a name="line.586"></a>
+<span class="sourceLineNo">587</span>    } finally {<a name="line.587"></a>
+<span class="sourceLineNo">588</span>      releaseSlot(slot);<a name="line.588"></a>
+<span class="sourceLineNo">589</span>    }<a name="line.589"></a>
+<span class="sourceLineNo">590</span>  }<a name="line.590"></a>
 <span class="sourceLineNo">591</span><a name="line.591"></a>
-<span class="sourceLineNo">592</span>    ByteSlot slot = acquireSlot();<a name="line.592"></a>
-<span class="sourceLineNo">593</span>    try {<a name="line.593"></a>
-<span class="sourceLineNo">594</span>      // Serialize the update<a name="line.594"></a>
-<span class="sourceLineNo">595</span>      ProcedureWALFormat.writeUpdate(slot, proc);<a name="line.595"></a>
-<span class="sourceLineNo">596</span><a name="line.596"></a>
-<span class="sourceLineNo">597</span>      // Push the transaction data and wait until it is persisted<a name="line.597"></a>
-<span class="sourceLineNo">598</span>      pushData(PushType.UPDATE, slot, proc.getProcId(), null);<a name="line.598"></a>
-<span class="sourceLineNo">599</span>    } catch (IOException e) {<a name="line.599"></a>
-<span class="sourceLineNo">600</span>      // We are not able to serialize the procedure.<a name="line.600"></a>
-<span class="sourceLineNo">601</span>      // this is a code error, and we are not able to go on.<a name="line.601"></a>
-<span class="sourceLineNo">602</span>      LOG.error(HBaseMarkers.FATAL, "Unable to serialize the procedure: " + proc, e);<a name="line.602"></a>
-<span class="sourceLineNo">603</span>      throw new RuntimeException(e);<a name="line.603"></a>
-<span class="sourceLineNo">604</span>    } finally {<a name="line.604"></a>
-<span class="sourceLineNo">605</span>      releaseSlot(slot);<a name="line.605"></a>
-<span class="sourceLineNo">606</span>    }<a name="line.606"></a>
-<span class="sourceLineNo">607</span>  }<a name="line.607"></a>
-<span class="sourceLineNo">608</span><a name="line.608"></a>
-<span class="sourceLineNo">609</span>  @Override<a name="line.609"></a>
-<span class="sourceLineNo">610</span>  public void delete(long procId) {<a name="line.610"></a>
-<span class="sourceLineNo">611</span>    LOG.trace("Delete {}", procId);<a name="line.611"></a>
-<span class="sourceLineNo">612</span>    ByteSlot slot = acquireSlot();<a name="line.612"></a>
-<span class="sourceLineNo">613</span>    try {<a name="line.613"></a>
-<span class="sourceLineNo">614</span>      // Serialize the delete<a name="line.614"></a>
-<span class="sourceLineNo">615</span>      ProcedureWALFormat.writeDelete(slot, procId);<a name="line.615"></a>
-<span class="sourceLineNo">616</span><a name="line.616"></a>
-<span class="sourceLineNo">617</span>      // Push the transaction data and wait until it is persisted<a name="line.617"></a>
-<span class="sourceLineNo">618</span>      pushData(PushType.DELETE, slot, procId, null);<a name="line.618"></a>
-<span class="sourceLineNo">619</span>    } catch (IOException e) {<a name="line.619"></a>
-<span class="sourceLineNo">620</span>      // We are not able to serialize the procedure.<a name="line.620"></a>
-<span class="sourceLineNo">621</span>      // this is a code error, and we are not able to go on.<a name="line.621"></a>
-<span class="sourceLineNo">622</span>      LOG.error(HBaseMarkers.FATAL, "Unable to serialize the procedure: " + procId, e);<a name="line.622"></a>
-<span class="sourceLineNo">623</span>      throw new RuntimeException(e);<a name="line.623"></a>
-<span class="sourceLineNo">624</span>    } finally {<a name="line.624"></a>
-<span class="sourceLineNo">625</span>      releaseSlot(slot);<a name="line.625"></a>
-<span class="sourceLineNo">626</span>    }<a name="line.626"></a>
-<span class="sourceLineNo">627</span>  }<a name="line.627"></a>
-<span class="sourceLineNo">628</span><a name="line.628"></a>
-<span class="sourceLineNo">629</span>  @Override<a name="line.629"></a>
-<span class="sourceLineNo">630</span>  public void delete(Procedure&lt;?&gt; proc, long[] subProcIds) {<a name="line.630"></a>
-<span class="sourceLineNo">631</span>    assert proc != null : "expected a non-null procedure";<a name="line.631"></a>
-<span class="sourceLineNo">632</span>    assert subProcIds != null &amp;&amp; subProcIds.length &gt; 0 : "expected subProcIds";<a name="line.632"></a>
-<span class="sourceLineNo">633</span>    if (LOG.isTraceEnabled()) {<a name="line.633"></a>
-<span class="sourceLineNo">634</span>      LOG.trace("Update " + proc + " and Delete " + Arrays.toString(subProcIds));<a name="line.634"></a>
-<span class="sourceLineNo">635</span>    }<a name="line.635"></a>
-<span class="sourceLineNo">636</span><a name="line.636"></a>
-<span class="sourceLineNo">637</span>    ByteSlot slot = acquireSlot();<a name="line.637"></a>
-<span class="sourceLineNo">638</span>    try {<a name="line.638"></a>
-<span class="sourceLineNo">639</span>      // Serialize the delete<a name="line.639"></a>
-<span class="sourceLineNo">640</span>      ProcedureWALFormat.writeDelete(slot, proc, subProcIds);<a name="line.640"></a>
-<span class="sourceLineNo">641</span><a name="line.641"></a>
-<span class="sourceLineNo">642</span>      // Push the transaction data and wait until it is persisted<a name="line.642"></a>
-<span class="sourceLineNo">643</span>      pushData(PushType.DELETE, slot, proc.getProcId(), subProcIds);<a name="line.643"></a>
-<span class="sourceLineNo">644</span>    } catch (IOException e) {<a name="line.644"></a>
-<span class="sourceLineNo">645</span>      // We are not able to serialize the procedure.<a name="line.645"></a>
-<span class="sourceLineNo">646</span>      // this is a code error, and we are not able to go on.<a name="line.646"></a>
-<span class="sourceLineNo">647</span>      LOG.error(HBaseMarkers.FATAL, "Unable to serialize the procedure: " + proc, e);<a name="line.647"></a>
-<span class="sourceLineNo">648</span>      throw new RuntimeException(e);<a name="line.648"></a>
-<span class="sourceLineNo">649</span>    } finally {<a name="line.649"></a>
-<span class="sourceLineNo">650</span>      releaseSlot(slot);<a name="line.650"></a>
-<span class="sourceLineNo">651</span>    }<a name="line.651"></a>
-<span class="sourceLineNo">652</span>  }<a name="line.652"></a>
-<span class="sourceLineNo">653</span><a name="line.653"></a>
-<span class="sourceLineNo">654</span>  @Override<a name="line.654"></a>
-<span class="sourceLineNo">655</span>  public void delete(final long[] procIds, final int offset, final int count) {<a name="line.655"></a>
-<span class="sourceLineNo">656</span>    if (count == 0) return;<a name="line.656"></a>
-<span class="sourceLineNo">657</span>    if (offset == 0 &amp;&amp; count == procIds.length) {<a name="line.657"></a>
-<span class="sourceLineNo">658</span>      delete(procIds);<a name="line.658"></a>
-<span class="sourceLineNo">659</span>    } else if (count == 1) {<a name="line.659"></a>
-<span class="sourceLineNo">660</span>      delete(procIds[offset]);<a name="line.660"></a>
-<span class="sourceLineNo">661</span>    } else {<a name="line.661"></a>
-<span class="sourceLineNo">662</span>      delete(Arrays.copyOfRange(procIds, offset, offset + count));<a name="line.662"></a>
-<span class="sourceLineNo">663</span>    }<a name="line.663"></a>
-<span class="sourceLineNo">664</span>  }<a name="line.664"></a>
-<span class="sourceLineNo">665</span><a name="line.665"></a>
-<span class="sourceLineNo">666</span>  private void delete(long[] procIds) {<a name="line.666"></a>
-<span class="sourceLineNo">667</span>    if (LOG.isTraceEnabled()) {<a name="line.667"></a>
-<span class="sourceLineNo">668</span>      LOG.trace("Delete " + Arrays.toString(procIds));<a name="line.668"></a>
+<span class="sourceLineNo">592</span>  @Override<a name="line.592"></a>
+<span class="sourceLineNo">593</span>  public void update(Procedure&lt;?&gt; proc) {<a name="line.593"></a>
+<span class="sourceLineNo">594</span>    if (LOG.isTraceEnabled()) {<a name="line.594"></a>
+<span class="sourceLineNo">595</span>      LOG.trace("Update " + proc);<a name="line.595"></a>
+<span class="sourceLineNo">596</span>    }<a name="line.596"></a>
+<span class="sourceLineNo">597</span><a name="line.597"></a>
+<span class="sourceLineNo">598</span>    ByteSlot slot = acquireSlot();<a name="line.598"></a>
+<span class="sourceLineNo">599</span>    try {<a name="line.599"></a>
+<span class="sourceLineNo">600</span>      // Serialize the update<a name="line.600"></a>
+<span class="sourceLineNo">601</span>      ProcedureWALFormat.writeUpdate(slot, proc);<a name="line.601"></a>
+<span class="sourceLineNo">602</span><a name="line.602"></a>
+<span class="sourceLineNo">603</span>      // Push the transaction data and wait until it is persisted<a name="line.603"></a>
+<span class="sourceLineNo">604</span>      pushData(PushType.UPDATE, slot, proc.getProcId(), null);<a name="line.604"></a>
+<span class="sourceLineNo">605</span>    } catch (IOException e) {<a name="line.605"></a>
+<span class="sourceLineNo">606</span>      // We are not able to serialize the procedure.<a name="line.606"></a>
+<span class="sourceLineNo">607</span>      // this is a code error, and we are not able to go on.<a name="line.607"></a>
+<span class="sourceLineNo">608</span>      LOG.error(HBaseMarkers.FATAL, "Unable to serialize the procedure: " + proc, e);<a name="line.608"></a>
+<span class="sourceLineNo">609</span>      throw new RuntimeException(e);<a name="line.609"></a>
+<span class="sourceLineNo">610</span>    } finally {<a name="line.610"></a>
+<span class="sourceLineNo">611</span>      releaseSlot(slot);<a name="line.611"></a>
+<span class="sourceLineNo">612</span>    }<a name="line.612"></a>
+<span class="sourceLineNo">613</span>  }<a name="line.613"></a>
+<span class="sourceLineNo">614</span><a name="line.614"></a>
+<span class="sourceLineNo">615</span>  @Override<a name="line.615"></a>
+<span class="sourceLineNo">616</span>  public void delete(long procId) {<a name="line.616"></a>
+<span class="sourceLineNo">617</span>    LOG.trace("Delete {}", procId);<a name="line.617"></a>
+<span class="sourceLineNo">618</span>    ByteSlot slot = acquireSlot();<a name="line.618"></a>
+<span class="sourceLineNo">619</span>    try {<a name="line.619"></a>
+<span class="sourceLineNo">620</span>      // Serialize the delete<a name="line.620"></a>
+<span class="sourceLineNo">621</span>      ProcedureWALFormat.writeDelete(slot, procId);<a name="line.621"></a>
+<span class="sourceLineNo">622</span><a name="line.622"></a>
+<span class="sourceLineNo">623</span>      // Push the transaction data and wait until it is persisted<a name="line.623"></a>
+<span class="sourceLineNo">624</span>      pushData(PushType.DELETE, slot, procId, null);<a name="line.624"></a>
+<span class="sourceLineNo">625</span>    } catch (IOException e) {<a name="line.625"></a>
+<span class="sourceLineNo">626</span>      // We are not able to serialize the procedure.<a name="line.626"></a>
+<span class="sourceLineNo">627</span>      // this is a code error, and we are not able to go on.<a name="line.627"></a>
+<span class="sourceLineNo">628</span>      LOG.error(HBaseMarkers.FATAL, "Unable to serialize the procedure: " + procId, e);<a name="line.628"></a>
+<span class="sourceLineNo">629</span>      throw new RuntimeException(e);<a name="line.629"></a>
+<span class="sourceLineNo">630</span>    } finally {<a name="line.630"></a>
+<span class="sourceLineNo">631</span>      releaseSlot(slot);<a name="line.631"></a>
+<span class="sourceLineNo">632</span>    }<a name="line.632"></a>
+<span class="sourceLineNo">633</span>  }<a name="line.633"></a>
+<span class="sourceLineNo">634</span><a name="line.634"></a>
+<span class="sourceLineNo">635</span>  @Override<a name="line.635"></a>
+<span class="sourceLineNo">636</span>  public void delete(Procedure&lt;?&gt; proc, long[] subProcIds) {<a name="line.636"></a>
+<span class="sourceLineNo">637</span>    assert proc != null : "expected a non-null procedure";<a name="line.637"></a>
+<span class="sourceLineNo">638</span>    assert subProcIds != null &amp;&amp; subProcIds.length &gt; 0 : "expected subProcIds";<a name="line.638"></a>
+<span class="sourceLineNo">639</span>    if (LOG.isTraceEnabled()) {<a name="line.639"></a>
+<span class="sourceLineNo">640</span>      LOG.trace("Update " + proc + " and Delete " + Arrays.toString(subProcIds));<a name="line.640"></a>
+<span class="sourceLineNo">641</span>    }<a name="line.641"></a>
+<span class="sourceLineNo">642</span><a name="line.642"></a>
+<span class="sourceLineNo">643</span>    ByteSlot slot = acquireSlot();<a name="line.643"></a>
+<span class="sourceLineNo">644</span>    try {<a name="line.644"></a>
+<span class="sourceLineNo">645</span>      // Serialize the delete<a name="line.645"></a>
+<span class="sourceLineNo">646</span>      ProcedureWALFormat.writeDelete(slot, proc, subProcIds);<a name="line.646"></a>
+<span class="sourceLineNo">647</span><a name="line.647"></a>
+<span class="sourceLineNo">648</span>      // Push the transaction data and wait until it is persisted<a name="line.648"></a>
+<span class="sourceLineNo">649</span>      pushData(PushType.DELETE, slot, proc.getProcId(), subProcIds);<a name="line.649"></a>
+<span class="sourceLineNo">650</span>    } catch (IOException e) {<a name="line.650"></a>
+<span class="sourceLineNo">651</span>      // We are not able to serialize the procedure.<a name="line.651"></a>
+<span class="sourceLineNo">652</span>      // this is a code error, and we are not able to go on.<a name="line.652"></a>
+<span class="sourceLineNo">653</span>      LOG.error(HBaseMarkers.FATAL, "Unable to serialize the procedure: " + proc, e);<a name="line.653"></a>
+<span class="sourceLineNo">654</span>      throw new RuntimeException(e);<a name="line.654"></a>
+<span class="sourceLineNo">655</span>    } finally {<a name="line.655"></a>
+<span class="sourceLineNo">656</span>      releaseSlot(slot);<a name="line.656"></a>
+<span class="sourceLineNo">657</span>    }<a name="line.657"></a>
+<span class="sourceLineNo">658</span>  }<a name="line.658"></a>
+<span class="sourceLineNo">659</span><a name="line.659"></a>
+<span class="sourceLineNo">660</span>  @Override<a name="line.660"></a>
+<span class="sourceLineNo">661</span>  public void delete(final long[] procIds, final int offset, final int count) {<a name="line.661"></a>
+<span class="sourceLineNo">662</span>    if (count == 0) return;<a name="line.662"></a>
+<span class="sourceLineNo">663</span>    if (offset == 0 &amp;&amp; count == procIds.length) {<a name="line.663"></a>
+<span class="sourceLineNo">664</span>      delete(procIds);<a name="line.664"></a>
+<span class="sourceLineNo">665</span>    } else if (count == 1) {<a name="line.665"></a>
+<span class="sourceLineNo">666</span>      delete(procIds[offset]);<a name="line.666"></a>
+<span class="sourceLineNo">667</span>    } else {<a name="line.667"></a>
+<span class="sourceLineNo">668</span>      delete(Arrays.copyOfRange(procIds, offset, offset + count));<a name="line.668"></a>
 <span class="sourceLineNo">669</span>    }<a name="line.669"></a>
-<span class="sourceLineNo">670</span><a name="line.670"></a>
-<span class="sourceLineNo">671</span>    final ByteSlot slot = acquireSlot();<a name="line.671"></a>
-<span class="sourceLineNo">672</span>    try {<a name="line.672"></a>
-<span class="sourceLineNo">673</span>      // Serialize the delete<a name="line.673"></a>
-<span class="sourceLineNo">674</span>      for (int i = 0; i &lt; procIds.length; ++i) {<a name="line.674"></a>
-<span class="sourceLineNo">675</span>        ProcedureWALFormat.writeDelete(slot, procIds[i]);<a name="line.675"></a>
-<span class="sourceLineNo">676</span>      }<a name="line.676"></a>
-<span class="sourceLineNo">677</span><a name="line.677"></a>
-<span class="sourceLineNo">678</span>      // Push the transaction data and wait until it is persisted<a name="line.678"></a>
-<span class="sourceLineNo">679</span>      pushData(PushType.DELETE, slot, Procedure.NO_PROC_ID, procIds);<a name="line.679"></a>
-<span class="sourceLineNo">680</span>    } catch (IOException e) {<a name="line.680"></a>
-<span class="sourceLineNo">681</span>      // We are not able to serialize the procedure.<a name="line.681"></a>
-<span class="sourceLineNo">682</span>      // this is a code error, and we are not able to go on.<a name="line.682"></a>
-<span class="sourceLineNo">683</span>      LOG.error("Unable to serialize the procedures: " + Arrays.toString(procIds), e);<a name="line.683"></a>
-<span class="sourceLineNo">684</span>      throw new RuntimeException(e);<a name="line.684"></a>
-<span class="sourceLineNo">685</span>    } finally {<a name="line.685"></a>
-<span class="sourceLineNo">686</span>      releaseSlot(slot);<a name="line.686"></a>
-<span class="sourceLineNo">687</span>    }<a name="line.687"></a>
-<span class="sourceLineNo">688</span>  }<a name="line.688"></a>
-<span class="sourceLineNo">689</span><a name="line.689"></a>
-<span class="sourceLineNo">690</span>  private ByteSlot acquireSlot() {<a name="line.690"></a>
-<span class="sourceLineNo">691</span>    ByteSlot slot = slotsCache.poll();<a name="line.691"></a>
-<span class="sourceLineNo">692</span>    return slot != null ? slot : new ByteSlot();<a name="line.692"></a>
-<span class="sourceLineNo">693</span>  }<a name="line.693"></a>
-<span class="sourceLineNo">694</span><a name="line.694"></a>
-<span class="sourceLineNo">695</span>  private void releaseSlot(final ByteSlot slot) {<a name="line.695"></a>
-<span class="sourceLineNo">696</span>    slot.reset();<a name="line.696"></a>
-<span class="sourceLineNo">697</span>    slotsCache.offer(slot);<a name="line.697"></a>
-<span class="sourceLineNo">698</span>  }<a name="line.698"></a>
-<span class="sourceLineNo">699</span><a name="line.699"></a>
-<span class="sourceLineNo">700</span>  private enum PushType { INSERT, UPDATE, DELETE }<a name="line.700"></a>
-<span class="sourceLineNo">701</span><a name="line.701"></a>
-<span class="sourceLineNo">702</span>  private long pushData(final PushType type, final ByteSlot slot,<a name="line.702"></a>
-<span class="sourceLineNo">703</span>      final long procId, final long[] subProcIds) {<a name="line.703"></a>
-<span class="sourceLineNo">704</span>    if (!isRunning()) {<a name="line.704"></a>
-<span class="sourceLineNo">705</span>      throw new RuntimeException("the store must be running before inserting data");<a name="line.705"></a>
-<span class="sourceLineNo">706</span>    }<a name="line.706"></a>
-<span class="sourceLineNo">707</span>    if (logs.isEmpty()) {<a name="line.707"></a>
-<span class="sourceLineNo">708</span>      throw new RuntimeException("recoverLease() must be called before inserting data");<a name="line.708"></a>
-<span class="sourceLineNo">709</span>    }<a name="line.709"></a>
-<span class="sourceLineNo">710</span><a name="line.710"></a>
-<span class="sourceLineNo">711</span>    long logId = -1;<a name="line.711"></a>
-<span class="sourceLineNo">712</span>    lock.lock();<a name="line.712"></a>
-<span class="sourceLineNo">713</span>    try {<a name="line.713"></a>
-<span class="sourceLineNo">714</span>      // Wait for the sync to be completed<a name="line.714"></a>
-<span class="sourceLineNo">715</span>      while (true) {<a name="line.715"></a>
-<span class="sourceLineNo">716</span>        if (!isRunning()) {<a name="line.716"></a>
-<span class="sourceLineNo">717</span>          throw new RuntimeException("store no longer running");<a name="line.717"></a>
-<span class="sourceLineNo">718</span>        } else if (isSyncAborted()) {<a name="line.718"></a>
-<span class="sourceLineNo">719</span>          throw new RuntimeException("sync aborted", syncException.get());<a name="line.719"></a>
-<span class="sourceLineNo">720</span>        } else if (inSync.get()) {<a name="line.720"></a>
-<span class="sourceLineNo">721</span>          syncCond.await();<a name="line.721"></a>
-<span class="sourceLineNo">722</span>        } else if (slotIndex &gt;= syncMaxSlot) {<a name="line.722"></a>
-<span class="sourceLineNo">723</span>          slotCond.signal();<a name="line.723"></a>
-<span class="sourceLineNo">724</span>          syncCond.await();<a name="line.724"></a>
-<span class="sourceLineNo">725</span>        } else {<a name="line.725"></a>
-<span class="sourceLineNo">726</span>          break;<a name="line.726"></a>
-<span class="sourceLineNo">727</span>        }<a name="line.727"></a>
-<span class="sourceLineNo">728</span>      }<a name="line.728"></a>
-<span class="sourceLineNo">729</span><a name="line.729"></a>
-<span class="sourceLineNo">730</span>      final long pushSyncId = syncId.get();<a name="line.730"></a>
-<span class="sourceLineNo">731</span>      updateStoreTracker(type, procId, subProcIds);<a name="line.731"></a>
-<span class="sourceLineNo">732</span>      slots[slotIndex++] = slot;<a name="line.732"></a>
-<span class="sourceLineNo">733</span>      logId = flushLogId;<a name="line.733"></a>
-<span class="sourceLineNo">734</span><a name="line.734"></a>
-<span class="sourceLineNo">735</span>      // Notify that there is new data<a name="line.735"></a>
-<span class="sourceLineNo">736</span>      if (slotIndex == 1) {<a name="line.736"></a>
-<span class="sourceLineNo">737</span>        waitCond.signal();<a name="line.737"></a>
-<span class="sourceLineNo">738</span>      }<a name="line.738"></a>
-<span class="sourceLineNo">739</span><a name="line.739"></a>
-<span class="sourceLineNo">740</span>      // Notify that the slots are full<a name="line.740"></a>
-<span class="sourceLineNo">741</span>      if (slotIndex == syncMaxSlot) {<a name="line.741"></a>
-<span class="sourceLineNo">742</span>        waitCond.signal();<a name="line.742"></a>
-<span class="sourceLineNo">743</span>        slotCond.signal();<a name="line.743"></a>
+<span class="sourceLineNo">670</span>  }<a name="line.670"></a>
+<span class="sourceLineNo">671</span><a name="line.671"></a>
+<span class="sourceLineNo">672</span>  private void delete(long[] procIds) {<a name="line.672"></a>
+<span class="sourceLineNo">673</span>    if (LOG.isTraceEnabled()) {<a name="line.673"></a>
+<span class="sourceLineNo">674</span>      LOG.trace("Delete " + Arrays.toString(procIds));<a name="line.674"></a>
+<span class="sourceLineNo">675</span>    }<a name="line.675"></a>
+<span class="sourceLineNo">676</span><a name="line.676"></a>
+<span class="sourceLineNo">677</span>    final ByteSlot slot = acquireSlot();<a name="line.677"></a>
+<span class="sourceLineNo">678</span>    try {<a name="line.678"></a>
+<span class="sourceLineNo">679</span>      // Serialize the delete<a name="line.679"></a>
+<span class="sourceLineNo">680</span>      for (int i = 0; i &lt; procIds.length; ++i) {<a name="line.680"></a>
+<span class="sourceLineNo">681</span>        ProcedureWALFormat.writeDelete(slot, procIds[i]);<a name="line.681"></a>
+<span class="sourceLineNo">682</span>      }<a name="line.682"></a>
+<span class="sourceLineNo">683</span><a name="line.683"></a>
+<span class="sourceLineNo">684</span>      // Push the transaction data and wait until it is persisted<a name="line.684"></a>
+<span class="sourceLineNo">685</span>      pushData(PushType.DELETE, slot, Procedure.NO_PROC_ID, procIds);<a name="line.685"></a>
+<span class="sourceLineNo">686</span>    } catch (IOException e) {<a name="line.686"></a>
+<span class="sourceLineNo">687</span>      // We are not able to serialize the procedure.<a name="line.687"></a>
+<span class="sourceLineNo">688</span>      // this is a code error, and we are not able to go on.<a name="line.688"></a>
+<span class="sourceLineNo">689</span>      LOG.error("Unable to serialize the procedures: " + Arrays.toString(procIds), e);<a name="line.689"></a>
+<span class="sourceLineNo">690</span>      throw new RuntimeException(e);<a name="line.690"></a>
+<span class="sourceLineNo">691</span>    } finally {<a name="line.691"></a>
+<span class="sourceLineNo">692</span>      releaseSlot(slot);<a name="line.692"></a>
+<span class="sourceLineNo">693</span>    }<a name="line.693"></a>
+<span class="sourceLineNo">694</span>  }<a name="line.694"></a>
+<span class="sourceLineNo">695</span><a name="line.695"></a>
+<span class="sourceLineNo">696</span>  private ByteSlot acquireSlot() {<a name="line.696"></a>
+<span class="sourceLineNo">697</span>    ByteSlot slot = slotsCache.poll();<a name="line.697"></a>
+<span class="sourceLineNo">698</span>    return slot != null ? slot : new ByteSlot();<a name="line.698"></a>
+<span class="sourceLineNo">699</span>  }<a name="line.699"></a>
+<span class="sourceLineNo">700</span><a name="line.700"></a>
+<span class="sourceLineNo">701</span>  private void releaseSlot(final ByteSlot slot) {<a name="line.701"></a>
+<span class="sourceLineNo">702</span>    slot.reset();<a name="line.702"></a>
+<span class="sourceLineNo">703</span>    slotsCache.offer(slot);<a name="line.703"></a>
+<span class="sourceLineNo">704</span>  }<a name="line.704"></a>
+<span class="sourceLineNo">705</span><a name="line.705"></a>
+<span class="sourceLineNo">706</span>  private enum PushType { INSERT, UPDATE, DELETE }<a name="line.706"></a>
+<span class="sourceLineNo">707</span><a name="line.707"></a>
+<span class="sourceLineNo">708</span>  private long pushData(final PushType type, final ByteSlot slot,<a name="line.708"></a>
+<span class="sourceLineNo">709</span>      final long procId, final long[] subProcIds) {<a name="line.709"></a>
+<span class="sourceLineNo">710</span>    if (!isRunning()) {<a name="line.710"></a>
+<span class="sourceLineNo">711</span>      throw new RuntimeException("the store must be running before inserting data");<a name="line.711"></a>
+<span class="sourceLineNo">712</span>    }<a name="line.712"></a>
+<span class="sourceLineNo">713</span>    if (logs.isEmpty()) {<a name="line.713"></a>
+<span class="sourceLineNo">714</span>      throw new RuntimeException("recoverLease() must be called before inserting data");<a name="line.714"></a>
+<span class="sourceLineNo">715</span>    }<a name="line.715"></a>
+<span class="sourceLineNo">716</span><a name="line.716"></a>
+<span class="sourceLineNo">717</span>    long logId = -1;<a name="line.717"></a>
+<span class="sourceLineNo">718</span>    lock.lock();<a name="line.718"></a>
+<span class="sourceLineNo">719</span>    try {<a name="line.719"></a>
+<span class="sourceLineNo">720</span>      // Wait for the sync to be completed<a name="line.720"></a>
+<span class="sourceLineNo">721</span>      while (true) {<a name="line.721"></a>
+<span class="sourceLineNo">722</span>        if (!isRunning()) {<a name="line.722"></a>
+<span class="sourceLineNo">723</span>          throw new RuntimeException("store no longer running");<a name="line.723"></a>
+<span class="sourceLineNo">724</span>        } else if (isSyncAborted()) {<a name="line.724"></a>
+<span class="sourceLineNo">725</span>          throw new RuntimeException("sync aborted", syncException.get());<a name="line.725"></a>
+<span class="sourceLineNo">726</span>        } else if (inSync.get()) {<a name="line.726"></a>
+<span class="sourceLineNo">727</span>          syncCond.await();<a name="line.727"></a>
+<span class="sourceLineNo">728</span>        } else if (slotIndex &gt;= syncMaxSlot) {<a name="line.728"></a>
+<span class="sourceLineNo">729</span>          slotCond.signal();<a name="line.729"></a>
+<span class="sourceLineNo">730</span>          syncCond.await();<a name="line.730"></a>
+<span class="sourceLineNo">731</span>        } else {<a name="line.731"></a>
+<span class="sourceLineNo">732</span>          break;<a name="line.732"></a>
+<span class="sourceLineNo">733</span>        }<a name="line.733"></a>
+<span class="sourceLineNo">734</span>      }<a name="line.734"></a>
+<span class="sourceLineNo">735</span><a name="line.735"></a>
+<span class="sourceLineNo">736</span>      final long pushSyncId = syncId.get();<a name="line.736"></a>
+<span class="sourceLineNo">737</span>      updateStoreTracker(type, procId, subProcIds);<a name="line.737"></a>
+<span class="sourceLineNo">738</span>      slots[slotIndex++] = slot;<a name="line.738"></a>
+<span class="sourceLineNo">739</span>      logId = flushLogId;<a name="line.739"></a>
+<span class="sourceLineNo">740</span><a name="line.740"></a>
+<span class="sourceLineNo">741</span>      // Notify that there is new data<a name="line.741"></a>
+<span class="sourceLineNo">742</span>      if (slotIndex == 1) {<a name="line.742"></a>
+<span class="sourceLineNo">743</span>        waitCond.signal();<a name="line.743"></a>
 <span class="sourceLineNo">744</span>      }<a name="line.744"></a>
 <span class="sourceLineNo">745</span><a name="line.745"></a>
-<span class="sourceLineNo">746</span>      while (pushSyncId == syncId.get() &amp;&amp; isRunning()) {<a name="line.746"></a>
-<span class="sourceLineNo">747</span>        syncCond.await();<a name="line.747"></a>
-<span class="sourceLineNo">748</span>      }<a name="line.748"></a>
-<span class="sourceLineNo">749</span>    } catch (InterruptedException e) {<a name="line.749"></a>
-<span class="sourceLineNo">750</span>      Thread.currentThread().interrupt();<a name="line.750"></a>
-<span class="sourceLineNo">751</span>      sendAbortProcessSignal();<a name="line.751"></a>
-<span class="sourceLineNo">752</span>      throw new RuntimeException(e);<a name="line.752"></a>
-<span class="sourceLineNo">753</span>    } finally {<a name="line.753"></a>
-<span class="sourceLineNo">754</span>      lock.unlock();<a name="line.754"></a>
-<span class="sourceLineNo">755</span>      if (isSyncAborted()) {<a name="line.755"></a>
-<span class="sourceLineNo">756</span>        throw new RuntimeException("sync aborted", syncException.get());<a name="line.756"></a>
-<span class="sourceLineNo">757</span>      }<a name="line.757"></a>
-<span class="sourceLineNo">758</span>    }<a name="line.758"></a>
-<span class="sourceLineNo">759</span>    return logId;<a name="line.759"></a>
-<span class="sourceLineNo">760</span>  }<a name="line.760"></a>
-<span class="sourceLineNo">761</span><a name="line.761"></a>
-<span class="sourceLineNo">762</span>  private void updateStoreTracker(final PushType type,<a name="line.762"></a>
-<span class="sourceLineNo">763</span>      final long procId, final long[] subProcIds) {<a name="line.763"></a>
-<span class="sourceLineNo">764</span>    switch (type) {<a name="line.764"></a>
-<span class="sourceLineNo">765</span>      case INSERT:<a name="line.765"></a>
-<span class="sourceLineNo">766</span>        if (subProcIds == null) {<a name="line.766"></a>
-<span class="sourceLineNo">767</span>          storeTracker.insert(procId);<a name="line.767"></a>
-<span class="sourceLineNo">768</span>        } else if (procId == Procedure.NO_PROC_ID) {<a name="line.768"></a>
-<span class="sourceLineNo">769</span>          storeTracker.insert(subProcIds);<a name="line.769"></a>
-<span class="sourceLineNo">770</span>        } else {<a name="line.770"></a>
-<span class="sourceLineNo">771</span>          storeTracker.insert(procId, subProcIds);<a name="line.771"></a>
-<span class="sourceLineNo">772</span>          holdingCleanupTracker.setDeletedIfModified(procId);<a name="line.772"></a>
-<span class="sourceLineNo">773</span>        }<a name="line.773"></a>
-<span class="sourceLineNo">774</span>        break;<a name="line.774"></a>
-<span class="sourceLineNo">775</span>      case UPDATE:<a name="line.775"></a>
-<span class="sourceLineNo">776</span>        storeTracker.update(procId);<a name="line.776"></a>
-<span class="sourceLineNo">777</span>        holdingCleanupTracker.setDeletedIfModified(procId);<a name="line.777"></a>
-<span class="sourceLineNo">778</span>        break;<a name="line.778"></a>
-<span class="sourceLineNo">779</span>      case DELETE:<a name="line.779"></a>
-<span class="sourceLineNo">780</span>        if (subProcIds != null &amp;&amp; subProcIds.length &gt; 0) {<a name="line.780"></a>
-<span class="sourceLineNo">781</span>          storeTracker.delete(subProcIds);<a name="line.781"></a>
-<span class="sourceLineNo">782</span>          holdingCleanupTracker.setDeletedIfModified(subProcIds);<a name="line.782"></a>
-<span class="sourceLineNo">783</span>        } else {<a name="line.783"></a>
-<span class="sourceLineNo">784</span>          storeTracker.delete(procId);<a name="line.784"></a>
-<span class="sourceLineNo">785</span>          holdingCleanupTracker.setDeletedIfModified(procId);<a name="line.785"></a>
-<span class="sourceLineNo">786</span>        }<a name="line.786"></a>
-<span class="sourceLineNo">787</span>        break;<a name="line.787"></a>
-<span class="sourceLineNo">788</span>      default:<a name="line.788"></a>
-<span class="sourceLineNo">789</span>        throw new RuntimeException("invalid push type " + type);<a name="line.789"></a>
-<span class="sourceLineNo">790</span>    }<a name="line.790"></a>
-<span class="sourceLineNo">791</span>  }<a name="line.791"></a>
-<span class="sourceLineNo">792</span><a name="line.792"></a>
-<span class="sourceLineNo">793</span>  private boolean isSyncAborted() {<a name="line.793"></a>
-<span class="sourceLineNo">794</span>    return syncException.get() != null;<a name="line.794"></a>
-<span class="sourceLineNo">795</span>  }<a name="line.795"></a>
-<span class="sourceLineNo">796</span><a name="line.796"></a>
-<span class="sourceLineNo">797</span>  private void syncLoop() throws Throwable {<a name="line.797"></a>
-<span class="sourceLineNo">798</span>    long totalSyncedToStore = 0;<a name="line.798"></a>
-<span class="sourceLineNo">799</span>    inSync.set(false);<a name="line.799"></a>
-<span class="sourceLineNo">800</span>    lock.lock();<a name="line.800"></a>
-<span class="sourceLineNo">801</span>    try {<a name="line.801"></a>
-<span class="sourceLineNo">802</span>      while (isRunning()) {<a name="line.802"></a>
-<span class="sourceLineNo">803</span>        try {<a name="line.803"></a>
-<span class="sourceLineNo">804</span>          // Wait until new data is available<a name="line.804"></a>
-<span class="sourceLineNo">805</span>          if (slotIndex == 0) {<a name="line.805"></a>
-<span class="sourceLineNo">806</span>            if (!loading.get()) {<a name="line.806"></a>
-<span class="sourceLineNo">807</span>              periodicRoll();<a name="line.807"></a>
-<span class="sourceLineNo">808</span>            }<a name="line.808"></a>
-<span class="sourceLineNo">809</span><a name="line.809"></a>
-<span class="sourceLineNo">810</span>            if (LOG.isTraceEnabled()) {<a name="line.810"></a>
-<span class="sourceLineNo">811</span>              float rollTsSec = getMillisFromLastRoll() / 1000.0f;<a name="line.811"></a>
-<span class="sourceLineNo">812</span>              LOG.trace(String.format("Waiting for data. flushed=%s (%s/sec)",<a name="line.812"></a>
-<span class="sourceLineNo">813</span>                        StringUtils.humanSize(totalSynced.get()),<a name="line.813"></a>
-<span class="sourceLineNo">814</span>                        StringUtils.humanSize(totalSynced.get() / rollTsSec)));<a name="line.814"></a>
-<span class="sourceLineNo">815</span>            }<a name="line.815"></a>
-<span class="sourceLineNo">816</span><a name="line.816"></a>
-<span class="sourceLineNo">817</span>            waitCond.await(getMillisToNextPeriodicRoll(), TimeUnit.MILLISECONDS);<a name="line.817"></a>
-<span class="sourceLineNo">818</span>            if (slotIndex == 0) {<a name="line.818"></a>
-<span class="sourceLineNo">819</span>              // no data.. probably a stop() or a periodic roll<a name="line.819"></a>
-<span class="sourceLineNo">820</span>              continue;<a name="line.820"></a>
+<span class="sourceLineNo">746</span>      // Notify that the slots are full<a name="line.746"></a>
+<span class="sourceLineNo">747</span>      if (slotIndex == syncMaxSlot) {<a name="line.747"></a>
+<span class="sourceLineNo">748</span>        waitCond.signal();<a name="line.748"></a>
+<span class="sourceLineNo">749</span>        slotCond.signal();<a name="line.749"></a>
+<span class="sourceLineNo">750</span>      }<a name="line.750"></a>
+<span class="sourceLineNo">751</span><a name="line.751"></a>
+<span class="sourceLineNo">752</span>      while (pushSyncId == syncId.get() &amp;&amp; isRunning()) {<a name="line.752"></a>
+<span class="sourceLineNo">753</span>        syncCond.await();<a name="line.753"></a>
+<span class="sourceLineNo">754</span>      }<a name="line.754"></a>
+<span class="sourceLineNo">755</span>    } catch (InterruptedException e) {<a name="line.755"></a>
+<span class="sourceLineNo">756</span>      Thread.currentThread().interrupt();<a name="line.756"></a>
+<span class="sourceLineNo">757</span>      sendAbortProcessSignal();<a name="line.757"></a>
+<span class="sourceLineNo">758</span>      throw new RuntimeException(e);<a name="line.758"></a>
+<span class="sourceLineNo">759</span>    } finally {<a name="line.759"></a>
+<span class="sourceLineNo">760</span>      lock.unlock();<a name="line.760"></a>
+<span class="sourceLineNo">761</span>      if (isSyncAborted()) {<a name="line.761"></a>
+<span class="sourceLineNo">762</span>        throw new RuntimeException("sync aborted", syncException.get());<a name="line.762"></a>
+<span class="sourceLineNo">763</span>      }<a name="line.763"></a>
+<span class="sourceLineNo">764</span>    }<a name="line.764"></a>
+<span class="sourceLineNo">765</span>    return logId;<a name="line.765"></a>
+<span class="sourceLineNo">766</span>  }<a name="line.766"></a>
+<span class="sourceLineNo">767</span><a name="line.767"></a>
+<span class="sourceLineNo">768</span>  private void updateStoreTracker(final PushType type,<a name="line.768"></a>
+<span class="sourceLineNo">769</span>      final long procId, final long[] subProcIds) {<a name="line.769"></a>
+<span class="sourceLineNo">770</span>    switch (type) {<a name="line.770"></a>
+<span class="sourceLineNo">771</span>      case INSERT:<a name="line.771"></a>
+<span class="sourceLineNo">772</span>        if (subProcIds == null) {<a name="line.772"></a>
+<span class="sourceLineNo">773</span>          storeTracker.insert(procId);<a name="line.773"></a>
+<span class="sourceLineNo">774</span>        } else if (procId == Procedure.NO_PROC_ID) {<a name="line.774"></a>
+<span class="sourceLineNo">775</span>          storeTracker.insert(subProcIds);<a name="line.775"></a>
+<span class="sourceLineNo">776</span>        } else {<a name="line.776"></a>
+<span class="sourceLineNo">777</span>          storeTracker.insert(procId, subProcIds);<a name="line.777"></a>
+<span class="sourceLineNo">778</span>          holdingCleanupTracker.setDeletedIfModified(procId);<a name="line.778"></a>
+<span class="sourceLineNo">779</span>        }<a name="line.779"></a>
+<span class="sourceLineNo">780</span>        break;<a name="line.780"></a>
+<span class="sourceLineNo">781</span>      case UPDATE:<a name="line.781"></a>
+<span class="sourceLineNo">782</span>        storeTracker.update(procId);<a name="line.782"></a>
+<span class="sourceLineNo">783</span>        holdingCleanupTracker.setDeletedIfModified(procId);<a name="line.783"></a>
+<span class="sourceLineNo">784</span>        break;<a name="line.784"></a>
+<span class="sourceLineNo">785</span>      case DELETE:<a name="line.785"></a>
+<span class="sourceLineNo">786</span>        if (subProcIds != null &amp;&amp; subProcIds.length &gt; 0) {<a name="line.786"></a>
+<span class="sourceLineNo">787</span>          storeTracker.delete(subProcIds);<a name="line.787"></a>
+<span class="sourceLineNo">788</span>          holdingCleanupTracker.setDeletedIfModified(subProcIds);<a name="line.788"></a>
+<span class="sourceLineNo">789</span>        } else {<a name="line.789"></a>
+<span class="sourceLineNo">790</span>          storeTracker.delete(procId);<a name="line.790"></a>
+<span class="sourceLineNo">791</span>          holdingCleanupTracker.setDeletedIfModified(procId);<a name="line.791"></a>
+<span class="sourceLineNo">792</span>        }<a name="line.792"></a>
+<span class="sourceLineNo">793</span>        break;<a name="line.793"></a>
+<span class="sourceLineNo">794</span>      default:<a name="line.794"></a>
+<span class="sourceLineNo">795</span>        throw new RuntimeException("invalid push type " + type);<a name="line.795"></a>
+<span class="sourceLineNo">796</span>    }<a name="line.796"></a>
+<span class="sourceLineNo">797</span>  }<a name="line.797"></a>
+<span class="sourceLineNo">798</span><a name="line.798"></a>
+<span class="sourceLineNo">799</span>  private boolean isSyncAborted() {<a name="line.799"></a>
+<span class="sourceLineNo">800</span>    return syncException.get() != null;<a name="line.800"></a>
+<span class="sourceLineNo">801</span>  }<a name="line.801"></a>
+<span class="sourceLineNo">802</span><a name="line.802"></a>
+<span class="sourceLineNo">803</span>  private void syncLoop() throws Throwable {<a name="line.803"></a>
+<span class="sourceLineNo">804</span>    long totalSyncedToStore = 0;<a name="line.804"></a>
+<span class="sourceLineNo">805</span>    inSync.set(false);<a name="line.805"></a>
+<span class="sourceLineNo">806</span>    lock.lock();<a name="line.806"></a>
+<span class="sourceLineNo">807</span>    try {<a name="line.807"></a>
+<span class="sourceLineNo">808</span>      while (isRunning()) {<a name="line.808"></a>
+<span class="sourceLineNo">809</span>        try {<a name="line.809"></a>
+<span class="sourceLineNo">810</span>          // Wait until new data is available<a name="line.810"></a>
+<span class="sourceLineNo">811</span>          if (slotIndex == 0) {<a name="line.811"></a>
+<span class="sourceLineNo">812</span>            if (!loading.get()) {<a name="line.812"></a>
+<span class="sourceLineNo">813</span>              periodicRoll();<a name="line.813"></a>
+<span class="sourceLineNo">814</span>            }<a name="line.814"></a>
+<span class="sourceLineNo">815</span><a name="line.815"></a>
+<span class="sourceLineNo">816</span>            if (LOG.isTraceEnabled()) {<a name="line.816"></a>
+<span class="sourceLineNo">817</span>              float rollTsSec = getMillisFromLastRoll() / 1000.0f;<a name="line.817"></a>
+<span class="sourceLineNo">818</span>              LOG.trace(String.format("Waiting for data. flushed=%s (%s/sec)",<a name="line.818"></a>
+<span class="sourceLineNo">819</span>                        StringUtils.humanSize(totalSynced.get()),<a name="line.819"></a>
+<span class="sourceLineNo">820</span>                        StringUtils.humanSize(totalSynced.get() / rollTsSec)));<a name="line.820"></a>
 <span class="sourceLineNo">821</span>            }<a name="line.821"></a>
-<span class="sourceLineNo">822</span>          }<a name="line.822"></a>
-<span class="sourceLineNo">823</span>          // Wait SYNC_WAIT_MSEC or the signal of "slots full" before flushing<a name="line.823"></a>
-<span class="sourceLineNo">824</span>          syncMaxSlot = runningProcCount;<a name="line.824"></a>
-<span class="sourceLineNo">825</span>          assert syncMaxSlot &gt; 0 : "unexpected syncMaxSlot=" + syncMaxSlot;<a name="line.825"></a>
-<span class="sourceLineNo">826</span>          final long syncWaitSt = System.currentTimeMillis();<a name="line.826"></a>
-<span class="sourceLineNo">827</span>          if (slotIndex != syncMaxSlot) {<a name="line.827"></a>
-<span class="sourceLineNo">828</span>            slotCond.await(syncWaitMsec, TimeUnit.MILLISECONDS);<a name="line.828"></a>
-<span class="sourceLineNo">829</span>          }<a name="line.829"></a>
-<span class="sourceLineNo">830</span><a name="line.830"></a>
-<span class="sourceLineNo">831</span>          final long currentTs = System.currentTimeMillis();<a name="line.831"></a>
-<span class="sourceLineNo">832</span>          final long syncWaitMs = currentTs - syncWaitSt;<a name="line.832"></a>
-<span class="sourceLineNo">833</span>          final float rollSec = getMillisFromLastRoll() / 1000.0f;<a name="line.833"></a>
-<span class="sourceLineNo">834</span>          final float syncedPerSec = totalSyncedToStore / rollSec;<a name="line.834"></a>
-<span class="sourceLineNo">835</span>          if (LOG.isTraceEnabled() &amp;&amp; (syncWaitMs &gt; 10 || slotIndex &lt; syncMaxSlot)) {<a name="line.835"></a>
-<span class="sourceLineNo">836</span>            LOG.trace(String.format("Sync wait %s, slotIndex=%s , totalSynced=%s (%s/sec)",<a name="line.836"></a>
-<span class="sourceLineNo">837</span>                      StringUtils.humanTimeDiff(syncWaitMs), slotIndex,<a name="line.837"></a>
-<span class="sourceLineNo">838</span>                      StringUtils.humanSize(totalSyncedToStore),<a name="line.838"></a>
-<span class="sourceLineNo">839</span>                      StringUtils.humanSize(syncedPerSec)));<a name="line.839"></a>
-<span class="sourceLineNo">840</span>          }<a name="line.840"></a>
-<span class="sourceLineNo">841</span><a name="line.841"></a>
-<span class="sourceLineNo">842</span>          // update webui circular buffers (TODO: get rid of allocations)<a name="line.842"></a>
-<span class="sourceLineNo">843</span>          final SyncMetrics syncMetrics = new SyncMetrics();<a name="line.843"></a>
-<span class="sourceLineNo">844</span>          syncMetrics.timestamp = currentTs;<a name="line.844"></a>
-<span class="sourceLineNo">845</span>          syncMetrics.syncWaitMs = syncWaitMs;<a name="line.845"></a>
-<span class="sourceLineNo">846</span>          syncMetrics.syncedEntries = slotIndex;<a name="line.846"></a>
-<span class="sourceLineNo">847</span>          syncMetrics.totalSyncedBytes = totalSyncedToStore;<a name="line.847"></a>
-<span class="sourceLineNo">848</span>          syncMetrics.syncedPerSec = syncedPerSec;<a name="line.848"></a>
-<span class="sourceLineNo">849</span>          syncMetricsQueue.add(syncMetrics);<a name="line.849"></a>
-<span class="sourceLineNo">850</span><a name="line.850"></a>
-<span class="sourceLineNo">851</span>          // sync<a name="line.851"></a>
-<span class="sourceLineNo">852</span>          inSync.set(true);<a name="line.852"></a>
-<span class="sourceLineNo">853</span>          long slotSize = syncSlots();<a name="line.853"></a>
-<span class="sourceLineNo">854</span>          logs.getLast().addToSize(slotSize);<a name="line.854"></a>
-<span class="sourceLineNo">855</span>          totalSyncedToStore = totalSynced.addAndGet(slotSize);<a name="line.855"></a>
-<span class="sourceLineNo">856</span>          slotIndex = 0;<a name="line.856"></a>
-<span class="sourceLineNo">857</span>          inSync.set(false);<a name="line.857"></a>
-<span class="sourceLineNo">858</span>          syncId.incrementAndGet();<a name="line.858"></a>
-<span class="sourceLineNo">859</span>        } catch (InterruptedException e) {<a name="line.859"></a>
-<span class="sourceLineNo">860</span>          Thread.currentThread().interrupt();<a name="line.860"></a>
-<span class="sourceLineNo">861</span>          syncException.compareAndSet(null, e);<a name="line.861"></a>
-<span class="sourceLineNo">862</span>          sendAbortProcessSignal();<a name="line.862"></a>
-<span class="sourceLineNo">863</span>          throw e;<a name="line.863"></a>
-<span class="sourceLineNo">864</span>        } catch (Throwable t) {<a name="line.864"></a>
-<span class="sourceLineNo">865</span>          syncException.compareAndSet(null, t);<a name="line.865"></a>
-<span class="sourceLineNo">866</span>          sendAbortProcessSignal();<a name="line.866"></a>
-<span class="sourceLineNo">867</span>          throw t;<a name="line.867"></a>
-<span class="sourceLineNo">868</span>        } finally {<a name="line.868"></a>
-<span class="sourceLineNo">869</span>          syncCond.signalAll();<a name="line.869"></a>
-<span class="sourceLineNo">870</span>        }<a name="line.870"></a>
-<span class="sourceLineNo">871</span>      }<a name="line.871"></a>
-<span class="sourceLineNo">872</span>    } finally {<a name="line.872"></a>
-<span class="sourceLineNo">873</span>      lock.unlock();<a name="line.873"></a>
-<span class="sourceLineNo">874</span>    }<a name="line.874"></a>
-<span class="sourceLineNo">875</span>  }<a name="line.875"></a>
-<span class="sourceLineNo">876</span><a name="line.876"></a>
-<span class="sourceLineNo">877</span>  public ArrayList&lt;SyncMetrics&gt; getSyncMetrics() {<a name="line.877"></a>
-<span class="sourceLineNo">878</span>    lock.lock();<a name="line.878"></a>
-<span class="sourceLineNo">879</span>    try {<a name="line.879"></a>
-<span class="sourceLineNo">880</span>      return new ArrayList&lt;&gt;(syncMetricsQueue);<a name="line.880"></a>
-<span class="sourceLineNo">881</span>    } finally {<a name="line.881"></a>
-<span class="sourceLineNo">882</span>      lock.unlock();<a name="line.882"></a>
-<span class="sourceLineNo">883</span>    }<a name="line.883"></a>
-<span class="sourceLineNo">884</span>  }<a name="line.884"></a>
-<span class="sourceLineNo">885</span><a name="line.885"></a>
-<span class="sourceLineNo">886</span>  private long syncSlots() throws Throwable {<a name="line.886"></a>
-<span class="sourceLineNo">887</span>    int retry = 0;<a name="line.887"></a>
-<span class="sourceLineNo">888</span>    int logRolled = 0;<a name="line.888"></a>
-<span class="sourceLineNo">889</span>    long totalSynced = 0;<a name="line.889"></a>
-<span class="sourceLineNo">890</span>    do {<a name="line.890"></a>
-<span class="sourceLineNo">891</span>      try {<a name="line.891"></a>
-<span class="sourceLineNo">892</span>        totalSynced = syncSlots(stream, slots, 0, slotIndex);<a name="line.892"></a>
-<span class="sourceLineNo">893</span>        break;<a name="line.893"></a>
-<span class="sourceLineNo">894</span>      } catch (Throwable e) {<a name="line.894"></a>
-<span class="sourceLineNo">895</span>        LOG.warn("unable to sync slots, retry=" + retry);<a name="line.895"></a>
-<span class="sourceLineNo">896</span>        if (++retry &gt;= maxRetriesBeforeRoll) {<a name="line.896"></a>
-<span class="sourceLineNo">897</span>          if (logRolled &gt;= maxSyncFailureRoll &amp;&amp; isRunning()) {<a name="line.897"></a>
-<span class="sourceLineNo">898</span>            LOG.error("Sync slots after log roll failed, abort.", e);<a name="line.898"></a>
-<span class="sourceLineNo">899</span>            throw e;<a name="line.899"></a>
-<span class="sourceLineNo">900</span>          }<a name="line.900"></a>
-<span class="sourceLineNo">901</span><a name="line.901"></a>
-<span class="sourceLineNo">902</span>          if (!rollWriterWithRetries()) {<a name="line.902"></a>
-<span class="sourceLineNo">903</span>            throw e;<a name="line.903"></a>
-<span class="sourceLineNo">904</span>          }<a name="line.904"></a>
-<span class="sourceLineNo">905</span><a name="line.905"></a>
-<span class="sourceLineNo">906</span>          logRolled++;<a name="line.906"></a>
-<span class="sourceLineNo">907</span>          retry = 0;<a name="line.907"></a>
-<span class="sourceLineNo">908</span>        }<a name="line.908"></a>
-<span class="sourceLineNo">909</span>      }<a name="line.909"></a>
-<span class="sourceLineNo">910</span>    } while (isRunning());<a name="line.910"></a>
-<span class="sourceLineNo">911</span>    return totalSynced;<a name="line.911"></a>
-<span class="sourceLineNo">912</span>  }<a name="line.912"></a>
-<span class="sourceLineNo">913</span><a name="line.913"></a>
-<span class="sourceLineNo">914</span>  protected long syncSlots(final FSDataOutputStream stream, final ByteSlot[] slots,<a name="line.914"></a>
-<span class="sourceLineNo">915</span>      final int offset, final int count) throws IOException {<a name="line.915"></a>
-<span class="sourceLineNo">916</span>    long totalSynced = 0;<a name="line.916"></a>
-<span class="sourceLineNo">917</span>    for (int i = 0; i &lt; count; ++i) {<a name="line.917"></a>
-<span class="sourceLineNo">918</span>      final ByteSlot data = slots[offset + i];<a name="line.918"></a>
-<span class="sourceLineNo">919</span>      data.writeTo(stream);<a name="line.919"></a>
-<span class="sourceLineNo">920</span>      totalSynced += data.size();<a name="line.920"></a>
-<span class="sourceLineNo">921</span>    }<a name="line.921"></a>
-<span class="sourceLineNo">922</span><a name="line.922"></a>
-<span class="sourceLineNo">923</span>    syncStream(stream);<a name="line.923"></a>
-<span class="sourceLineNo">924</span>    sendPostSyncSignal();<a name="line.924"></a>
-<span class="sourceLineNo">925</span><a name="line.925"></a>
-<span class="sourceLineNo">926</span>    if (LOG.isTraceEnabled()) {<a name="line.926"></a>
-<span class="sourceLineNo">927</span>      LOG.trace("Sync slots=" + count + '/' + syncMaxSlot +<a name="line.927"></a>
-<span class="sourceLineNo">928</span>                ", flushed=" + StringUtils.humanSize(totalSynced));<a name="line.928"></a>
-<span class="sourceLineNo">929</span>    }<a name="line.929"></a>
-<span class="sourceLineNo">930</span>    return totalSynced;<a name="line.930"></a>
-<span class="sourceLineNo">931</span>  }<a name="line.931"></a>
-<span class="sourceLineNo">932</span><a name="line.932"></a>
-<span class="sourceLineNo">933</span>  protected void syncStream(final FSDataOutputStream stream) throws IOException {<a name="line.933"></a>
-<span class="sourceLineNo">934</span>    if (useHsync) {<a name="line.934"></a>
-<span class="sourceLineNo">935</span>      stream.hsync();<a name="line.935"></a>
-<span class="sourceLineNo">936</span>    } else {<a name="line.936"></a>
-<span class="sourceLineNo">937</span>      stream.hflush();<a name="line.937"></a>
-<span class="sourceLineNo">938</span>    }<a name="line.938"></a>
-<span class="sourceLineNo">939</span>  }<a name="line.939"></a>
-<span class="sourceLineNo">940</span><a name="line.940"></a>
-<span class="sourceLineNo">941</span>  private boolean rollWriterWithRetries() {<a name="line.941"></a>
-<span class="sourceLineNo">942</span>    for (int i = 0; i &lt; rollRetries &amp;&amp; isRunning(); ++i) {<a name="line.942"></a>
-<span class="sourceLineNo">943</span>      if (i &gt; 0) Threads.sleepWithoutInterrupt(waitBeforeRoll * i);<a name="line.943"></a>
-<span class="sourceLineNo">944</span><a name="line.944"></a>
-<span class="sourceLineNo">945</span>      try {<a name="line.945"></a>
-<span class="sourceLineNo">946</span>        if (rollWriter()) {<a name="line.946"></a>
-<span class="sourceLineNo">947</span>          return true;<a name="line.947"></a>
-<span class="sourceLineNo">948</span>        }<a name="line.948"></a>
-<span class="sourceLineNo">949</span>      } catch (IOException e) {<a name="line.949"></a>
-<span class="sourceLineNo">950</span>        LOG.warn("Unable to roll the log, attempt=" + (i + 1), e);<a name="line.950"></a>
-<span class="sourceLineNo">951</span>      }<a name="line.951"></a>
-<span class="sourceLineNo">952</span>    }<a name="line.952"></a>
-<span class="sourceLineNo">953</span>    LOG.error(HBaseMarkers.FATAL, "Unable to roll the log");<a name="line.953"></a>
-<span class="sourceLineNo">954</span>    return false;<a name="line.954"></a>
-<span class="sourceLineNo">955</span>  }<a name="line.955"></a>
-<span class="sourceLineNo">956</span><a name="line.956"></a>
-<span class="sourceLineNo">957</span>  private boolean tryRollWriter() {<a name="line.957"></a>
-<span class="sourceLineNo">958</span>    try {<a name="line.958"></a>
-<span class="sourceLineNo">959</span>      return rollWriter();<a name="line.959"></a>
-<span class="sourceLineNo">960</span>    } catch (IOException e) {<a name="line.960"></a>
-<span class="sourceLineNo">961</span>      LOG.warn("Unable to roll the log", e);<a name="line.961"></a>
-<span class="sourceLineNo">962</span>      return false;<a name="line.962"></a>
-<span class="sourceLineNo">963</span>    }<a name="line.963"></a>
-<span class="sourceLineNo">964</span>  }<a name="line.964"></a>
-<span class="sourceLineNo">965</span><a name="line.965"></a>
-<span class="sourceLineNo">966</span>  public long getMillisToNextPeriodicRoll() {<a name="line.966"></a>
-<span class="sourceLineNo">967</span>    if (lastRollTs.get() &gt; 0 &amp;&amp; periodicRollMsec &gt; 0) {<a name="line.967"></a>
-<span class="sourceLineNo">968</span>      return periodicRollMsec - getMillisFromLastRoll();<a name="line.968"></a>
+<span class="sourceLineNo">822</span><a name="line.822"></a>
+<span class="sourceLineNo">823</span>            waitCond.await(getMillisToNextPeriodicRoll(), TimeUnit.MILLISECONDS);<a name="line.823"></a>
+<span class="sourceLineNo">824</span>            if (slotIndex == 0) {<a name="line.824"></a>
+<span class="sourceLineNo">825</span>              // no data.. probably a stop() or a periodic roll<a name="line.825"></a>
+<span class="sourceLineNo">826</span>              continue;<a name="line.826"></a>
+<span class="sourceLineNo">827</span>            }<a name="line.827"></a>
+<span class="sourceLineNo">828</span>          }<a name="line.828"></a>
+<span class="sourceLineNo">829</span>          // Wait SYNC_WAIT_MSEC or the signal of "slots full" before flushing<a name="line.829"></a>
+<span class="sourceLineNo">830</span>          syncMaxSlot = runningProcCount;<a name="line.830"></a>
+<span class="sourceLineNo">831</span>          assert syncMaxSlot &gt; 0 : "unexpected syncMaxSlot=" + syncMaxSlot;<a name="line.831"></a>
+<span class="sourceLineNo">832</span>          final long syncWaitSt = System.currentTimeMillis();<a name="line.832"></a>
+<span class="sourceLineNo">833</span>          if (slotIndex != syncMaxSlot) {<a name="line.833"></a>
+<span class="sourceLineNo">834</span>            slotCond.await(syncWaitMsec, TimeUnit.MILLISECONDS);<a name="line.834"></a>
+<span class="sourceLineNo">835</span>          }<a name="line.835"></a>
+<span class="sourceLineNo">836</span><a name="line.836"></a>
+<span class="sourceLineNo">837</span>          final long currentTs = System.currentTimeMillis();<a name="line.837"></a>
+<span class="sourceLineNo">838</span>          final long syncWaitMs = currentTs - syncWaitSt;<a name="line.838"></a>
+<span class="sourceLineNo">839</span>          final float rollSec = getMillisFromLastRoll() / 1000.0f;<a name="line.839"></a>
+<span class="sourceLineNo">840</span>          final float syncedPerSec = totalSyncedToStore / rollSec;<a name="line.840"></a>
+<span class="sourceLineNo">841</span>          if (LOG.isTraceEnabled() &amp;&amp; (syncWaitMs &gt; 10 || slotIndex &lt; syncMaxSlot)) {<a name="line.841"></a>
+<span class="sourceLineNo">842</span>            LOG.trace(String.format("Sync wait %s, slotIndex=%s , totalSynced=%s (%s/sec)",<a name="line.842"></a>
+<span class="sourceLineNo">843</span>                      StringUtils.humanTimeDiff(syncWaitMs), slotIndex,<a name="line.843"></a>
+<span class="sourceLineNo">844</span>                      StringUtils.humanSize(totalSyncedToStore),<a name="line.844"></a>
+<span class="sourceLineNo">845</span>                      StringUtils.humanSize(syncedPerSec)));<a name="line.845"></a>
+<span class="sourceLineNo">846</span>          }<a name="line.846"></a>
+<span class="sourceLineNo">847</span><a name="line.847"></a>
+<span class="sourceLineNo">848</span>          // update webui circular buffers (TODO: get rid of allocations)<a name="line.848"></a>
+<span class="sourceLineNo">849</span>          final SyncMetrics syncMetrics = new SyncMetrics();<a name="line.849"></a>
+<span class="sourceLineNo">850</span>          syncMetrics.timestamp = currentTs;<a name="line.850"></a>
+<span class="sourceLineNo">851</span>          syncMetrics.syncWaitMs = syncWaitMs;<a name="line.851"></a>
+<span class="sourceLineNo">852</span>          syncMetrics.syncedEntries = slotIndex;<a name="line.852"></a>
+<span class="sourceLineNo">853</span>          syncMetrics.totalSyncedBytes = totalSyncedToStore;<a name="line.853"></a>
+<span class="sourceLineNo">854</span>          syncMetrics.syncedPerSec = syncedPerSec;<a name="line.854"></a>
+<span class="sourceLineNo">855</span>          syncMetricsQueue.add(syncMetrics);<a name="line.855"></a>
+<span class="sourceLineNo">856</span><a name="line.856"></a>
+<span class="sourceLineNo">857</span>          // sync<a name="line.857"></a>
+<span class="sourceLineNo">858</span>          inSync.set(true);<a name="line.858"></a>
+<span class="sourceLineNo">859</span>          long slotSize = syncSlots();<a name="line.859"></a>
+<span class="sourceLineNo">860</span>          logs.getLast().addToSize(slotSize);<a name="line.860"></a>
+<span class="sourceLineNo">861</span>          totalSyncedToStore = totalSynced.addAndGet(slotSize);<a name="line.861"></a>
+<span class="sourceLineNo">862</span>          slotIndex = 0;<a name="line.862"></a>
+<span class="sourceLineNo">863</span>          inSync.set(false);<a name="line.863"></a>
+<span class="sourceLineNo">864</span>          syncId.incrementAndGet();<a name="line.864"></a>
+<span class="sourceLineNo">865</span>        } catch (InterruptedException e) {<a name="line.865"></a>
+<span class="sourceLineNo">866</span>          Thread.currentThread().interrupt();<a name="line.866"></a>
+<span class="sourceLineNo">867</span>          syncException.compareAndSet(null, e);<a name="line.867"></a>
+<span class="sourceLineNo">868</span>          sendAbortProcessSignal();<a name="line.868"></a>
+<span class="sourceLineNo">869</span>          throw e;<a name="line.869"></a>
+<span class="sourceLineNo">870</span>        } catch (Throwable t) {<a name="line.870"></a>
+<span class="sourceLineNo">871</span>          syncException.compareAndSet(null, t);<a name="line.871"></a>
+<span class="sourceLineNo">872</span>          sendAbortProcessSignal();<a name="line.872"></a>
+<span class="sourceLineNo">873</span>          throw t;<a name="line.873"></a>
+<span class="sourceLineNo">874</span>        } finally {<a name="line.874"></a>
+<span class="sourceLineNo">875</span>          syncCond.signalAll();<a name="line.875"></a>
+<span class="sourceLineNo">876</span>        }<a name="line.876"></a>
+<span class="sourceLineNo">877</span>      }<a name="line.877"></a>
+<span class="sourceLineNo">878</span>    } finally {<a name="line.878"></a>
+<span class="sourceLineNo">879</span>      lock.unlock();<a name="line.879"></a>
+<span class="sourceLineNo">880</span>    }<a name="line.880"></a>
+<span class="sourceLineNo">881</span>  }<a name="line.881"></a>
+<span class="sourceLineNo">882</span><a name="line.882"></a>
+<span class="sourceLineNo">883</span>  public ArrayList&lt;SyncMetrics&gt; getSyncMetrics() {<a name="line.883"></a>
+<span class="sourceLineNo">884</span>    lock.lock();<a name="line.884"></a>
+<span class="sourceLineNo">885</span>    try {<a name="line.885"></a>
+<span class="sourceLineNo">886</span>      return new ArrayList&lt;&gt;(syncMetricsQueue);<a name="line.886"></a>
+<span class="sourceLineNo">887</span>    } finally {<a name="line.887"></a>
+<span class="sourceLineNo">888</span>      lock.unlock();<a name="line.888"></a>
+<span class="sourceLineNo">889</span>    }<a name="line.889"></a>
+<span class="sourceLineNo">890</span>  }<a name="line.890"></a>
+<span class="sourceLineNo">891</span><a name="line.891"></a>
+<span class="sourceLineNo">892</span>  private long syncSlots() throws Throwable {<a name="line.892"></a>
+<span class="sourceLineNo">893</span>    int retry = 0;<a name="line.893"></a>
+<span class="sourceLineNo">894</span>    int logRolled = 0;<a name="line.894"></a>
+<span class="sourceLineNo">895</span>    long totalSynced = 0;<a name="line.895"></a>
+<span class="sourceLineNo">896</span>    do {<a name="line.896"></a>
+<span class="sourceLineNo">897</span>      try {<a name="line.897"></a>
+<span class="sourceLineNo">898</span>        totalSynced = syncSlots(stream, slots, 0, slotIndex);<a name="line.898"></a>
+<span class="sourceLineNo">899</span>        break;<a name="line.899"></a>
+<span class="sourceLineNo">900</span>      } catch (Throwable e) {<a name="line.900"></a>
+<span class="sourceLineNo">901</span>        LOG.warn("unable to sync slots, retry=" + retry);<a name="line.901"></a>
+<span class="sourceLineNo">902</span>        if (++retry &gt;= maxRetriesBeforeRoll) {<a name="line.902"></a>
+<span class="sourceLineNo">903</span>          if (logRolled &gt;= maxSyncFailureRoll &amp;&amp; isRunning()) {<a name="line.903"></a>
+<span class="sourceLineNo">904</span>            LOG.error("Sync slots after log roll failed, abort.", e);<a name="line.904"></a>
+<span class="sourceLineNo">905</span>            throw e;<a name="line.905"></a>
+<span class="sourceLineNo">906</span>          }<a name="line.906"></a>
+<span class="sourceLineNo">907</span><a name="line.907"></a>
+<span class="sourceLineNo">908</span>          if (!rollWriterWithRetries()) {<a name="line.908"></a>
+<span class="sourceLineNo">909</span>            throw e;<a name="line.909"></a>
+<span class="sourceLineNo">910</span>          }<a name="line.910"></a>
+<span class="sourceLineNo">911</span><a name="line.911"></a>
+<span class="sourceLineNo">912</span>          logRolled++;<a name="line.912"></a>
+<span class="sourceLineNo">913</span>          retry = 0;<a name="line.913"></a>
+<span class="sourceLineNo">914</span>        }<a name="line.914"></a>
+<span class="sourceLineNo">915</span>      }<a name="line.915"></a>
+<span class="sourceLineNo">916</span>    } while (isRunning());<a name="line.916"></a>
+<span class="sourceLineNo">917</span>    return totalSynced;<a name="line.917"></a>
+<span class="sourceLineNo">918</span>  }<a name="line.918"></a>
+<span class="sourceLineNo">919</span><a name="line.919"></a>
+<span class="sourceLineNo">920</span>  protected long syncSlots(final FSDataOutputStream stream, final ByteSlot[] slots,<a name="line.920"></a>
+<span class="sourceLineNo">921</span>      final int offset, final int count) throws IOException {<a name="line.921"></a>
+<span class="sourceLineNo">922</span>    long totalSynced = 0;<a name="line.922"></a>
+<span class="sourceLineNo">923</span>    for (int i = 0; i &lt; count; ++i) {<a name="line.923"></a>
+<span class="sourceLineNo">924</span>      final ByteSlot data = slots[offset + i];<a name="line.924"></a>
+<span class="sourceLineNo">925</span>      data.writeTo(stream);<a name="line.925"></a>
+<span class="sourceLineNo">926</span>      totalSynced += data.size();<a name="line.926"></a>
+<span class="sourceLineNo">927</span>    }<a name="line.927"></a>
+<span class="sourceLineNo">928</span><a name="line.928"></a>
+<span class="sourceLineNo">929</span>    syncStream(stream);<a name="line.929"></a>
+<span class="sourceLineNo">930</span>    sendPostSyncSignal();<a name="line.930"></a>
+<span class="sourceLineNo">931</span><a name="line.931"></a>
+<span class="sourceLineNo">932</span>    if (LOG.isTraceEnabled()) {<a name="line.932"></a>
+<span class="sourceLineNo">933</span>      LOG.trace("Sync slots=" + count + '/' + syncMaxSlot +<a name="line.933"></a>
+<span class="sourceLineNo">934</span>                ", flushed=" + StringUtils.humanSize(totalSynced));<a name="line.934"></a>
+<span class="sourceLineNo">935</span>    }<a name="line.935"></a>
+<span class="sourceLineNo">936</span>    return totalSynced;<a name="line.936"></a>
+<span class="sourceLineNo">937</span>  }<a name="line.937"></a>
+<span class="sourceLineNo">938</span><a name="line.938"></a>
+<span class="sourceLineNo">939</span>  protected void syncStream(final FSDataOutputStream stream) throws IOException {<a name="line.939"></a>
+<span class="sourceLineNo">940</span>    if (useHsync) {<a name="line.940"></a>
+<span class="sourceLineNo">941</span>      stream.hsync();<a name="line.941"></a>
+<span class="sourceLineNo">942</span>    } else {<a name="line.942"></a>
+<span class="sourceLineNo">943</span>      stream.hflush();<a name="line.943"></a>
+<span class="sourceLineNo">944</span>    }<a name="line.944"></a>
+<span class="sourceLineNo">945</span>  }<a name="line.945"></a>
+<span class="sourceLineNo">946</span><a name="line.946"></a>
+<span class="sourceLineNo">947</span>  private boolean rollWriterWithRetries() {<a name="line.947"></a>
+<span class="sourceLineNo">948</span>    for (int i = 0; i &lt; rollRetries &amp;&amp; isRunning(); ++i) {<a name="line.948"></a>
+<span class="sourceLineNo">949</span>      if (i &gt; 0) Threads.sleepWithoutInterrupt(waitBeforeRoll * i);<a name="line.949"></a>
+<span class="sourceLineNo">950</span><a name="line.950"></a>
+<span class="sourceLineNo">951</span>      try {<a name="line.951"></a>
+<span class="sourceLineNo">952</span>        if (rollWriter()) {<a name="line.952"></a>
+<span class="sourceLineNo">953</span>          return true;<a name="line.953"></a>
+<span class="sourceLineNo">954</span>        }<a name="line.954"></a>
+<span class="sourceLineNo">955</span>      } catch (IOException e) {<a name="line.955"></a>
+<span class="sourceLineNo">956</span>        LOG.warn("Unable to roll the log, attempt=" + (i + 1), e);<a name="line.956"></a>
+<span class="sourceLineNo">957</span>      }<a name="line.957"></a>
+<span class="sourceLineNo">958</span>    }<a name="line.958"></a>
+<span class="sourceLineNo">959</span>    LOG.error(HBaseMarkers.FATAL, "Unable to roll the log");<a name="line.959"></a>
+<span class="sourceLineNo">960</span>    return false;<a name="line.960"></a>
+<span class="sourceLineNo">961</span>  }<a name="line.961"></a>
+<span class="sourceLineNo">962</span><a name="line.962"></a>
+<span class="sourceLineNo">963</span>  private boolean tryRollWriter() {<a name="line.963"></a>
+<span class="sourceLineNo">964</span>    try {<a name="line.964"></a>
+<span class="sourceLineNo">965</span>      return rollWriter();<a name="line.965"></a>
+<span class="sourceLineNo">966</span>    } catch (IOException e) {<a name="line.966"></a>
+<span class="sourceLineNo">967</span>      LOG.warn("Unable to roll the log", e);<a name="line.967"></a>
+<span class="sourceLineNo">968</span>      return false;<a name="line.968"></a>
 <span class="sourceLineNo">969</span>    }<a name="line.969"></a>
-<span class="sourceLineNo">970</span>    return Long.MAX_VALUE;<a name="line.970"></a>
-<span class="sourceLineNo">971</span>  }<a name="line.971"></a>
-<span class="sourceLineNo">972</span><a name="line.972"></a>
-<span class="sourceLineNo">973</span>  public long getMillisFromLastRoll() {<a name="line.973"></a>
-<span class="sourceLineNo">974</span>    return (System.currentTimeMillis() - lastRollTs.get());<a name="line.974"></a>
-<span class="sourceLineNo">975</span>  }<a name="line.975"></a>
-<span class="sourceLineNo">976</span><a name="line.976"></a>
-<span class="sourceLineNo">977</span>  @VisibleForTesting<a name="line.977"></a>
-<span class="sourceLineNo">978</span>  void periodicRollForTesting() throws IOException {<a name="line.978"></a>
-<span class="sourceLineNo">979</span>    lock.lock();<a name="line.979"></a>
-<span class="sourceLineNo">980</span>    try {<a name="line.980"></a>
-<span class="sourceLineNo">981</span>      periodicRoll();<a name="line.981"></a>
-<span class="sourceLineNo">982</span>    } finally {<a name="line.982"></a>
-<span class="sourceLineNo">983</span>      lock.unlock();<a name="line.983"></a>
-<span class="sourceLineNo">984</span>    }<a name="line.984"></a>
-<span class="sourceLineNo">985</span>  }<a name="line.985"></a>
-<span class="sourceLineNo">986</span><a name="line.986"></a>
-<span class="sourceLineNo">987</span>  @VisibleForTesting<a name="line.987"></a>
-<span class="sourceLineNo">988</span>  public boolean rollWriterForTesting() throws IOException {<a name="line.988"></a>
-<span class="sourceLineNo">989</span>    lock.lock();<a name="line.989"></a>
-<span class="sourceLineNo">990</span>    try {<a name="line.990"></a>
-<span class="sourceLineNo">991</span>      return rollWriter();<a name="line.991"></a>
-<span class="sourceLineNo">992</span>    } finally {<a name="line.992"></a>
-<span class="sourceLineNo">993</span>      lock.unlock();<a name="line.993"></a>
-<span class="sourceLineNo">994</span>    }<a name="line.994"></a>
-<span class="sourceLineNo">995</span>  }<a name="line.995"></a>
-<span class="sourceLineNo">996</span><a name="line.996"></a>
-<span class="sourceLineNo">997</span>  @VisibleForTesting<a name="line.997"></a>
-<span class="sourceLineNo">998</span>  void removeInactiveLogsForTesting() throws Exception {<a name="line.998"></a>
-<span class="sourceLineNo">999</span>    lock.lock();<a name="line.999"></a>
-<span class="sourceLineNo">1000</span>    try {<a name="line.1000"></a>
-<span class="sourceLineNo">1001</span>      removeInactiveLogs();<a name="line.1001"></a>
-<span class="sourceLineNo">1002</span>    } finally  {<a name="line.1002"></a>
-<span class="sourceLineNo">1003</span>      lock.unlock();<a name="line.1003"></a>
-<span class="sourceLineNo">1004</span>    }<a name="line.1004"></a>
-<span class="sourceLineNo">1005</span>  }<a name="line.1005"></a>
-<span class="sourceLineNo">1006</span><a name="line.1006"></a>
-<span class="sourceLineNo">1007</span>  private void periodicRoll() throws IOException {<a name="line.1007"></a>
-<span class="sourceLineNo">1008</span>    if (storeTracker.isEmpty()) {<a name="line.1008"></a>
-<span class="sourceLineNo">1009</span>      LOG.trace("no active procedures");<a name="line.1009"></a>
-<span class="sourceLineNo">1010</span>      tryRollWriter();<a name="line.1010"></a>
-<span class="sourceLineNo">1011</span>      removeAllLogs(flushLogId - 1, "no active procedures");<a name="line.1011"></a>
-<span class="sourceLineNo">1012</span>    } else {<a name="line.1012"></a>
-<span class="sourceLineNo">1013</span>      if (storeTracker.isAllModified()) {<a name="line.1013"></a>
-<span class="sourceLineNo">1014</span>        LOG.trace("all the active procedures are in the latest log");<a name="line.1014"></a>
-<span class="sourceLineNo">1015</span>        removeAllLogs(flushLogId - 1, "all the active procedures are in the latest log");<a name="line.1015"></a>
-<span class="sourceLineNo">1016</span>      }<a name="line.1016"></a>
-<span class="sourceLineNo">1017</span><a name="line.1017"></a>
-<span class="sourceLineNo">1018</span>      // if the log size has exceeded the roll threshold<a name="line.1018"></a>
-<span class="sourceLineNo">1019</span>      // or the periodic roll timeout is expired, try to roll the wal.<a name="line.1019"></a>
-<span class="sourceLineNo">1020</span>      if (totalSynced.get() &gt; rollThreshold || getMillisToNextPeriodicRoll() &lt;= 0) {<a name="line.1020"></a>
-<span class="sourceLineNo">1021</span>        tryRollWriter();<a name="line.1021"></a>
+<span class="sourceLineNo">970</span>  }<a name="line.970"></a>
+<span class="sourceLineNo">971</span><a name="line.971"></a>
+<span class="sourceLineNo">972</span>  public long getMillisToNextPeriodicRoll() {<a name="line.972"></a>
+<span class="sourceLineNo">973</span>    if (lastRollTs.get() &gt; 0 &amp;&amp; periodicRollMsec &gt; 0) {<a name="line.973"></a>
+<span class="sourceLineNo">974</span>      return periodicRollMsec - getMillisFromLastRoll();<a name="line.974"></a>
+<span class="sourceLineNo">975</span>    }<a name="line.975"></a>
+<span class="sourceLineNo">976</span>    return Long.MAX_VALUE;<a name="line.976"></a>
+<span class="sourceLineNo">977</span>  }<a name="line.977"></a>
+<span class="sourceLineNo">978</span><a name="line.978"></a>
+<span class="sourceLineNo">979</span>  public long getMillisFromLastRoll() {<a name="line.979"></a>
+<span class="sourceLineNo">980</span>    return (System.currentTimeMillis() - lastRollTs.get());<a name="line.980"></a>
+<span class="sourceLineNo">981</span>  }<a name="line.981"></a>
+<span class="sourceLineNo">982</span><a name="line.982"></a>
+<span class="sourceLineNo">983</span>  @VisibleForTesting<a name="line.983"></a>
+<span class="sourceLineNo">984</span>  void periodicRollForTesting() throws IOException {<a name="line.984"></a>
+<span class="sourceLineNo">985</span>    lock.lock();<a name="line.985"></a>
+<span class="sourceLineNo">986</span>    try {<a name="line.986"></a>
+<span class="sourceLineNo">987</span>      periodicRoll();<a name="line.987"></a>
+<span class="sourceLineNo">988</span>    } finally {<a name="line.988"></a>
+<span class="sourceLineNo">989</span>      lock.unlock();<a name="line.989"></a>
+<span class="sourceLineNo">990</span>    }<a name="line.990"></a>
+<span class="sourceLineNo">991</span>  }<a name="line.991"></a>
+<span class="sourceLineNo">992</span><a name="line.992"></a>
+<span class="sourceLineNo">993</span>  @VisibleForTesting<a name="line.993"></a>
+<span class="sourceLineNo">994</span>  public boolean rollWriterForTesting() throws IOException {<a name="line.994"></a>
+<span class="sourceLineNo">995</span>    lock.lock();<a name="line.995"></a>
+<span class="sourceLineNo">996</span>    try {<a name="line.996"></a>
+<span class="sourceLineNo">997</span>      return rollWriter();<a name="line.997"></a>
+<span class="sourceLineNo">998</span>    } finally {<a name="line.998"></a>
+<span class="sourceLineNo">999</span>      lock.unlock();<a name="line.999"></a>
+<span class="sourceLineNo">1000</span>    }<a name="line.1000"></a>
+<span class="sourceLineNo">1001</span>  }<a name="line.1001"></a>
+<span class="sourceLineNo">1002</span><a name="line.1002"></a>
+<span class="sourceLineNo">1003</span>  @VisibleForTesting<a name="line.1003"></a>
+<span class="sourceLineNo">1004</span>  void removeInactiveLogsForTesting() throws Exception {<a name="line.1004"></a>
+<span class="sourceLineNo">1005</span>    lock.lock();<a name="line.1005"></a>
+<span class="sourceLineNo">1006</span>    try {<a name="line.1006"></a>
+<span class="sourceLineNo">1007</span>      removeInactiveLogs();<a name="line.1007"></a>
+<span class="sourceLineNo">1008</span>    } finally  {<a name="line.1008"></a>
+<span class="sourceLineNo">1009</span>      lock.unlock();<a name="line.1009"></a>
+<span class="sourceLineNo">1010</span>    }<a name="line.1010"></a>
+<span class="sourceLineNo">1011</span>  }<a name="line.1011"></a>
+<span class="sourceLineNo">1012</span><a name="line.1012"></a>
+<span class="sourceLineNo">1013</span>  private void periodicRoll() throws IOException {<a name="line.1013"></a>
+<span class="sourceLineNo">1014</span>    if (storeTracker.isEmpty()) {<a name="line.1014"></a>
+<span class="sourceLineNo">1015</span>      LOG.trace("no active procedures");<a name="line.1015"></a>
+<span class="sourceLineNo">1016</span>      tryRollWriter();<a name="line.1016"></a>
+<span class="sourceLineNo">1017</span>      removeAllLogs(flushLogId - 1, "no active procedures");<a name="line.1017"></a>
+<span class="sourceLineNo">1018</span>    } else {<a name="line.1018"></a>
+<span class="sourceLineNo">1019</span>      if (storeTracker.isAllModified()) {<a name="line.1019"></a>
+<span class="sourceLineNo">1020</span>        LOG.trace("all the active procedures are in the latest log");<a name="line.1020"></a>
+<span class="sourceLineNo">1021</span>        removeAllLogs(flushLogId - 1, "all the active procedures are in the latest log");<a name="line.1021"></a>
 <span class="sourceLineNo">1022</span>      }<a name="line.1022"></a>
 <span class="sourceLineNo">1023</span><a name="line.1023"></a>
-<span class="sourceLineNo">1024</span>      removeInactiveLogs();<a name="line.1024"></a>
-<span class="sourceLineNo">1025</span>    }<a name="line.1025"></a>
-<span class="sourceLineNo">1026</span>  }<a name="line.1026"></a>
-<span class="sourceLineNo">1027</span><a name="line.1027"></a>
-<span class="sourceLineNo">1028</span>  private boolean rollWriter() throws IOException {<a name="line.1028"></a>
-<span class="sourceLineNo">1029</span>    if (!isRunning()) {<a name="line.1029"></a>
-<span class="sourceLineNo">1030</span>      return false;<a name="line.1030"></a>
+<span class="sourceLineNo">1024</span>      // if the log size has exceeded the roll threshold<a name="line.1024"></a>
+<span class="sourceLineNo">1025</span>      // or the periodic roll timeout is expired, try to roll the wal.<a name="line.1025"></a>
+<span class="sourceLineNo">1026</span>      if (totalSynced.get() &gt; rollThreshold || getMillisToNextPeriodicRoll() &lt;= 0) {<a name="line.1026"></a>
+<span class="sourceLineNo">1027</span>        tryRollWriter();<a name="line.1027"></a>
+<span class="sourceLineNo">1028</span>      }<a name="line.1028"></a>
+<span class="sourceLineNo">1029</span><a name="line.1029"></a>
+<span class="sourceLineNo">1030</span>      removeInactiveLogs();<a name="line.1030"></a>
 <span class="sourceLineNo">1031</span>    }<a name="line.1031"></a>
-<span class="sourceLineNo">1032</span><a name="line.1032"></a>
-<span class="sourceLineNo">1033</span>    // Create new state-log<a name="line.1033"></a>
-<span class="sourceLineNo">1034</span>    if (!rollWriter(flushLogId + 1)) {<a name="line.1034"></a>
-<span class="sourceLineNo">1035</span>      LOG.warn("someone else has already created log {}", flushLogId);<a name="line.1035"></a>
+<span class="sourceLineNo">1032</span>  }<a name="line.1032"></a>
+<span class="sourceLineNo">1033</span><a name="line.1033"></a>
+<span class="sourceLineNo">1034</span>  private boolean rollWriter() throws IOException {<a name="line.1034"></a>
+<span class="sourceLineNo">1035</span>    if (!isRunning()) {<a name="line.1035"></a>
 <span class="sourceLineNo">1036</span>      return false;<a name="line.1036"></a>
 <span class="sourceLineNo">1037</span>    }<a name="line.1037"></a>
 <span class="sourceLineNo">1038</span><a name="line.1038"></a>
-<span class="sourceLineNo">1039</span>    // We have the lease on the log,<a name="line.1039"></a>
-<span class="sourceLineNo">1040</span>    // but we should check if someone else has created new files<a name="line.1040"></a>
-<span class="sourceLineNo">1041</span>    if (getMaxLogId(getLogFiles()) &gt; flushLogId) {<a name="line.1041"></a>
-<span class="sourceLineNo">1042</span>      LOG.warn("Someone else created new logs. Expected maxLogId &lt; {}", flushLogId);<a name="line.1042"></a>
-<span class="sourceLineNo">1043</span>      logs.getLast().removeFile(this.walArchiveDir);<a name="line.1043"></a>
-<span class="sourceLineNo">1044</span>      return false;<a name="line.1044"></a>
-<span class="sourceLineNo">1045</span>    }<a name="line.1045"></a>
-<span class="sourceLineNo">1046</span><a name="line.1046"></a>
-<span class="sourceLineNo">1047</span>    // We have the lease on the log<a name="line.1047"></a>
-<span class="sourceLineNo">1048</span>    return true;<a name="line.1048"></a>
-<span class="sourceLineNo">1049</span>  }<a name="line.1049"></a>
-<span class="sourceLineNo">1050</span><a name="line.1050"></a>
-<span class="sourceLineNo">1051</span>  @VisibleForTesting<a name="line.1051"></a>
-<span class="sourceLineNo">1052</span>  boolean rollWriter(long logId) throws IOException {<a name="line.1052"></a>
-<span class="sourceLineNo">1053</span>    assert logId &gt; flushLogId : "logId=" + logId + " flushLogId=" + flushLogId;<a name="line.1053"></a>
-<span class="sourceLineNo">1054</span>    assert lock.isHeldByCurrentThread() : "expected to be the lock owner. " + lock.isLocked();<a name="line.1054"></a>
-<span class="sourceLineNo">1055</span><a name="line.1055"></a>
-<span class="sourceLineNo">1056</span>    ProcedureWALHeader header = ProcedureWALHeader.newBuilder()<a name="line.1056"></a>
-<span class="sourceLineNo">1057</span>      .setVersion(ProcedureWALFormat.HEADER_VERSION)<a name="line.1057"></a>
-<span class="sourceLineNo">1058</span>      .setType(ProcedureWALFormat.LOG_TYPE_STREAM)<a name="line.1058"></a>
-<span class="sourceLineNo">1059</span>      .setMinProcId(storeTracker.getActiveMinProcId())<a name="line.1059"></a>
-<span class="sourceLineNo">1060</span>      .setLogId(logId)<a name="line.1060"></a>
-<span class="sourceLineNo">1061</span>      .build();<a name="line.1061"></a>
-<span class="sourceLineNo">1062</span><a name="line.1062"></a>
-<span class="sourceLineNo">1063</span>    FSDataOutputStream newStream = null;<a name="line.1063"></a>
-<span class="sourceLineNo">1064</span>    Path newLogFile = null;<a name="line.1064"></a>
-<span class="sourceLineNo">1065</span>    long startPos = -1;<a name="line.1065"></a>
-<span class="sourceLineNo">1066</span>    newLogFile = getLogFilePath(logId);<a name="line.1066"></a>
-<span class="sourceLineNo">1067</span>    try {<a name="line.1067"></a>
-<span class="sourceLineNo">1068</span>      newStream = CommonFSUtils.createForWal(fs, newLogFile, false);<a name="line.1068"></a>
-<span class="sourceLineNo">1069</span>    } catch (FileAlreadyExistsException e) {<a name="line.1069"></a>
-<span class="sourceLineNo">1070</span>      LOG.error("Log file with id={} already exists", logId, e);<a name="line.1070"></a>
-<span class="sourceLineNo">1071</span>      return false;<a name="line.1071"></a>
-<span class="sourceLineNo">1072</span>    } catch (RemoteException re) {<a name="line.1072"></a>
-<span class="sourceLineNo">1073</span>      LOG.warn("failed to create log file with id={}", logId, re);<a name="line.1073"></a>
-<span class="sourceLineNo">1074</span>      return false;<a name="line.1074"></a>
-<span class="sourceLineNo">1075</span>    }<a name="line.1075"></a>
-<span class="sourceLineNo">1076</span>    // After we create the stream but before we attempt to use it at all<a name="line.1076"></a>
-<span class="sourceLineNo">1077</span>    // ensure that we can provide the level of data safety we're configured<a name="line.1077"></a>
-<span class="sourceLineNo">1078</span>    // to provide.<a name="line.1078"></a>
-<span class="sourceLineNo">1079</span>    final String durability = useHsync ? "hsync" : "hflush";<a name="line.1079"></a>
-<span class="sourceLineNo">1080</span>    if (enforceStreamCapability &amp;&amp; !(CommonFSUtils.hasCapability(newStream, durability))) {<a name="line.1080"></a>
-<span class="sourceLineNo">1081</span>        throw new IllegalStateException("The procedure WAL relies on the ability to " + durability +<a name="line.1081"></a>
-<span class="sourceLineNo">1082</span>          " for proper operation during component failures, but the underlying filesystem does " +<a name="line.1082"></a>
-<span class="sourceLineNo">1083</span>          "not support doing so. Please check the config value of '" + USE_HSYNC_CONF_KEY +<a name="line.1083"></a>
-<span class="sourceLineNo">1084</span>          "' to set the desired level of robustness and ensure the config value of '" +<a name="line.1084"></a>
-<span class="sourceLineNo">1085</span>          CommonFSUtils.HBASE_WAL_DIR + "' points to a FileSystem mount that can provide it.");<a name="line.1085"></a>
-<span class="sourceLineNo">1086</span>    }<a name="line.1086"></a>
-<span class="sourceLineNo">1087</span>    try {<a name="line.1087"></a>
-<span class="sourceLineNo">1088</span>      ProcedureWALFormat.writeHeader(newStream, header);<a name="line.1088"></a>
-<span class="sourceLineNo">1089</span>      startPos = newStream.getPos();<a name="line.1089"></a>
-<span class="sourceLineNo">1090</span>    } catch (IOException ioe) {<a name="line.1090"></a>
-<span class="sourceLineNo">1091</span>      LOG.warn("Encountered exception writing header", ioe);<a name="line.1091"></a>
-<span class="sourceLineNo">1092</span>      newStream.close();<a name="line.1092"></a>
-<span class="sourceLineNo">1093</span>      return false;<a name="line.1093"></a>
-<span class="sourceLineNo">1094</span>    }<a name="line.1094"></a>
-<span class="sourceLineNo">1095</span><a name="line.1095"></a>
-<span class="sourceLineNo">1096</span>    closeCurrentLogStream(false);<a name="line.1096"></a>
-<span class="sourceLineNo">1097</span><a name="line.1097"></a>
-<span class="sourceLineNo">1098</span>    storeTracker.resetModified();<a name="line.1098"></a>
-<span class="sourceLineNo">1099</span>    stream = newStream;<a name="line.1099"></a>
-<span class="sourceLineNo">1100</span>    flushLogId = logId;<a name="line.1100"></a>
-<span class="sourceLineNo">1101</span>    totalSynced.set(0);<a name="line.1101"></a>
-<span class="sourceLineNo">1102</span>    long rollTs = System.currentTimeMillis();<a name="line.1102"></a>
-<span class="sourceLineNo">1103</span>    lastRollTs.set(rollTs);<a name="line.1103"></a>
-<span class="sourceLineNo">1104</span>    logs.add(new ProcedureWALFile(fs, newLogFile, header, startPos, rollTs));<a name="line.1104"></a>
-<span class="sourceLineNo">1105</span><a name="line.1105"></a>
-<span class="sourceLineNo">1106</span>    // if it's the first next WAL being added, build the holding cleanup tracker<a name="line.1106"></a>
-<span class="sourceLineNo">1107</span>    if (logs.size() == 2) {<a name="line.1107"></a>
-<span class="sourceLineNo">1108</span>      buildHoldingCleanupTracker();<a name="line.1108"></a>
-<span class="sourceLineNo">1109</span>    } else if (logs.size() &gt; walCountWarnThreshold) {<a name="line.1109"></a>
-<span class="sourceLineNo">1110</span>      LOG.warn("procedure WALs count={} above the warning threshold {}. check running procedures" +<a name="line.1110"></a>
-<span class="sourceLineNo">1111</span>        " to see if something is stuck.", logs.size(), walCountWarnThreshold);<a name="line.1111"></a>
-<span class="sourceLineNo">1112</span>      // This is just like what we have done at RS side when there are too many wal files. For RS,<a name="line.1112"></a>
-<span class="sourceLineNo">1113</span>      // if there are too many wal files, we will find out the wal entries in the oldest file, and<a name="line.1113"></a>
-<span class="sourceLineNo">1114</span>      // tell the upper layer to flush these regions so the wal entries will be useless and then we<a name="line.1114"></a>
-<span class="sourceLineNo">1115</span>      // can delete the wal file. For WALProcedureStore, the assumption is that, if all the<a name="line.1115"></a>
-<span class="sourceLineNo">1116</span>      // procedures recorded in a proc wal file are modified or deleted in a new proc wal file, then<a name="line.1116"></a>
-<span class="sourceLineNo">1117</span>      // we are safe to delete it. So here if there are too many proc wal files, we will find out<a name="line.1117"></a>
-<span class="sourceLineNo">1118</span>      // the procedure ids in the oldest file, which are neither modified nor deleted in newer proc<a name="line.1118"></a>
-<span class="sourceLineNo">1119</span>      // wal files, and tell upper layer to update the state of these procedures to the newest proc<a name="line.1119"></a>
-<span class="sourceLineNo">1120</span>      // wal file(by calling ProcedureStore.update), then we are safe to delete the oldest proc wal<a name="line.1120"></a>
-<span class="sourceLineNo">1121</span>      // file.<a name="line.1121"></a>
-<span class="sourceLineNo">1122</span>      sendForceUpdateSignal(holdingCleanupTracker.getAllActiveProcIds());<a name="line.1122"></a>
-<span class="sourceLineNo">1123</span>    }<a name="line.1123"></a>
-<span class="sourceLineNo">1124</span><a name="line.1124"></a>
-<span class="sourceLineNo">1125</span>    LOG.info("Rolled new Procedure Store WAL, id={}", logId);<a name="line.1125"></a>
-<span class="sourceLineNo">1126</span>    return true;<a name="line.1126"></a>
-<span class="sourceLineNo">1127</span>  }<a name="line.1127"></a>
-<span class="sourceLineNo">1128</span><a name="line.1128"></a>
-<span class="sourceLineNo">1129</span>  private void closeCurrentLogStream(boolean abort) {<a name="line.1129"></a>
-<span class="sourceLineNo">1130</span>    if (stream == null || logs.isEmpty()) {<a name="line.1130"></a>
-<span class="sourceLineNo">1131</span>      return;<a name="line.1131"></a>
-<span class="sourceLineNo">1132</span>    }<a name="line.1132"></a>
-<span class="sourceLineNo">1133</span><a name="line.1133"></a>
-<span class="sourceLineNo">1134</span>    try {<a name="line.1134"></a>
-<span class="sourceLineNo">1135</span>      ProcedureWALFile log = logs.getLast();<a name="line.1135"></a>
-<span class="sourceLineNo">1136</span>      log.setProcIds(storeTracker.getModifiedMinProcId(), storeTracker.getModifiedMaxProcId());<a name="line.1136"></a>
-<span class="sourceLineNo">1137</span>      log.updateLocalTracker(storeTracker);<a name="line.1137"></a>
-<span class="sourceLineNo">1138</span>      if (!abort) {<a name="line.1138"></a>
-<span class="sourceLineNo">1139</span>        long trailerSize = ProcedureWALFormat.writeTrailer(stream, storeTracker);<a name="line.1139"></a>
-<span class="sourceLineNo">1140</span>        log.addToSize(trailerSize);<a name="line.1140"></a>
-<span class="sourceLineNo">1141</span>      }<a name="line.1141"></a>
-<span class="sourceLineNo">1142</span>    } catch (IOException e) {<a name="line.1142"></a>
-<span class="sourceLineNo">1143</span>      LOG.warn("Unable to write the trailer", e);<a name="line.1143"></a>
-<span class="sourceLineNo">1144</span>    }<a name="line.1144"></a>
-<span class="sourceLineNo">1145</span>    try {<a name="line.1145"></a>
-<span class="sourceLineNo">1146</span>      stream.close();<a name="line.1146"></a>
-<span class="sourceLineNo">1147</span>    } catch (IOException e) {<a name="line.1147"></a>
-<span class="sourceLineNo">1148</span>      LOG.error("Unable to close the stream", e);<a name="line.1148"></a>
-<span class="sourceLineNo">1149</span>    }<a name="line.1149"></a>
-<span class="sourceLineNo">1150</span>    stream = null;<a name="line.1150"></a>
-<span class="sourceLineNo">1151</span>  }<a name="line.1151"></a>
-<span class="sourceLineNo">1152</span><a name="line.1152"></a>
-<span class="sourceLineNo">1153</span>  // ==========================================================================<a name="line.1153"></a>
-<span class="sourceLineNo">1154</span>  //  Log Files cleaner helpers<a name="line.1154"></a>
-<span class="sourceLineNo">1155</span>  // ==========================================================================<a name="line.1155"></a>
-<span class="sourceLineNo">1156</span>  private void removeInactiveLogs() throws IOException {<a name="line.1156"></a>
-<span class="sourceLineNo">1157</span>    // We keep track of which procedures are holding the oldest WAL in 'holdingCleanupTracker'.<a name="line.1157"></a>
-<span class="sourceLineNo">1158</span>    // once there is nothing olding the oldest WAL we can remove it.<a name="line.1158"></a>
-<span class="sourceLineNo">1159</span>    while (logs.size() &gt; 1 &amp;&amp; holdingCleanupTracker.isEmpty()) {<a name="line.1159"></a>
-<span class="sourceLineNo">1160</span>      LOG.info("Remove the oldest log {}", logs.getFirst());<a name="line.1160"></a>
-<span class="sourceLineNo">1161</span>      removeLogFile(logs.getFirst(), walArchiveDir);<a name="line.1161"></a>
-<span class="sourceLineNo">1162</span>      buildHoldingCleanupTracker();<a name="line.1162"></a>
-<span class="sourceLineNo">1163</span>    }<a name="line.1163"></a>
-<span class="sourceLineNo">1164</span><a name="line.1164"></a>
-<span class="sourceLineNo">1165</span>    // TODO: In case we are holding up a lot of logs for long time we should<a name="line.1165"></a>
-<span class="sourceLineNo">1166</span>    // rewrite old procedures (in theory parent procs) to the new WAL.<a name="line.1166"></a>
-<span class="sourceLineNo">1167</span>  }<a name="line.1167"></a>
-<span class="sourceLineNo">1168</span><a name="line.1168"></a>
-<span class="sourceLineNo">1169</span>  private void buildHoldingCleanupTracker() {<a name="line.1169"></a>
-<span class="sourceLineNo">1170</span>    if (logs.size() &lt;= 1) {<a name="line.1170"></a>
-<span class="sourceLineNo">1171</span>      // we only have one wal, so nothing to do<a name="line.1171"></a>
-<span class="sourceLineNo">1172</span>      holdingCleanupTracker.reset();<a name="line.1172"></a>
-<span class="sourceLineNo">1173</span>      return;<a name="line.1173"></a>
-<span class="sourceLineNo">1174</span>    }<a name="line.1174"></a>
-<span class="sourceLineNo">1175</span><a name="line.1175"></a>
-<span class="sourceLineNo">1176</span>    // compute the holding tracker.<a name="line.1176"></a>
-<span class="sourceLineNo">1177</span>    // - the first WAL is used for the 'updates'<a name="line.1177"></a>
-<span class="sourceLineNo">1178</span>    // - the global tracker will be used to determine whether a procedure has been deleted<a name="line.1178"></a>
-<span class="sourceLineNo">1179</span>    // - other trackers will be used to determine whether a procedure has been updated, as a deleted<a name="line.1179"></a>
-<span class="sourceLineNo">1180</span>    // procedure can always be detected by checking the global tracker, we can save the deleted<a name="line.1180"></a>
-<span class="sourceLineNo">1181</span>    // checks when applying other trackers<a name="line.1181"></a>
-<span class="sourceLineNo">1182</span>    holdingCleanupTracker.resetTo(logs.getFirst().getTracker(), true);<a name="line.1182"></a>
-<span class="sourceLineNo">1183</span>    holdingCleanupTracker.setDeletedIfDeletedByThem(storeTracker);<a name="line.1183"></a>
-<span class="sourceLineNo&