http://git-wip-us.apache.org/repos/asf/hbase-site/blob/804782f0/devapidocs/org/apache/hadoop/hbase/procedure2/Procedure.html ---------------------------------------------------------------------- diff --git a/devapidocs/org/apache/hadoop/hbase/procedure2/Procedure.html b/devapidocs/org/apache/hadoop/hbase/procedure2/Procedure.html index 4c6f707..19a9ffb 100644 --- a/devapidocs/org/apache/hadoop/hbase/procedure2/Procedure.html +++ b/devapidocs/org/apache/hadoop/hbase/procedure2/Procedure.html @@ -18,7 +18,7 @@ catch(err) { } //--> -var methods = {"i0":6,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":6,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":6,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":9,"i24":10,"i25":10,"i26":9,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10,"i36":10,"i37":10,"i38":10,"i39":9,"i40":10,"i41":10,"i42":10,"i43":10,"i44":10,"i45":10,"i46":10,"i47":10,"i48":10,"i49":10,"i50":10,"i51":6,"i52":6,"i53":10,"i54":10,"i55":10,"i56":10,"i57":10,"i58":10,"i59":10,"i60":10,"i61":10,"i62":10,"i63":10,"i64":10,"i65":10,"i66":10,"i67":10,"i68":10,"i69":10,"i70":10,"i71":10,"i72":10,"i73":10,"i74":10,"i75":10,"i76":10,"i77":10,"i78":10,"i79":10,"i80":10,"i81":10}; +var methods = {"i0":6,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":6,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":6,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":9,"i24":10,"i25":10,"i26":9,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10,"i36":10,"i37":10,"i38":10,"i39":9,"i40":10,"i41":10,"i42":10,"i43":10,"i44":10,"i45":10,"i46":10,"i47":10,"i48":10,"i49":10,"i50":10,"i51":10,"i52":10,"i53":6,"i54":6,"i55":10,"i56":10,"i57":10,"i58":10,"i59":10,"i60":10,"i61":10,"i62":10,"i63":10,"i64":10,"i65":10,"i66":10,"i67":10,"i68":10,"i69":10,"i70":10,"i71":10,"i72":10,"i73":10,"i74":10,"i75":10,"i76":10,"i77":10,"i78":10,"i79":10,"i80":10,"i81":10,"i82":10,"i83":10,"i84":10}; var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; @@ -118,60 +118,78 @@ var activeTableTab = "activeTableTab"; <hr> <br> <pre>@InterfaceAudience.Private - @InterfaceStability.Evolving -public abstract class <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.95">Procedure</a><TEnvironment> +public abstract class <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.113">Procedure</a><TEnvironment> extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2">Procedure</a><TEnvironment>></pre> -<div class="block">Base Procedure class responsible for Procedure Metadata; - e.g. state, submittedTime, lastUpdate, stack-indexes, etc. - - <p>Procedures are run by a <a href="../../../../../org/apache/hadoop/hbase/procedure2/ProcedureExecutor.html" title="class in org.apache.hadoop.hbase.procedure2"><code>ProcedureExecutor</code></a> instance. They are submitted and then - the ProcedureExecutor keeps calling <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#execute-TEnvironment-"><code>execute(Object)</code></a> until the Procedure is done. - Execute may be called multiple times in the case of failure or a restart, so code must be - idempotent. The return from an execute call is either: null to indicate we are done; - ourself if there is more to do; or, a set of sub-procedures that need to - be run to completion before the framework resumes our execution. - - <p>The ProcedureExecutor keeps its - notion of Procedure State in the Procedure itself; e.g. it stamps the Procedure as INITIALIZING, - RUNNABLE, SUCCESS, etc. Here are some of the States defined in the ProcedureState enum from - protos: -<ul> - <li><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#isFailed--"><code>isFailed()</code></a> A procedure has executed at least once and has failed. The procedure - may or may not have rolled back yet. Any procedure in FAILED state will be eventually moved - to ROLLEDBACK state.</li> - +<div class="block">Base Procedure class responsible for Procedure Metadata; e.g. state, submittedTime, lastUpdate, + stack-indexes, etc. + <p/> + Procedures are run by a <a href="../../../../../org/apache/hadoop/hbase/procedure2/ProcedureExecutor.html" title="class in org.apache.hadoop.hbase.procedure2"><code>ProcedureExecutor</code></a> instance. They are submitted and then the + ProcedureExecutor keeps calling <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#execute-TEnvironment-"><code>execute(Object)</code></a> until the Procedure is done. Execute may + be called multiple times in the case of failure or a restart, so code must be idempotent. The + return from an execute call is either: null to indicate we are done; ourself if there is more to + do; or, a set of sub-procedures that need to be run to completion before the framework resumes + our execution. + <p/> + The ProcedureExecutor keeps its notion of Procedure State in the Procedure itself; e.g. it stamps + the Procedure as INITIALIZING, RUNNABLE, SUCCESS, etc. Here are some of the States defined in the + ProcedureState enum from protos: + <ul> + <li><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#isFailed--"><code>isFailed()</code></a> A procedure has executed at least once and has failed. The procedure may + or may not have rolled back yet. Any procedure in FAILED state will be eventually moved to + ROLLEDBACK state.</li> <li><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#isSuccess--"><code>isSuccess()</code></a> A procedure is completed successfully without exception.</li> - <li><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#isFinished--"><code>isFinished()</code></a> As a procedure in FAILED state will be tried forever for rollback, only condition when scheduler/ executor will drop procedure from further processing is when procedure state is ROLLEDBACK or isSuccess() returns true. This is a terminal state of the procedure.</li> - <li><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#isWaiting--"><code>isWaiting()</code></a> - Procedure is in one of the two waiting states (<code>ProcedureProtos.ProcedureState.WAITING</code>, <code>ProcedureProtos.ProcedureState.WAITING_TIMEOUT</code>).</li> -</ul> - NOTE: These states are of the ProcedureExecutor. Procedure implementations in turn can keep - their own state. This can lead to confusion. Try to keep the two distinct. - - <p>rollback() is called when the procedure or one of the sub-procedures - has failed. The rollback step is supposed to cleanup the resources created - during the execute() step. In case of failure and restart, rollback() may be - called multiple times, so again the code must be idempotent. - - <p>Procedure can be made respect a locking regime. It has acquire/release methods as - well as an <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#hasLock-TEnvironment-"><code>hasLock(Object)</code></a>. The lock implementation is up to the implementor. - If an entity needs to be locked for the life of a procedure -- not just the calls to - execute -- then implementations should say so with the <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#holdLock-TEnvironment-"><code>holdLock(Object)</code></a> - method. - - <p>Procedures can be suspended or put in wait state with a callback that gets executed on + </ul> + NOTE: These states are of the ProcedureExecutor. Procedure implementations in turn can keep their + own state. This can lead to confusion. Try to keep the two distinct. + <p/> + rollback() is called when the procedure or one of the sub-procedures has failed. The rollback + step is supposed to cleanup the resources created during the execute() step. In case of failure + and restart, rollback() may be called multiple times, so again the code must be idempotent. + <p/> + Procedure can be made respect a locking regime. It has acquire/release methods as well as an + <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#hasLock--"><code>hasLock()</code></a>. The lock implementation is up to the implementor. If an entity needs to be + locked for the life of a procedure -- not just the calls to execute -- then implementations + should say so with the <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#holdLock-TEnvironment-"><code>holdLock(Object)</code></a> method. + <p/> + And since we need to restore the lock when restarting to keep the logic correct(HBASE-20846), the + implementation is a bit tricky so we add some comments hrre about it. + <ul> + <li>Make <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#hasLock--"><code>hasLock()</code></a> method final, and add a <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#locked"><code>locked</code></a> field in Procedure to record + whether we have the lock. We will set it to <code>true</code> in + <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#doAcquireLock-TEnvironment-org.apache.hadoop.hbase.procedure2.store.ProcedureStore-"><code>doAcquireLock(Object, ProcedureStore)</code></a> and to <code>false</code> in + <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#doReleaseLock-TEnvironment-org.apache.hadoop.hbase.procedure2.store.ProcedureStore-"><code>doReleaseLock(Object, ProcedureStore)</code></a>. The sub classes do not need to manage it any + more.</li> + <li>Also added a locked field in the proto message. When storing, the field will be set according + to the return value of <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#hasLock--"><code>hasLock()</code></a>. And when loading, there is a new field in Procedure + called <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#lockedWhenLoading"><code>lockedWhenLoading</code></a>. We will set it to <code>true</code> if the locked field in proto + message is <code>true</code>.</li> + <li>The reason why we can not set the <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#locked"><code>locked</code></a> field directly to <code>true</code> by calling + <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#doAcquireLock-TEnvironment-org.apache.hadoop.hbase.procedure2.store.ProcedureStore-"><code>doAcquireLock(Object, ProcedureStore)</code></a> is that, during initialization, most procedures + need to wait until master is initialized. So the solution here is that, we introduced a new + method called <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#waitInitialized-TEnvironment-"><code>waitInitialized(Object)</code></a> in Procedure, and move the wait master initialized + related code from <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#acquireLock-TEnvironment-"><code>acquireLock(Object)</code></a> to this method. And we added a restoreLock method + to Procedure, if <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#lockedWhenLoading"><code>lockedWhenLoading</code></a> is <code>true</code>, we will call the + <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#acquireLock-TEnvironment-"><code>acquireLock(Object)</code></a> to get the lock, but do not set <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#locked"><code>locked</code></a> to true. And later + when we call <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#doAcquireLock-TEnvironment-org.apache.hadoop.hbase.procedure2.store.ProcedureStore-"><code>doAcquireLock(Object, ProcedureStore)</code></a> and pass the + <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#waitInitialized-TEnvironment-"><code>waitInitialized(Object)</code></a> check, we will test <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#lockedWhenLoading"><code>lockedWhenLoading</code></a>, if it is + <code>true</code>, when we just set the <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#locked"><code>locked</code></a> field to true and return, without actually + calling the <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#acquireLock-TEnvironment-"><code>acquireLock(Object)</code></a> method since we have already called it once.</li> + </ul> + <p/> + Procedures can be suspended or put in wait state with a callback that gets executed on Procedure-specified timeout. See <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#setTimeout-int-"><code>setTimeout(int)</code></a>}, and - <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#setTimeoutFailure-TEnvironment-"><code>setTimeoutFailure(Object)</code></a>. See TestProcedureEvents and the - TestTimeoutEventProcedure class for an example usage.</p> - - <p>There are hooks for collecting metrics on submit of the procedure and on finish. - See <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#updateMetricsOnSubmit-TEnvironment-"><code>updateMetricsOnSubmit(Object)</code></a> and - <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#updateMetricsOnFinish-TEnvironment-long-boolean-"><code>updateMetricsOnFinish(Object, long, boolean)</code></a>.</div> + <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#setTimeoutFailure-TEnvironment-"><code>setTimeoutFailure(Object)</code></a>. See TestProcedureEvents and the TestTimeoutEventProcedure + class for an example usage. + </p> + <p/> + There are hooks for collecting metrics on submit of the procedure and on finish. See + <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#updateMetricsOnSubmit-TEnvironment-"><code>updateMetricsOnSubmit(Object)</code></a> and <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#updateMetricsOnFinish-TEnvironment-long-boolean-"><code>updateMetricsOnFinish(Object, long, boolean)</code></a>.</div> </li> </ul> </div> @@ -222,6 +240,14 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#lastUpdate">lastUpdate</a></span></code> </td> </tr> <tr class="rowColor"> +<td class="colFirst"><code>private boolean</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#locked">locked</a></span></code> </td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>private boolean</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#lockedWhenLoading">lockedWhenLoading</a></span></code> </td> +</tr> +<tr class="rowColor"> <td class="colFirst"><code>private static org.slf4j.Logger</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#LOG">LOG</a></span></code> </td> </tr> @@ -361,8 +387,9 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab </td> </tr> <tr id="i9" class="rowColor"> -<td class="colFirst"><code>protected <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.LockState.html" title="enum in org.apache.hadoop.hbase.procedure2">Procedure.LockState</a></code></td> -<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#doAcquireLock-TEnvironment-">doAcquireLock</a></span>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</code> +<td class="colFirst"><code>(package private) <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.LockState.html" title="enum in org.apache.hadoop.hbase.procedure2">Procedure.LockState</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#doAcquireLock-TEnvironment-org.apache.hadoop.hbase.procedure2.store.ProcedureStore-">doAcquireLock</a></span>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env, + <a href="../../../../../org/apache/hadoop/hbase/procedure2/store/ProcedureStore.html" title="interface in org.apache.hadoop.hbase.procedure2.store">ProcedureStore</a> store)</code> <div class="block">Internal method called by the ProcedureExecutor that starts the user-level code acquireLock().</div> </td> </tr> @@ -373,8 +400,9 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab </td> </tr> <tr id="i11" class="rowColor"> -<td class="colFirst"><code>protected void</code></td> -<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#doReleaseLock-TEnvironment-">doReleaseLock</a></span>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</code> +<td class="colFirst"><code>(package private) void</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#doReleaseLock-TEnvironment-org.apache.hadoop.hbase.procedure2.store.ProcedureStore-">doReleaseLock</a></span>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env, + <a href="../../../../../org/apache/hadoop/hbase/procedure2/store/ProcedureStore.html" title="interface in org.apache.hadoop.hbase.procedure2.store">ProcedureStore</a> store)</code> <div class="block">Internal method called by the ProcedureExecutor that starts the user-level code releaseLock().</div> </td> </tr> @@ -444,9 +472,11 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#getResult--">getResult</a></span>()</code> </td> </tr> <tr id="i26" class="altColor"> -<td class="colFirst"><code>protected static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang">Long</a></code></td> -<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#getRootProcedureId-java.util.Map-org.apache.hadoop.hbase.procedure2.Procedure-">getRootProcedureId</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang">Long</a>,<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2">Procedure</a>> procedures, - <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2">Procedure</a><?> proc)</code> </td> +<td class="colFirst"><code>protected static <T> <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang">Long</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#getRootProcedureId-java.util.Map-org.apache.hadoop.hbase.procedure2.Procedure-">getRootProcedureId</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang">Long</a>,<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2">Procedure</a><T>> procedures, + <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2">Procedure</a><T> proc)</code> +<div class="block">Helper to lookup the root Procedure ID given a specified procedure.</div> +</td> </tr> <tr id="i27" class="rowColor"> <td class="colFirst"><code>long</code></td> @@ -484,7 +514,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab </tr> <tr id="i35" class="rowColor"> <td class="colFirst"><code>protected boolean</code></td> -<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#hasLock-TEnvironment-">hasLock</a></span>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</code> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#hasLock--">hasLock</a></span>()</code> <div class="block">This is used in conjunction with <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#holdLock-TEnvironment-"><code>holdLock(Object)</code></a>.</div> </td> </tr> @@ -548,168 +578,177 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab </td> </tr> <tr id="i49" class="rowColor"> +<td class="colFirst"><code>(package private) void</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#lockedWhenLoading--">lockedWhenLoading</a></span>()</code> +<div class="block">Will only be called when loading procedures from procedure store, where we need to record + whether the procedure has already held a lock.</div> +</td> +</tr> +<tr id="i50" class="altColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#releaseLock-TEnvironment-">releaseLock</a></span>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</code> <div class="block">The user should override this method, and release lock if necessary.</div> </td> </tr> -<tr id="i50" class="altColor"> +<tr id="i51" class="rowColor"> <td class="colFirst"><code>protected boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#removeStackIndex--">removeStackIndex</a></span>()</code> </td> </tr> -<tr id="i51" class="rowColor"> +<tr id="i52" class="altColor"> +<td class="colFirst"><code>(package private) void</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#restoreLock-TEnvironment-">restoreLock</a></span>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</code> </td> +</tr> +<tr id="i53" class="rowColor"> <td class="colFirst"><code>protected abstract void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#rollback-TEnvironment-">rollback</a></span>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</code> <div class="block">The code to undo what was done by the execute() code.</div> </td> </tr> -<tr id="i52" class="altColor"> +<tr id="i54" class="altColor"> <td class="colFirst"><code>protected abstract void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#serializeStateData-org.apache.hadoop.hbase.procedure2.ProcedureStateSerializer-">serializeStateData</a></span>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/ProcedureStateSerializer.html" title="interface in org.apache.hadoop.hbase.procedure2">ProcedureStateSerializer</a> serializer)</code> <div class="block">The user-level code of the procedure may have some state to persist (e.g.</div> </td> </tr> -<tr id="i53" class="rowColor"> +<tr id="i55" class="rowColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#setAbortFailure-java.lang.String-java.lang.String-">setAbortFailure</a></span>(<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> source, <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> msg)</code> </td> </tr> -<tr id="i54" class="altColor"> +<tr id="i56" class="altColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#setChildrenLatch-int-">setChildrenLatch</a></span>(int numChildren)</code> <div class="block">Called by the ProcedureExecutor on procedure-load to restore the latch state</div> </td> </tr> -<tr id="i55" class="rowColor"> +<tr id="i57" class="rowColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#setFailure-org.apache.hadoop.hbase.procedure2.RemoteProcedureException-">setFailure</a></span>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/RemoteProcedureException.html" title="class in org.apache.hadoop.hbase.procedure2">RemoteProcedureException</a> exception)</code> </td> </tr> -<tr id="i56" class="altColor"> +<tr id="i58" class="altColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#setFailure-java.lang.String-java.lang.Throwable-">setFailure</a></span>(<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> source, <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> cause)</code> </td> </tr> -<tr id="i57" class="rowColor"> +<tr id="i59" class="rowColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#setLastUpdate-long-">setLastUpdate</a></span>(long lastUpdate)</code> <div class="block">Called on store load to initialize the Procedure internals after the creation/deserialization.</div> </td> </tr> -<tr id="i58" class="altColor"> +<tr id="i60" class="altColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#setNonceKey-org.apache.hadoop.hbase.util.NonceKey-">setNonceKey</a></span>(<a href="../../../../../org/apache/hadoop/hbase/util/NonceKey.html" title="class in org.apache.hadoop.hbase.util">NonceKey</a> nonceKey)</code> <div class="block">Called by the ProcedureExecutor to set the value to the newly created procedure.</div> </td> </tr> -<tr id="i59" class="rowColor"> +<tr id="i61" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#setOwner-java.lang.String-">setOwner</a></span>(<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> owner)</code> </td> </tr> -<tr id="i60" class="altColor"> +<tr id="i62" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#setOwner-org.apache.hadoop.hbase.security.User-">setOwner</a></span>(<a href="../../../../../org/apache/hadoop/hbase/security/User.html" title="class in org.apache.hadoop.hbase.security">User</a> owner)</code> </td> </tr> -<tr id="i61" class="rowColor"> +<tr id="i63" class="rowColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#setParentProcId-long-">setParentProcId</a></span>(long parentProcId)</code> <div class="block">Called by the ProcedureExecutor to assign the parent to the newly created procedure.</div> </td> </tr> -<tr id="i62" class="altColor"> +<tr id="i64" class="altColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#setProcId-long-">setProcId</a></span>(long procId)</code> <div class="block">Called by the ProcedureExecutor to assign the ID to the newly created procedure.</div> </td> </tr> -<tr id="i63" class="rowColor"> +<tr id="i65" class="rowColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#setResult-byte:A-">setResult</a></span>(byte[] result)</code> <div class="block">The procedure may leave a "result" on completion.</div> </td> </tr> -<tr id="i64" class="altColor"> +<tr id="i66" class="altColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#setRootProcId-long-">setRootProcId</a></span>(long rootProcId)</code> </td> </tr> -<tr id="i65" class="rowColor"> +<tr id="i67" class="rowColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#setStackIndexes-java.util.List-">setStackIndexes</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>> stackIndexes)</code> <div class="block">Called on store load to initialize the Procedure internals after the creation/deserialization.</div> </td> </tr> -<tr id="i66" class="altColor"> +<tr id="i68" class="altColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#setState-org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureState-">setState</a></span>(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureState state)</code> </td> </tr> -<tr id="i67" class="rowColor"> +<tr id="i69" class="rowColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#setSubmittedTime-long-">setSubmittedTime</a></span>(long submittedTime)</code> <div class="block">Called on store load to initialize the Procedure internals after the creation/deserialization.</div> </td> </tr> -<tr id="i68" class="altColor"> +<tr id="i70" class="altColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#setTimeout-int-">setTimeout</a></span>(int timeout)</code> </td> </tr> -<tr id="i69" class="rowColor"> +<tr id="i71" class="rowColor"> <td class="colFirst"><code>protected boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#setTimeoutFailure-TEnvironment-">setTimeoutFailure</a></span>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</code> <div class="block">Called by the ProcedureExecutor when the timeout set by setTimeout() is expired.</div> </td> </tr> -<tr id="i70" class="altColor"> +<tr id="i72" class="altColor"> <td class="colFirst"><code>protected boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#shouldWaitClientAck-TEnvironment-">shouldWaitClientAck</a></span>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</code> <div class="block">By default, the executor will keep the procedure result around util the eviction TTL is expired.</div> </td> </tr> -<tr id="i71" class="rowColor"> +<tr id="i73" class="rowColor"> <td class="colFirst"><code><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 class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#toString--">toString</a></span>()</code> </td> </tr> -<tr id="i72" class="altColor"> +<tr id="i74" class="altColor"> <td class="colFirst"><code>protected <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 class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#toStringClass--">toStringClass</a></span>()</code> </td> </tr> -<tr id="i73" class="rowColor"> +<tr id="i75" class="rowColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#toStringClassDetails-java.lang.StringBuilder-">toStringClassDetails</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/StringBuilder.html?is-external=true" title="class or interface in java.lang">StringBuilder</a> builder)</code> <div class="block">Extend the toString() information with the procedure details e.g.</div> </td> </tr> -<tr id="i74" class="altColor"> +<tr id="i76" class="altColor"> <td class="colFirst"><code><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 class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#toStringDetails--">toStringDetails</a></span>()</code> -<div class="block">Extend the toString() information with more procedure - details</div> +<div class="block">Extend the toString() information with more procedure details</div> </td> </tr> -<tr id="i75" class="rowColor"> +<tr id="i77" class="rowColor"> <td class="colFirst"><code>protected <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/StringBuilder.html?is-external=true" title="class or interface in java.lang">StringBuilder</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#toStringSimpleSB--">toStringSimpleSB</a></span>()</code> -<div class="block">Build the StringBuilder for the simple form of - procedure string.</div> +<div class="block">Build the StringBuilder for the simple form of procedure string.</div> </td> </tr> -<tr id="i76" class="altColor"> +<tr id="i78" class="altColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#toStringState-java.lang.StringBuilder-">toStringState</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/StringBuilder.html?is-external=true" title="class or interface in java.lang">StringBuilder</a> builder)</code> <div class="block">Called from <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#toString--"><code>toString()</code></a> when interpolating <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2"><code>Procedure</code></a> State.</div> </td> </tr> -<tr id="i77" class="rowColor"> +<tr id="i79" class="rowColor"> <td class="colFirst"><code>(package private) boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#tryRunnable--">tryRunnable</a></span>()</code> <div class="block">Try to set this procedure into RUNNABLE state.</div> </td> </tr> -<tr id="i78" class="altColor"> +<tr id="i80" class="altColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#updateMetricsOnFinish-TEnvironment-long-boolean-">updateMetricsOnFinish</a></span>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env, long runtime, @@ -717,19 +756,27 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <div class="block">This function will be called just after procedure execution is finished.</div> </td> </tr> -<tr id="i79" class="rowColor"> +<tr id="i81" class="rowColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#updateMetricsOnSubmit-TEnvironment-">updateMetricsOnSubmit</a></span>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</code> <div class="block">This function will be called just when procedure is submitted for execution.</div> </td> </tr> -<tr id="i80" class="altColor"> +<tr id="i82" class="altColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#updateTimestamp--">updateTimestamp</a></span>()</code> <div class="block">Called by ProcedureExecutor after each time a procedure step is executed.</div> </td> </tr> -<tr id="i81" class="rowColor"> +<tr id="i83" class="rowColor"> +<td class="colFirst"><code>protected boolean</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#waitInitialized-TEnvironment-">waitInitialized</a></span>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</code> +<div class="block">The <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#doAcquireLock-TEnvironment-org.apache.hadoop.hbase.procedure2.store.ProcedureStore-"><code>doAcquireLock(Object, ProcedureStore)</code></a> will be split into two steps, first, it will + call us to determine whether we need to wait for initialization, second, it will call + <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#acquireLock-TEnvironment-"><code>acquireLock(Object)</code></a> to actually handle the lock for this procedure.</div> +</td> +</tr> +<tr id="i84" class="altColor"> <td class="colFirst"><code>protected boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#wasExecuted--">wasExecuted</a></span>()</code> </td> </tr> @@ -761,7 +808,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>LOG</h4> -<pre>private static final org.slf4j.Logger <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.96">LOG</a></pre> +<pre>private static final org.slf4j.Logger <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.114">LOG</a></pre> </li> </ul> <a name="NO_PROC_ID"> @@ -770,7 +817,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>NO_PROC_ID</h4> -<pre>public static final long <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.97">NO_PROC_ID</a></pre> +<pre>public static final long <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.115">NO_PROC_ID</a></pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#org.apache.hadoop.hbase.procedure2.Procedure.NO_PROC_ID">Constant Field Values</a></dd> @@ -783,7 +830,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>NO_TIMEOUT</h4> -<pre>protected static final int <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.98">NO_TIMEOUT</a></pre> +<pre>protected static final int <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.116">NO_TIMEOUT</a></pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#org.apache.hadoop.hbase.procedure2.Procedure.NO_TIMEOUT">Constant Field Values</a></dd> @@ -796,7 +843,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>nonceKey</h4> -<pre>private <a href="../../../../../org/apache/hadoop/hbase/util/NonceKey.html" title="class in org.apache.hadoop.hbase.util">NonceKey</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.107">nonceKey</a></pre> +<pre>private <a href="../../../../../org/apache/hadoop/hbase/util/NonceKey.html" title="class in org.apache.hadoop.hbase.util">NonceKey</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.125">nonceKey</a></pre> </li> </ul> <a name="owner"> @@ -805,7 +852,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>owner</h4> -<pre>private <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> <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.108">owner</a></pre> +<pre>private <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> <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.126">owner</a></pre> </li> </ul> <a name="parentProcId"> @@ -814,7 +861,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>parentProcId</h4> -<pre>private long <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.109">parentProcId</a></pre> +<pre>private long <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.127">parentProcId</a></pre> </li> </ul> <a name="rootProcId"> @@ -823,7 +870,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>rootProcId</h4> -<pre>private long <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.110">rootProcId</a></pre> +<pre>private long <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.128">rootProcId</a></pre> </li> </ul> <a name="procId"> @@ -832,7 +879,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>procId</h4> -<pre>private long <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.111">procId</a></pre> +<pre>private long <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.129">procId</a></pre> </li> </ul> <a name="submittedTime"> @@ -841,7 +888,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>submittedTime</h4> -<pre>private long <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.112">submittedTime</a></pre> +<pre>private long <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.130">submittedTime</a></pre> </li> </ul> <a name="state"> @@ -850,7 +897,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>state</h4> -<pre>private org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureState <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.115">state</a></pre> +<pre>private org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureState <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.133">state</a></pre> </li> </ul> <a name="exception"> @@ -859,7 +906,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>exception</h4> -<pre>private <a href="../../../../../org/apache/hadoop/hbase/procedure2/RemoteProcedureException.html" title="class in org.apache.hadoop.hbase.procedure2">RemoteProcedureException</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.116">exception</a></pre> +<pre>private <a href="../../../../../org/apache/hadoop/hbase/procedure2/RemoteProcedureException.html" title="class in org.apache.hadoop.hbase.procedure2">RemoteProcedureException</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.134">exception</a></pre> </li> </ul> <a name="stackIndexes"> @@ -868,7 +915,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>stackIndexes</h4> -<pre>private int[] <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.117">stackIndexes</a></pre> +<pre>private int[] <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.135">stackIndexes</a></pre> </li> </ul> <a name="childrenLatch"> @@ -877,7 +924,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>childrenLatch</h4> -<pre>private int <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.118">childrenLatch</a></pre> +<pre>private int <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.136">childrenLatch</a></pre> </li> </ul> <a name="timeout"> @@ -886,7 +933,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>timeout</h4> -<pre>private volatile int <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.120">timeout</a></pre> +<pre>private volatile int <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.138">timeout</a></pre> </li> </ul> <a name="lastUpdate"> @@ -895,16 +942,34 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>lastUpdate</h4> -<pre>private volatile long <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.121">lastUpdate</a></pre> +<pre>private volatile long <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.139">lastUpdate</a></pre> </li> </ul> <a name="result"> <!-- --> </a> -<ul class="blockListLast"> +<ul class="blockList"> <li class="blockList"> <h4>result</h4> -<pre>private volatile byte[] <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.123">result</a></pre> +<pre>private volatile byte[] <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.141">result</a></pre> +</li> +</ul> +<a name="locked"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>locked</h4> +<pre>private volatile boolean <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.143">locked</a></pre> +</li> +</ul> +<a name="lockedWhenLoading"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>lockedWhenLoading</h4> +<pre>private boolean <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.145">lockedWhenLoading</a></pre> </li> </ul> </li> @@ -921,7 +986,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockListLast"> <li class="blockList"> <h4>Procedure</h4> -<pre>public <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.95">Procedure</a>()</pre> +<pre>public <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.113">Procedure</a>()</pre> </li> </ul> </li> @@ -940,7 +1005,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>execute</h4> -<pre>protected abstract <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2">Procedure</a><<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a>>[] <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.137">execute</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env) +<pre>protected abstract <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2">Procedure</a><<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a>>[] <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.159">execute</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env) throws <a href="../../../../../org/apache/hadoop/hbase/procedure2/ProcedureYieldException.html" title="class in org.apache.hadoop.hbase.procedure2">ProcedureYieldException</a>, <a href="../../../../../org/apache/hadoop/hbase/procedure2/ProcedureSuspendedException.html" title="class in org.apache.hadoop.hbase.procedure2">ProcedureSuspendedException</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></pre> @@ -969,7 +1034,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>rollback</h4> -<pre>protected abstract void <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.151">rollback</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env) +<pre>protected abstract void <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.173">rollback</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env) 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>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></pre> <div class="block">The code to undo what was done by the execute() code. @@ -995,7 +1060,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>abort</h4> -<pre>protected abstract boolean <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.165">abort</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</pre> +<pre>protected abstract boolean <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.187">abort</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</pre> <div class="block">The abort() call is asynchronous and each procedure must decide how to deal with it, if they want to be abortable. The simplest implementation is to have an AtomicBoolean set in the abort() method and then the execute() @@ -1013,7 +1078,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>serializeStateData</h4> -<pre>protected abstract void <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.173">serializeStateData</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/ProcedureStateSerializer.html" title="interface in org.apache.hadoop.hbase.procedure2">ProcedureStateSerializer</a> serializer) +<pre>protected abstract void <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.195">serializeStateData</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/ProcedureStateSerializer.html" title="interface in org.apache.hadoop.hbase.procedure2">ProcedureStateSerializer</a> serializer) 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">The user-level code of the procedure may have some state to persist (e.g. input arguments or current position in the processing state) to @@ -1032,7 +1097,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>deserializeStateData</h4> -<pre>protected abstract void <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.181">deserializeStateData</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/ProcedureStateSerializer.html" title="interface in org.apache.hadoop.hbase.procedure2">ProcedureStateSerializer</a> serializer) +<pre>protected abstract void <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.203">deserializeStateData</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/ProcedureStateSerializer.html" title="interface in org.apache.hadoop.hbase.procedure2">ProcedureStateSerializer</a> serializer) 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">Called on store load to allow the user to decode the previously serialized state.</div> @@ -1044,6 +1109,30 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab </dl> </li> </ul> +<a name="waitInitialized-java.lang.Object-"> +<!-- --> +</a><a name="waitInitialized-TEnvironment-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>waitInitialized</h4> +<pre>protected boolean <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.218">waitInitialized</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</pre> +<div class="block">The <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#doAcquireLock-TEnvironment-org.apache.hadoop.hbase.procedure2.store.ProcedureStore-"><code>doAcquireLock(Object, ProcedureStore)</code></a> will be split into two steps, first, it will + call us to determine whether we need to wait for initialization, second, it will call + <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#acquireLock-TEnvironment-"><code>acquireLock(Object)</code></a> to actually handle the lock for this procedure. + <p/> + This is because that when master restarts, we need to restore the lock state for all the + procedures to not break the semantic if <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#holdLock-TEnvironment-"><code>holdLock(Object)</code></a> is true. But the + <a href="../../../../../org/apache/hadoop/hbase/procedure2/ProcedureExecutor.html" title="class in org.apache.hadoop.hbase.procedure2"><code>ProcedureExecutor</code></a> will be started before the master finish initialization(as it is part + of the initialization!), so we need to split the code into two steps, and when restore, we just + restore the lock part and ignore the waitInitialized part. Otherwise there will be dead lock.</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>true means we need to wait until the environment has been initialized, otherwise true.</dd> +</dl> +</li> +</ul> <a name="acquireLock-java.lang.Object-"> <!-- --> </a><a name="acquireLock-TEnvironment-"> @@ -1052,28 +1141,28 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>acquireLock</h4> -<pre>protected <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.LockState.html" title="enum in org.apache.hadoop.hbase.procedure2">Procedure.LockState</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.208">acquireLock</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</pre> -<div class="block">The user should override this method if they need a lock on an Entity. - A lock can be anything, and it is up to the implementor. The Procedure - Framework will call this method just before it invokes <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#execute-TEnvironment-"><code>execute(Object)</code></a>. - It calls <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#releaseLock-TEnvironment-"><code>releaseLock(Object)</code></a> after the call to execute. - - <p>If you need to hold the lock for the life of the Procedure -- i.e. you do not - want any other Procedure interfering while this Procedure is running, see - <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#holdLock-TEnvironment-"><code>holdLock(Object)</code></a>. - - <p>Example: in our Master we can execute request in parallel for different tables. - We can create t1 and create t2 and these creates can be executed at the same time. - Anything else on t1/t2 is queued waiting that specific table create to happen. - - <p>There are 3 LockState: - <ul><li>LOCK_ACQUIRED should be returned when the proc has the lock and the proc is - ready to execute.</li> - <li>LOCK_YIELD_WAIT should be returned when the proc has not the lock and the framework - should take care of readding the procedure back to the runnable set for retry</li> - <li>LOCK_EVENT_WAIT should be returned when the proc has not the lock and someone will - take care of readding the procedure back to the runnable set when the lock is available. - </li></ul></div> +<pre>protected <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.LockState.html" title="enum in org.apache.hadoop.hbase.procedure2">Procedure.LockState</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.246">acquireLock</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</pre> +<div class="block">The user should override this method if they need a lock on an Entity. A lock can be anything, + and it is up to the implementor. The Procedure Framework will call this method just before it + invokes <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#execute-TEnvironment-"><code>execute(Object)</code></a>. It calls <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#releaseLock-TEnvironment-"><code>releaseLock(Object)</code></a> after the call to + execute. + <p/> + If you need to hold the lock for the life of the Procedure -- i.e. you do not want any other + Procedure interfering while this Procedure is running, see <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#holdLock-TEnvironment-"><code>holdLock(Object)</code></a>. + <p/> + Example: in our Master we can execute request in parallel for different tables. We can create + t1 and create t2 and these creates can be executed at the same time. Anything else on t1/t2 is + queued waiting that specific table create to happen. + <p/> + There are 3 LockState: + <ul> + <li>LOCK_ACQUIRED should be returned when the proc has the lock and the proc is ready to + execute.</li> + <li>LOCK_YIELD_WAIT should be returned when the proc has not the lock and the framework should + take care of readding the procedure back to the runnable set for retry</li> + <li>LOCK_EVENT_WAIT should be returned when the proc has not the lock and someone will take + care of readding the procedure back to the runnable set when the lock is available.</li> + </ul></div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the lock state as described above.</dd> @@ -1088,7 +1177,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>releaseLock</h4> -<pre>protected void <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.215">releaseLock</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</pre> +<pre>protected void <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.253">releaseLock</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</pre> <div class="block">The user should override this method, and release lock if necessary.</div> </li> </ul> @@ -1100,27 +1189,21 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>holdLock</h4> -<pre>protected boolean <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.226">holdLock</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</pre> -<div class="block">Used to keep the procedure lock even when the procedure is yielding or suspended. - Must implement <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#hasLock-TEnvironment-"><code>hasLock(Object)</code></a> if you want to hold the lock for life - of the Procedure.</div> +<pre>protected boolean <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.261">holdLock</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</pre> +<div class="block">Used to keep the procedure lock even when the procedure is yielding or suspended.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>true if the procedure should hold on the lock until completionCleanup()</dd> -<dt><span class="seeLabel">See Also:</span></dt> -<dd><a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#hasLock-TEnvironment-"><code>hasLock(Object)</code></a></dd> </dl> </li> </ul> -<a name="hasLock-java.lang.Object-"> -<!-- --> -</a><a name="hasLock-TEnvironment-"> +<a name="hasLock--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>hasLock</h4> -<pre>protected boolean <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.238">hasLock</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</pre> +<pre>protected final boolean <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.273">hasLock</a>()</pre> <div class="block">This is used in conjunction with <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#holdLock-TEnvironment-"><code>holdLock(Object)</code></a>. If <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#holdLock-TEnvironment-"><code>holdLock(Object)</code></a> returns true, the procedure executor will call acquireLock() once and thereafter not call <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#releaseLock-TEnvironment-"><code>releaseLock(Object)</code></a> until the Procedure is done (Normally, it calls @@ -1141,7 +1224,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>beforeReplay</h4> -<pre>protected void <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.248">beforeReplay</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</pre> +<pre>protected void <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.283">beforeReplay</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</pre> <div class="block">Called when the procedure is loaded for replay. The procedure implementor may use this method to perform some quick operation before replay. @@ -1156,7 +1239,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>afterReplay</h4> -<pre>protected void <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.256">afterReplay</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</pre> +<pre>protected void <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.291">afterReplay</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</pre> <div class="block">Called when the procedure is ready to be added to the queue after the loading/replay operation.</div> </li> @@ -1169,7 +1252,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>completionCleanup</h4> -<pre>protected void <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.266">completionCleanup</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</pre> +<pre>protected void <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.301">completionCleanup</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</pre> <div class="block">Called when the procedure is marked as completed (success or rollback). The procedure implementor may use this method to cleanup in-memory states. This operation will not be retried on failure. If a procedure took a lock, @@ -1184,7 +1267,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>isYieldAfterExecutionStep</h4> -<pre>protected boolean <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.278">isYieldAfterExecutionStep</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</pre> +<pre>protected boolean <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.313">isYieldAfterExecutionStep</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</pre> <div class="block">By default, the procedure framework/executor will try to run procedures start to finish. Return true to make the executor yield between each execution step to give other procedures a chance to run.</div> @@ -1205,7 +1288,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>shouldWaitClientAck</h4> -<pre>protected boolean <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.291">shouldWaitClientAck</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</pre> +<pre>protected boolean <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.326">shouldWaitClientAck</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</pre> <div class="block">By default, the executor will keep the procedure result around util the eviction TTL is expired. The client can cut down the waiting time by requesting that the result is removed from the executor. @@ -1227,7 +1310,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>getProcedureMetrics</h4> -<pre>protected <a href="../../../../../org/apache/hadoop/hbase/procedure2/ProcedureMetrics.html" title="interface in org.apache.hadoop.hbase.procedure2">ProcedureMetrics</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.301">getProcedureMetrics</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</pre> +<pre>protected <a href="../../../../../org/apache/hadoop/hbase/procedure2/ProcedureMetrics.html" title="interface in org.apache.hadoop.hbase.procedure2">ProcedureMetrics</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.336">getProcedureMetrics</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</pre> <div class="block">Override this method to provide procedure specific counters for submitted count, failed count and time histogram.</div> <dl> @@ -1246,7 +1329,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>updateMetricsOnSubmit</h4> -<pre>protected void <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.311">updateMetricsOnSubmit</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</pre> +<pre>protected void <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.346">updateMetricsOnSubmit</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env)</pre> <div class="block">This function will be called just when procedure is submitted for execution. Override this method to update the metrics at the beginning of the procedure. The default implementation updates submitted counter if <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#getProcedureMetrics-TEnvironment-"><code>getProcedureMetrics(Object)</code></a> returns non-null @@ -1261,18 +1344,18 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>updateMetricsOnFinish</h4> -<pre>protected void <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.338">updateMetricsOnFinish</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env, +<pre>protected void <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.372">updateMetricsOnFinish</a>(<a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="type parameter in Procedure">TEnvironment</a> env, long runtime, boolean success)</pre> <div class="block">This function will be called just after procedure execution is finished. Override this method - to update metrics at the end of the procedure. If <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#getProcedureMetrics-TEnvironment-"><code>getProcedureMetrics(Object)</code></a> - returns non-null <a href="../../../../../org/apache/hadoop/hbase/procedure2/ProcedureMetrics.html" title="interface in org.apache.hadoop.hbase.procedure2"><code>ProcedureMetrics</code></a>, the default implementation adds runtime of a - procedure to a time histogram for successfully completed procedures. Increments failed - counter for failed procedures. - - TODO: As any of the sub-procedures on failure rolls back all procedures in the stack, - including successfully finished siblings, this function may get called twice in certain - cases for certain procedures. Explore further if this can be called once.</div> + to update metrics at the end of the procedure. If <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#getProcedureMetrics-TEnvironment-"><code>getProcedureMetrics(Object)</code></a> returns + non-null <a href="../../../../../org/apache/hadoop/hbase/procedure2/ProcedureMetrics.html" title="interface in org.apache.hadoop.hbase.procedure2"><code>ProcedureMetrics</code></a>, the default implementation adds runtime of a procedure to a + time histogram for successfully completed procedures. Increments failed counter for failed + procedures. + <p/> + TODO: As any of the sub-procedures on failure rolls back all procedures in the stack, including + successfully finished siblings, this function may get called twice in certain cases for certain + procedures. Explore further if this can be called once.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>env</code> - The environment passed to the procedure executor</dd> @@ -1287,7 +1370,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>toString</h4> -<pre>public <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> <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.359">toString</a>()</pre> +<pre>public <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> <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.392">toString</a>()</pre> <dl> <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a></code> in class <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd> @@ -1300,9 +1383,8 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>toStringSimpleSB</h4> -<pre>protected <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/StringBuilder.html?is-external=true" title="class or interface in java.lang">StringBuilder</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.369">toStringSimpleSB</a>()</pre> -<div class="block">Build the StringBuilder for the simple form of - procedure string.</div> +<pre>protected <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/StringBuilder.html?is-external=true" title="class or interface in java.lang">StringBuilder</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.401">toStringSimpleSB</a>()</pre> +<div class="block">Build the StringBuilder for the simple form of procedure string.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the StringBuilder</dd> @@ -1315,9 +1397,8 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>toStringDetails</h4> -<pre>public <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> <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.406">toStringDetails</a>()</pre> -<div class="block">Extend the toString() information with more procedure - details</div> +<pre>public <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> <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.439">toStringDetails</a>()</pre> +<div class="block">Extend the toString() information with more procedure details</div> </li> </ul> <a name="toStringClass--"> @@ -1326,7 +1407,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>toStringClass</h4> -<pre>protected <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> <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.425">toStringClass</a>()</pre> +<pre>protected <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> <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.458">toStringClass</a>()</pre> </li> </ul> <a name="toStringState-java.lang.StringBuilder-"> @@ -1335,9 +1416,9 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>toStringState</h4> -<pre>protected void <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.436">toStringState</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/StringBuilder.html?is-external=true" title="class or interface in java.lang">StringBuilder</a> builder)</pre> -<div class="block">Called from <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#toString--"><code>toString()</code></a> when interpolating <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2"><code>Procedure</code></a> State. - Allows decorating generic Procedure State with Procedure particulars.</div> +<pre>protected void <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.469">toStringState</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/StringBuilder.html?is-external=true" title="class or interface in java.lang">StringBuilder</a> builder)</pre> +<div class="block">Called from <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html#toString--"><code>toString()</code></a> when interpolating <a href="../../../../../org/apache/hadoop/hbase/procedure2/Procedure.html" title="class in org.apache.hadoop.hbase.procedure2"><code>Procedure</code></a> State. Allows decorating + generic Procedure State with Procedure particulars.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>builder</code> - Append current <code>ProcedureProtos.ProcedureState</code></dd> @@ -1350,7 +1431,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>toStringClassDetails</h4> -<pre>protected void <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.445">toStringClassDetails</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/StringBuilder.html?is-external=true" title="class or interface in java.lang">StringBuilder</a> builder)</pre> +<pre>protected void <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.478">toStringClassDetails</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/StringBuilder.html?is-external=true" title="class or interface in java.lang">StringBuilder</a> builder)</pre> <div class="block">Extend the toString() information with the procedure details e.g. className and parameters</div> <dl> @@ -1365,7 +1446,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>getProcId</h4> -<pre>public long <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.456">getProcId</a>()</pre> +<pre>public long <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.489">getProcId</a>()</pre> </li> </ul> <a name="hasParent--"> @@ -1374,7 +1455,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>hasParent</h4> -<pre>public boolean <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.460">hasParent</a>()</pre> +<pre>public boolean <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.493">hasParent</a>()</pre> </li> </ul> <a name="getParentProcId--"> @@ -1383,7 +1464,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>getParentProcId</h4> -<pre>public long <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.464">getParentProcId</a>()</pre> +<pre>public long <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.497">getParentProcId</a>()</pre> </li> </ul> <a name="getRootProcId--"> @@ -1392,7 +1473,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>getRootProcId</h4> -<pre>public long <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.468">getRootProcId</a>()</pre> +<pre>public long <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.501">getRootProcId</a>()</pre> </li> </ul> <a name="getProcName--"> @@ -1401,7 +1482,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>getProcName</h4> -<pre>public <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> <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.472">getProcName</a>()</pre> +<pre>public <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> <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.505">getProcName</a>()</pre> </li> </ul> <a name="getNonceKey--"> @@ -1410,7 +1491,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>getNonceKey</h4> -<pre>public <a href="../../../../../org/apache/hadoop/hbase/util/NonceKey.html" title="class in org.apache.hadoop.hbase.util">NonceKey</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.476">getNonceKey</a>()</pre> +<pre>public <a href="../../../../../org/apache/hadoop/hbase/util/NonceKey.html" title="class in org.apache.hadoop.hbase.util">NonceKey</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.509">getNonceKey</a>()</pre> </li> </ul> <a name="getSubmittedTime--"> @@ -1419,7 +1500,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>getSubmittedTime</h4> -<pre>public long <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.480">getSubmittedTime</a>()</pre> +<pre>public long <a href="../../../../../src-html/org/apache/hadoop/hbase/procedure2/Procedure.html#line.513">getSubmittedTime</a>()</pre> </li> </ul> <a name="getOwner--"> @@ -1428,7 +1509,7 @@ implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparab <ul class="blockList"> <li class="blockList"> <h4>getOwner</h4> -<pre>public <a href="https://docs.ora
<TRUNCATED>