hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject [09/14] hbase git commit: Published site at 55087ce8887b5be38b0fda0dda3fbf2f92c13778.
Date Mon, 23 Nov 2015 23:03:26 GMT
http://git-wip-us.apache.org/repos/asf/hbase/blob/f843f57d/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/wal/FSHLog.RingBufferExceptionHandler.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/wal/FSHLog.RingBufferExceptionHandler.html b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/wal/FSHLog.RingBufferExceptionHandler.html
index ca636ce..06e7632 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/wal/FSHLog.RingBufferExceptionHandler.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/wal/FSHLog.RingBufferExceptionHandler.html
@@ -1761,222 +1761,216 @@
 <span class="sourceLineNo">1753</span>        }<a name="line.1753"></a>
 <span class="sourceLineNo">1754</span><a name="line.1754"></a>
 <span class="sourceLineNo">1755</span>        // TODO: Check size and if big go ahead and call a sync if we have enough data.<a name="line.1755"></a>
-<span class="sourceLineNo">1756</span><a name="line.1756"></a>
-<span class="sourceLineNo">1757</span>        // If not a batch, return to consume more events from the ring buffer before proceeding;<a name="line.1757"></a>
-<span class="sourceLineNo">1758</span>        // we want to get up a batch of syncs and appends before we go do a filesystem sync.<a name="line.1758"></a>
-<span class="sourceLineNo">1759</span>        if (!endOfBatch || this.syncFuturesCount &lt;= 0) return;<a name="line.1759"></a>
-<span class="sourceLineNo">1760</span><a name="line.1760"></a>
-<span class="sourceLineNo">1761</span>        // Now we have a batch.<a name="line.1761"></a>
-<span class="sourceLineNo">1762</span><a name="line.1762"></a>
-<span class="sourceLineNo">1763</span>        if (LOG.isTraceEnabled()) {<a name="line.1763"></a>
-<span class="sourceLineNo">1764</span>          LOG.trace("Sequence=" + sequence + ", syncCount=" + this.syncFuturesCount);<a name="line.1764"></a>
-<span class="sourceLineNo">1765</span>        }<a name="line.1765"></a>
-<span class="sourceLineNo">1766</span><a name="line.1766"></a>
-<span class="sourceLineNo">1767</span>        if (this.exception == null) {<a name="line.1767"></a>
-<span class="sourceLineNo">1768</span>          // Below expects that the offer 'transfers' responsibility for the outstanding syncs to<a name="line.1768"></a>
-<span class="sourceLineNo">1769</span>          // the syncRunner. We should never get an exception in here.<a name="line.1769"></a>
-<span class="sourceLineNo">1770</span>          this.syncRunnerIndex = (this.syncRunnerIndex + 1) % this.syncRunners.length;<a name="line.1770"></a>
-<span class="sourceLineNo">1771</span>          try {<a name="line.1771"></a>
-<span class="sourceLineNo">1772</span>            this.syncRunners[this.syncRunnerIndex].offer(sequence, this.syncFutures,<a name="line.1772"></a>
-<span class="sourceLineNo">1773</span>              this.syncFuturesCount);<a name="line.1773"></a>
-<span class="sourceLineNo">1774</span>          } catch (Exception e) {<a name="line.1774"></a>
-<span class="sourceLineNo">1775</span>            // Should NEVER get here.<a name="line.1775"></a>
-<span class="sourceLineNo">1776</span>            requestLogRoll();<a name="line.1776"></a>
-<span class="sourceLineNo">1777</span>            this.exception = new DamagedWALException("Failed offering sync", e);<a name="line.1777"></a>
-<span class="sourceLineNo">1778</span>          }<a name="line.1778"></a>
+<span class="sourceLineNo">1756</span>        // This is a sync. If existing exception, fall through. Else look to see if batch.<a name="line.1756"></a>
+<span class="sourceLineNo">1757</span>        if (this.exception == null) {<a name="line.1757"></a>
+<span class="sourceLineNo">1758</span>          // If not a batch, return to consume more events from the ring buffer before proceeding;<a name="line.1758"></a>
+<span class="sourceLineNo">1759</span>          // we want to get up a batch of syncs and appends before we go do a filesystem sync.<a name="line.1759"></a>
+<span class="sourceLineNo">1760</span>          if (!endOfBatch || this.syncFuturesCount &lt;= 0) return;<a name="line.1760"></a>
+<span class="sourceLineNo">1761</span>          // Below expects that the offer 'transfers' responsibility for the outstanding syncs to<a name="line.1761"></a>
+<span class="sourceLineNo">1762</span>          // the syncRunner. We should never get an exception in here.<a name="line.1762"></a>
+<span class="sourceLineNo">1763</span>          this.syncRunnerIndex = (this.syncRunnerIndex + 1) % this.syncRunners.length;<a name="line.1763"></a>
+<span class="sourceLineNo">1764</span>          try {<a name="line.1764"></a>
+<span class="sourceLineNo">1765</span>            this.syncRunners[this.syncRunnerIndex].offer(sequence, this.syncFutures,<a name="line.1765"></a>
+<span class="sourceLineNo">1766</span>              this.syncFuturesCount);<a name="line.1766"></a>
+<span class="sourceLineNo">1767</span>          } catch (Exception e) {<a name="line.1767"></a>
+<span class="sourceLineNo">1768</span>            // Should NEVER get here.<a name="line.1768"></a>
+<span class="sourceLineNo">1769</span>            requestLogRoll();<a name="line.1769"></a>
+<span class="sourceLineNo">1770</span>            this.exception = new DamagedWALException("Failed offering sync", e);<a name="line.1770"></a>
+<span class="sourceLineNo">1771</span>          }<a name="line.1771"></a>
+<span class="sourceLineNo">1772</span>        }<a name="line.1772"></a>
+<span class="sourceLineNo">1773</span>        // We may have picked up an exception above trying to offer sync<a name="line.1773"></a>
+<span class="sourceLineNo">1774</span>        if (this.exception != null) {<a name="line.1774"></a>
+<span class="sourceLineNo">1775</span>          cleanupOutstandingSyncsOnException(sequence,<a name="line.1775"></a>
+<span class="sourceLineNo">1776</span>            this.exception instanceof DamagedWALException?<a name="line.1776"></a>
+<span class="sourceLineNo">1777</span>              this.exception:<a name="line.1777"></a>
+<span class="sourceLineNo">1778</span>              new DamagedWALException("On sync", this.exception));<a name="line.1778"></a>
 <span class="sourceLineNo">1779</span>        }<a name="line.1779"></a>
-<span class="sourceLineNo">1780</span>        // We may have picked up an exception above trying to offer sync<a name="line.1780"></a>
-<span class="sourceLineNo">1781</span>        if (this.exception != null) {<a name="line.1781"></a>
-<span class="sourceLineNo">1782</span>          cleanupOutstandingSyncsOnException(sequence,<a name="line.1782"></a>
-<span class="sourceLineNo">1783</span>            new DamagedWALException("On sync", this.exception));<a name="line.1783"></a>
-<span class="sourceLineNo">1784</span>        }<a name="line.1784"></a>
-<span class="sourceLineNo">1785</span>        attainSafePoint(sequence);<a name="line.1785"></a>
-<span class="sourceLineNo">1786</span>        this.syncFuturesCount = 0;<a name="line.1786"></a>
-<span class="sourceLineNo">1787</span>      } catch (Throwable t) {<a name="line.1787"></a>
-<span class="sourceLineNo">1788</span>        LOG.error("UNEXPECTED!!! syncFutures.length=" + this.syncFutures.length, t);<a name="line.1788"></a>
-<span class="sourceLineNo">1789</span>      }<a name="line.1789"></a>
+<span class="sourceLineNo">1780</span>        attainSafePoint(sequence);<a name="line.1780"></a>
+<span class="sourceLineNo">1781</span>        this.syncFuturesCount = 0;<a name="line.1781"></a>
+<span class="sourceLineNo">1782</span>      } catch (Throwable t) {<a name="line.1782"></a>
+<span class="sourceLineNo">1783</span>        LOG.error("UNEXPECTED!!! syncFutures.length=" + this.syncFutures.length, t);<a name="line.1783"></a>
+<span class="sourceLineNo">1784</span>      }<a name="line.1784"></a>
+<span class="sourceLineNo">1785</span>    }<a name="line.1785"></a>
+<span class="sourceLineNo">1786</span><a name="line.1786"></a>
+<span class="sourceLineNo">1787</span>    SafePointZigZagLatch attainSafePoint() {<a name="line.1787"></a>
+<span class="sourceLineNo">1788</span>      this.zigzagLatch = new SafePointZigZagLatch();<a name="line.1788"></a>
+<span class="sourceLineNo">1789</span>      return this.zigzagLatch;<a name="line.1789"></a>
 <span class="sourceLineNo">1790</span>    }<a name="line.1790"></a>
 <span class="sourceLineNo">1791</span><a name="line.1791"></a>
-<span class="sourceLineNo">1792</span>    SafePointZigZagLatch attainSafePoint() {<a name="line.1792"></a>
-<span class="sourceLineNo">1793</span>      this.zigzagLatch = new SafePointZigZagLatch();<a name="line.1793"></a>
-<span class="sourceLineNo">1794</span>      return this.zigzagLatch;<a name="line.1794"></a>
-<span class="sourceLineNo">1795</span>    }<a name="line.1795"></a>
-<span class="sourceLineNo">1796</span><a name="line.1796"></a>
-<span class="sourceLineNo">1797</span>    /**<a name="line.1797"></a>
-<span class="sourceLineNo">1798</span>     * Check if we should attain safe point.  If so, go there and then wait till signalled before<a name="line.1798"></a>
-<span class="sourceLineNo">1799</span>     * we proceeding.<a name="line.1799"></a>
-<span class="sourceLineNo">1800</span>     */<a name="line.1800"></a>
-<span class="sourceLineNo">1801</span>    private void attainSafePoint(final long currentSequence) {<a name="line.1801"></a>
-<span class="sourceLineNo">1802</span>      if (this.zigzagLatch == null || !this.zigzagLatch.isCocked()) return;<a name="line.1802"></a>
-<span class="sourceLineNo">1803</span>      // If here, another thread is waiting on us to get to safe point.  Don't leave it hanging.<a name="line.1803"></a>
-<span class="sourceLineNo">1804</span>      beforeWaitOnSafePoint();<a name="line.1804"></a>
-<span class="sourceLineNo">1805</span>      try {<a name="line.1805"></a>
-<span class="sourceLineNo">1806</span>        // Wait on outstanding syncers; wait for them to finish syncing (unless we've been<a name="line.1806"></a>
-<span class="sourceLineNo">1807</span>        // shutdown or unless our latch has been thrown because we have been aborted or unless<a name="line.1807"></a>
-<span class="sourceLineNo">1808</span>        // this WAL is broken and we can't get a sync/append to complete).<a name="line.1808"></a>
-<span class="sourceLineNo">1809</span>        while (!this.shutdown &amp;&amp; this.zigzagLatch.isCocked() &amp;&amp;<a name="line.1809"></a>
-<span class="sourceLineNo">1810</span>            highestSyncedSequence.get() &lt; currentSequence &amp;&amp;<a name="line.1810"></a>
-<span class="sourceLineNo">1811</span>            // We could be in here and all syncs are failing or failed. Check for this. Otherwise<a name="line.1811"></a>
-<span class="sourceLineNo">1812</span>            // we'll just be stuck here for ever. In other words, ensure there syncs running.<a name="line.1812"></a>
-<span class="sourceLineNo">1813</span>            isOutstandingSyncs()) {<a name="line.1813"></a>
-<span class="sourceLineNo">1814</span>          synchronized (this.safePointWaiter) {<a name="line.1814"></a>
-<span class="sourceLineNo">1815</span>            this.safePointWaiter.wait(0, 1);<a name="line.1815"></a>
-<span class="sourceLineNo">1816</span>          }<a name="line.1816"></a>
-<span class="sourceLineNo">1817</span>        }<a name="line.1817"></a>
-<span class="sourceLineNo">1818</span>        // Tell waiting thread we've attained safe point. Can clear this.throwable if set here<a name="line.1818"></a>
-<span class="sourceLineNo">1819</span>        // because we know that next event through the ringbuffer will be going to a new WAL<a name="line.1819"></a>
-<span class="sourceLineNo">1820</span>        // after we do the zigzaglatch dance.<a name="line.1820"></a>
-<span class="sourceLineNo">1821</span>        this.exception = null;<a name="line.1821"></a>
-<span class="sourceLineNo">1822</span>        this.zigzagLatch.safePointAttained();<a name="line.1822"></a>
-<span class="sourceLineNo">1823</span>      } catch (InterruptedException e) {<a name="line.1823"></a>
-<span class="sourceLineNo">1824</span>        LOG.warn("Interrupted ", e);<a name="line.1824"></a>
-<span class="sourceLineNo">1825</span>        Thread.currentThread().interrupt();<a name="line.1825"></a>
-<span class="sourceLineNo">1826</span>      }<a name="line.1826"></a>
-<span class="sourceLineNo">1827</span>    }<a name="line.1827"></a>
-<span class="sourceLineNo">1828</span><a name="line.1828"></a>
-<span class="sourceLineNo">1829</span>    /**<a name="line.1829"></a>
-<span class="sourceLineNo">1830</span>     * Append to the WAL.  Does all CP and WAL listener calls.<a name="line.1830"></a>
-<span class="sourceLineNo">1831</span>     * @param entry<a name="line.1831"></a>
-<span class="sourceLineNo">1832</span>     * @throws Exception<a name="line.1832"></a>
-<span class="sourceLineNo">1833</span>     */<a name="line.1833"></a>
-<span class="sourceLineNo">1834</span>    void append(final FSWALEntry entry) throws Exception {<a name="line.1834"></a>
-<span class="sourceLineNo">1835</span>      // TODO: WORK ON MAKING THIS APPEND FASTER. DOING WAY TOO MUCH WORK WITH CPs, PBing, etc.<a name="line.1835"></a>
-<span class="sourceLineNo">1836</span>      atHeadOfRingBufferEventHandlerAppend();<a name="line.1836"></a>
-<span class="sourceLineNo">1837</span><a name="line.1837"></a>
-<span class="sourceLineNo">1838</span>      long start = EnvironmentEdgeManager.currentTime();<a name="line.1838"></a>
-<span class="sourceLineNo">1839</span>      byte [] encodedRegionName = entry.getKey().getEncodedRegionName();<a name="line.1839"></a>
-<span class="sourceLineNo">1840</span>      long regionSequenceId = WALKey.NO_SEQUENCE_ID;<a name="line.1840"></a>
-<span class="sourceLineNo">1841</span>      try {<a name="line.1841"></a>
-<span class="sourceLineNo">1842</span>        // We are about to append this edit; update the region-scoped sequence number.  Do it<a name="line.1842"></a>
-<span class="sourceLineNo">1843</span>        // here inside this single appending/writing thread.  Events are ordered on the ringbuffer<a name="line.1843"></a>
-<span class="sourceLineNo">1844</span>        // so region sequenceids will also be in order.<a name="line.1844"></a>
-<span class="sourceLineNo">1845</span>        regionSequenceId = entry.stampRegionSequenceId();<a name="line.1845"></a>
-<span class="sourceLineNo">1846</span>        // Edits are empty, there is nothing to append.  Maybe empty when we are looking for a<a name="line.1846"></a>
-<span class="sourceLineNo">1847</span>        // region sequence id only, a region edit/sequence id that is not associated with an actual<a name="line.1847"></a>
-<span class="sourceLineNo">1848</span>        // edit. It has to go through all the rigmarole to be sure we have the right ordering.<a name="line.1848"></a>
-<span class="sourceLineNo">1849</span>        if (entry.getEdit().isEmpty()) {<a name="line.1849"></a>
-<span class="sourceLineNo">1850</span>          return;<a name="line.1850"></a>
-<span class="sourceLineNo">1851</span>        }<a name="line.1851"></a>
-<span class="sourceLineNo">1852</span><a name="line.1852"></a>
-<span class="sourceLineNo">1853</span>        // Coprocessor hook.<a name="line.1853"></a>
-<span class="sourceLineNo">1854</span>        if (!coprocessorHost.preWALWrite(entry.getHRegionInfo(), entry.getKey(),<a name="line.1854"></a>
-<span class="sourceLineNo">1855</span>            entry.getEdit())) {<a name="line.1855"></a>
-<span class="sourceLineNo">1856</span>          if (entry.getEdit().isReplay()) {<a name="line.1856"></a>
-<span class="sourceLineNo">1857</span>            // Set replication scope null so that this won't be replicated<a name="line.1857"></a>
-<span class="sourceLineNo">1858</span>            entry.getKey().setScopes(null);<a name="line.1858"></a>
-<span class="sourceLineNo">1859</span>          }<a name="line.1859"></a>
-<span class="sourceLineNo">1860</span>        }<a name="line.1860"></a>
-<span class="sourceLineNo">1861</span>        if (!listeners.isEmpty()) {<a name="line.1861"></a>
-<span class="sourceLineNo">1862</span>          for (WALActionsListener i: listeners) {<a name="line.1862"></a>
-<span class="sourceLineNo">1863</span>            // TODO: Why does listener take a table description and CPs take a regioninfo?  Fix.<a name="line.1863"></a>
-<span class="sourceLineNo">1864</span>            i.visitLogEntryBeforeWrite(entry.getHTableDescriptor(), entry.getKey(),<a name="line.1864"></a>
-<span class="sourceLineNo">1865</span>              entry.getEdit());<a name="line.1865"></a>
-<span class="sourceLineNo">1866</span>          }<a name="line.1866"></a>
-<span class="sourceLineNo">1867</span>        }<a name="line.1867"></a>
-<span class="sourceLineNo">1868</span><a name="line.1868"></a>
-<span class="sourceLineNo">1869</span>        writer.append(entry);<a name="line.1869"></a>
-<span class="sourceLineNo">1870</span>        assert highestUnsyncedSequence &lt; entry.getSequence();<a name="line.1870"></a>
-<span class="sourceLineNo">1871</span>        highestUnsyncedSequence = entry.getSequence();<a name="line.1871"></a>
-<span class="sourceLineNo">1872</span>        sequenceIdAccounting.update(encodedRegionName, entry.getFamilyNames(), regionSequenceId,<a name="line.1872"></a>
-<span class="sourceLineNo">1873</span>          entry.isInMemstore());<a name="line.1873"></a>
-<span class="sourceLineNo">1874</span>        coprocessorHost.postWALWrite(entry.getHRegionInfo(), entry.getKey(), entry.getEdit());<a name="line.1874"></a>
-<span class="sourceLineNo">1875</span>        // Update metrics.<a name="line.1875"></a>
-<span class="sourceLineNo">1876</span>        postAppend(entry, EnvironmentEdgeManager.currentTime() - start);<a name="line.1876"></a>
-<span class="sourceLineNo">1877</span>      } catch (Exception e) {<a name="line.1877"></a>
-<span class="sourceLineNo">1878</span>        String msg = "Append sequenceId=" + regionSequenceId +<a name="line.1878"></a>
-<span class="sourceLineNo">1879</span>          ", requesting roll of WAL";<a name="line.1879"></a>
-<span class="sourceLineNo">1880</span>        LOG.warn(msg, e);<a name="line.1880"></a>
-<span class="sourceLineNo">1881</span>        requestLogRoll();<a name="line.1881"></a>
-<span class="sourceLineNo">1882</span>        throw new DamagedWALException(msg, e);<a name="line.1882"></a>
-<span class="sourceLineNo">1883</span>      }<a name="line.1883"></a>
-<span class="sourceLineNo">1884</span>      numEntries.incrementAndGet();<a name="line.1884"></a>
-<span class="sourceLineNo">1885</span>    }<a name="line.1885"></a>
-<span class="sourceLineNo">1886</span><a name="line.1886"></a>
-<span class="sourceLineNo">1887</span>    @Override<a name="line.1887"></a>
-<span class="sourceLineNo">1888</span>    public void onStart() {<a name="line.1888"></a>
-<span class="sourceLineNo">1889</span>      for (SyncRunner syncRunner: this.syncRunners) syncRunner.start();<a name="line.1889"></a>
-<span class="sourceLineNo">1890</span>    }<a name="line.1890"></a>
+<span class="sourceLineNo">1792</span>    /**<a name="line.1792"></a>
+<span class="sourceLineNo">1793</span>     * Check if we should attain safe point.  If so, go there and then wait till signalled before<a name="line.1793"></a>
+<span class="sourceLineNo">1794</span>     * we proceeding.<a name="line.1794"></a>
+<span class="sourceLineNo">1795</span>     */<a name="line.1795"></a>
+<span class="sourceLineNo">1796</span>    private void attainSafePoint(final long currentSequence) {<a name="line.1796"></a>
+<span class="sourceLineNo">1797</span>      if (this.zigzagLatch == null || !this.zigzagLatch.isCocked()) return;<a name="line.1797"></a>
+<span class="sourceLineNo">1798</span>      // If here, another thread is waiting on us to get to safe point.  Don't leave it hanging.<a name="line.1798"></a>
+<span class="sourceLineNo">1799</span>      beforeWaitOnSafePoint();<a name="line.1799"></a>
+<span class="sourceLineNo">1800</span>      try {<a name="line.1800"></a>
+<span class="sourceLineNo">1801</span>        // Wait on outstanding syncers; wait for them to finish syncing (unless we've been<a name="line.1801"></a>
+<span class="sourceLineNo">1802</span>        // shutdown or unless our latch has been thrown because we have been aborted or unless<a name="line.1802"></a>
+<span class="sourceLineNo">1803</span>        // this WAL is broken and we can't get a sync/append to complete).<a name="line.1803"></a>
+<span class="sourceLineNo">1804</span>        while (!this.shutdown &amp;&amp; this.zigzagLatch.isCocked() &amp;&amp;<a name="line.1804"></a>
+<span class="sourceLineNo">1805</span>            highestSyncedSequence.get() &lt; currentSequence &amp;&amp;<a name="line.1805"></a>
+<span class="sourceLineNo">1806</span>            // We could be in here and all syncs are failing or failed. Check for this. Otherwise<a name="line.1806"></a>
+<span class="sourceLineNo">1807</span>            // we'll just be stuck here for ever. In other words, ensure there syncs running.<a name="line.1807"></a>
+<span class="sourceLineNo">1808</span>            isOutstandingSyncs()) {<a name="line.1808"></a>
+<span class="sourceLineNo">1809</span>          synchronized (this.safePointWaiter) {<a name="line.1809"></a>
+<span class="sourceLineNo">1810</span>            this.safePointWaiter.wait(0, 1);<a name="line.1810"></a>
+<span class="sourceLineNo">1811</span>          }<a name="line.1811"></a>
+<span class="sourceLineNo">1812</span>        }<a name="line.1812"></a>
+<span class="sourceLineNo">1813</span>        // Tell waiting thread we've attained safe point. Can clear this.throwable if set here<a name="line.1813"></a>
+<span class="sourceLineNo">1814</span>        // because we know that next event through the ringbuffer will be going to a new WAL<a name="line.1814"></a>
+<span class="sourceLineNo">1815</span>        // after we do the zigzaglatch dance.<a name="line.1815"></a>
+<span class="sourceLineNo">1816</span>        this.exception = null;<a name="line.1816"></a>
+<span class="sourceLineNo">1817</span>        this.zigzagLatch.safePointAttained();<a name="line.1817"></a>
+<span class="sourceLineNo">1818</span>      } catch (InterruptedException e) {<a name="line.1818"></a>
+<span class="sourceLineNo">1819</span>        LOG.warn("Interrupted ", e);<a name="line.1819"></a>
+<span class="sourceLineNo">1820</span>        Thread.currentThread().interrupt();<a name="line.1820"></a>
+<span class="sourceLineNo">1821</span>      }<a name="line.1821"></a>
+<span class="sourceLineNo">1822</span>    }<a name="line.1822"></a>
+<span class="sourceLineNo">1823</span><a name="line.1823"></a>
+<span class="sourceLineNo">1824</span>    /**<a name="line.1824"></a>
+<span class="sourceLineNo">1825</span>     * Append to the WAL.  Does all CP and WAL listener calls.<a name="line.1825"></a>
+<span class="sourceLineNo">1826</span>     * @param entry<a name="line.1826"></a>
+<span class="sourceLineNo">1827</span>     * @throws Exception<a name="line.1827"></a>
+<span class="sourceLineNo">1828</span>     */<a name="line.1828"></a>
+<span class="sourceLineNo">1829</span>    void append(final FSWALEntry entry) throws Exception {<a name="line.1829"></a>
+<span class="sourceLineNo">1830</span>      // TODO: WORK ON MAKING THIS APPEND FASTER. DOING WAY TOO MUCH WORK WITH CPs, PBing, etc.<a name="line.1830"></a>
+<span class="sourceLineNo">1831</span>      atHeadOfRingBufferEventHandlerAppend();<a name="line.1831"></a>
+<span class="sourceLineNo">1832</span><a name="line.1832"></a>
+<span class="sourceLineNo">1833</span>      long start = EnvironmentEdgeManager.currentTime();<a name="line.1833"></a>
+<span class="sourceLineNo">1834</span>      byte [] encodedRegionName = entry.getKey().getEncodedRegionName();<a name="line.1834"></a>
+<span class="sourceLineNo">1835</span>      long regionSequenceId = WALKey.NO_SEQUENCE_ID;<a name="line.1835"></a>
+<span class="sourceLineNo">1836</span>      try {<a name="line.1836"></a>
+<span class="sourceLineNo">1837</span>        // We are about to append this edit; update the region-scoped sequence number.  Do it<a name="line.1837"></a>
+<span class="sourceLineNo">1838</span>        // here inside this single appending/writing thread.  Events are ordered on the ringbuffer<a name="line.1838"></a>
+<span class="sourceLineNo">1839</span>        // so region sequenceids will also be in order.<a name="line.1839"></a>
+<span class="sourceLineNo">1840</span>        regionSequenceId = entry.stampRegionSequenceId();<a name="line.1840"></a>
+<span class="sourceLineNo">1841</span>        // Edits are empty, there is nothing to append.  Maybe empty when we are looking for a<a name="line.1841"></a>
+<span class="sourceLineNo">1842</span>        // region sequence id only, a region edit/sequence id that is not associated with an actual<a name="line.1842"></a>
+<span class="sourceLineNo">1843</span>        // edit. It has to go through all the rigmarole to be sure we have the right ordering.<a name="line.1843"></a>
+<span class="sourceLineNo">1844</span>        if (entry.getEdit().isEmpty()) {<a name="line.1844"></a>
+<span class="sourceLineNo">1845</span>          return;<a name="line.1845"></a>
+<span class="sourceLineNo">1846</span>        }<a name="line.1846"></a>
+<span class="sourceLineNo">1847</span><a name="line.1847"></a>
+<span class="sourceLineNo">1848</span>        // Coprocessor hook.<a name="line.1848"></a>
+<span class="sourceLineNo">1849</span>        if (!coprocessorHost.preWALWrite(entry.getHRegionInfo(), entry.getKey(),<a name="line.1849"></a>
+<span class="sourceLineNo">1850</span>            entry.getEdit())) {<a name="line.1850"></a>
+<span class="sourceLineNo">1851</span>          if (entry.getEdit().isReplay()) {<a name="line.1851"></a>
+<span class="sourceLineNo">1852</span>            // Set replication scope null so that this won't be replicated<a name="line.1852"></a>
+<span class="sourceLineNo">1853</span>            entry.getKey().setScopes(null);<a name="line.1853"></a>
+<span class="sourceLineNo">1854</span>          }<a name="line.1854"></a>
+<span class="sourceLineNo">1855</span>        }<a name="line.1855"></a>
+<span class="sourceLineNo">1856</span>        if (!listeners.isEmpty()) {<a name="line.1856"></a>
+<span class="sourceLineNo">1857</span>          for (WALActionsListener i: listeners) {<a name="line.1857"></a>
+<span class="sourceLineNo">1858</span>            // TODO: Why does listener take a table description and CPs take a regioninfo?  Fix.<a name="line.1858"></a>
+<span class="sourceLineNo">1859</span>            i.visitLogEntryBeforeWrite(entry.getHTableDescriptor(), entry.getKey(),<a name="line.1859"></a>
+<span class="sourceLineNo">1860</span>              entry.getEdit());<a name="line.1860"></a>
+<span class="sourceLineNo">1861</span>          }<a name="line.1861"></a>
+<span class="sourceLineNo">1862</span>        }<a name="line.1862"></a>
+<span class="sourceLineNo">1863</span><a name="line.1863"></a>
+<span class="sourceLineNo">1864</span>        writer.append(entry);<a name="line.1864"></a>
+<span class="sourceLineNo">1865</span>        assert highestUnsyncedSequence &lt; entry.getSequence();<a name="line.1865"></a>
+<span class="sourceLineNo">1866</span>        highestUnsyncedSequence = entry.getSequence();<a name="line.1866"></a>
+<span class="sourceLineNo">1867</span>        sequenceIdAccounting.update(encodedRegionName, entry.getFamilyNames(), regionSequenceId,<a name="line.1867"></a>
+<span class="sourceLineNo">1868</span>          entry.isInMemstore());<a name="line.1868"></a>
+<span class="sourceLineNo">1869</span>        coprocessorHost.postWALWrite(entry.getHRegionInfo(), entry.getKey(), entry.getEdit());<a name="line.1869"></a>
+<span class="sourceLineNo">1870</span>        // Update metrics.<a name="line.1870"></a>
+<span class="sourceLineNo">1871</span>        postAppend(entry, EnvironmentEdgeManager.currentTime() - start);<a name="line.1871"></a>
+<span class="sourceLineNo">1872</span>      } catch (Exception e) {<a name="line.1872"></a>
+<span class="sourceLineNo">1873</span>        String msg = "Append sequenceId=" + regionSequenceId + ", requesting roll of WAL";<a name="line.1873"></a>
+<span class="sourceLineNo">1874</span>        LOG.warn(msg, e);<a name="line.1874"></a>
+<span class="sourceLineNo">1875</span>        requestLogRoll();<a name="line.1875"></a>
+<span class="sourceLineNo">1876</span>        throw new DamagedWALException(msg, e);<a name="line.1876"></a>
+<span class="sourceLineNo">1877</span>      }<a name="line.1877"></a>
+<span class="sourceLineNo">1878</span>      numEntries.incrementAndGet();<a name="line.1878"></a>
+<span class="sourceLineNo">1879</span>    }<a name="line.1879"></a>
+<span class="sourceLineNo">1880</span><a name="line.1880"></a>
+<span class="sourceLineNo">1881</span>    @Override<a name="line.1881"></a>
+<span class="sourceLineNo">1882</span>    public void onStart() {<a name="line.1882"></a>
+<span class="sourceLineNo">1883</span>      for (SyncRunner syncRunner: this.syncRunners) syncRunner.start();<a name="line.1883"></a>
+<span class="sourceLineNo">1884</span>    }<a name="line.1884"></a>
+<span class="sourceLineNo">1885</span><a name="line.1885"></a>
+<span class="sourceLineNo">1886</span>    @Override<a name="line.1886"></a>
+<span class="sourceLineNo">1887</span>    public void onShutdown() {<a name="line.1887"></a>
+<span class="sourceLineNo">1888</span>      for (SyncRunner syncRunner: this.syncRunners) syncRunner.interrupt();<a name="line.1888"></a>
+<span class="sourceLineNo">1889</span>    }<a name="line.1889"></a>
+<span class="sourceLineNo">1890</span>  }<a name="line.1890"></a>
 <span class="sourceLineNo">1891</span><a name="line.1891"></a>
-<span class="sourceLineNo">1892</span>    @Override<a name="line.1892"></a>
-<span class="sourceLineNo">1893</span>    public void onShutdown() {<a name="line.1893"></a>
-<span class="sourceLineNo">1894</span>      for (SyncRunner syncRunner: this.syncRunners) syncRunner.interrupt();<a name="line.1894"></a>
-<span class="sourceLineNo">1895</span>    }<a name="line.1895"></a>
-<span class="sourceLineNo">1896</span>  }<a name="line.1896"></a>
-<span class="sourceLineNo">1897</span><a name="line.1897"></a>
-<span class="sourceLineNo">1898</span>  /**<a name="line.1898"></a>
-<span class="sourceLineNo">1899</span>   * Exposed for testing only.  Use to tricks like halt the ring buffer appending.<a name="line.1899"></a>
-<span class="sourceLineNo">1900</span>   */<a name="line.1900"></a>
-<span class="sourceLineNo">1901</span>  @VisibleForTesting<a name="line.1901"></a>
-<span class="sourceLineNo">1902</span>  void atHeadOfRingBufferEventHandlerAppend() {<a name="line.1902"></a>
-<span class="sourceLineNo">1903</span>    // Noop<a name="line.1903"></a>
-<span class="sourceLineNo">1904</span>  }<a name="line.1904"></a>
-<span class="sourceLineNo">1905</span><a name="line.1905"></a>
-<span class="sourceLineNo">1906</span>  private static IOException ensureIOException(final Throwable t) {<a name="line.1906"></a>
-<span class="sourceLineNo">1907</span>    return (t instanceof IOException)? (IOException)t: new IOException(t);<a name="line.1907"></a>
-<span class="sourceLineNo">1908</span>  }<a name="line.1908"></a>
-<span class="sourceLineNo">1909</span><a name="line.1909"></a>
-<span class="sourceLineNo">1910</span>  private static void usage() {<a name="line.1910"></a>
-<span class="sourceLineNo">1911</span>    System.err.println("Usage: FSHLog &lt;ARGS&gt;");<a name="line.1911"></a>
-<span class="sourceLineNo">1912</span>    System.err.println("Arguments:");<a name="line.1912"></a>
-<span class="sourceLineNo">1913</span>    System.err.println(" --dump  Dump textual representation of passed one or more files");<a name="line.1913"></a>
-<span class="sourceLineNo">1914</span>    System.err.println("         For example: " +<a name="line.1914"></a>
-<span class="sourceLineNo">1915</span>      "FSHLog --dump hdfs://example.com:9000/hbase/.logs/MACHINE/LOGFILE");<a name="line.1915"></a>
-<span class="sourceLineNo">1916</span>    System.err.println(" --split Split the passed directory of WAL logs");<a name="line.1916"></a>
-<span class="sourceLineNo">1917</span>    System.err.println("         For example: " +<a name="line.1917"></a>
-<span class="sourceLineNo">1918</span>      "FSHLog --split hdfs://example.com:9000/hbase/.logs/DIR");<a name="line.1918"></a>
-<span class="sourceLineNo">1919</span>  }<a name="line.1919"></a>
-<span class="sourceLineNo">1920</span><a name="line.1920"></a>
-<span class="sourceLineNo">1921</span>  /**<a name="line.1921"></a>
-<span class="sourceLineNo">1922</span>   * Pass one or more log file names and it will either dump out a text version<a name="line.1922"></a>
-<span class="sourceLineNo">1923</span>   * on &lt;code&gt;stdout&lt;/code&gt; or split the specified log files.<a name="line.1923"></a>
-<span class="sourceLineNo">1924</span>   *<a name="line.1924"></a>
-<span class="sourceLineNo">1925</span>   * @param args<a name="line.1925"></a>
-<span class="sourceLineNo">1926</span>   * @throws IOException<a name="line.1926"></a>
-<span class="sourceLineNo">1927</span>   */<a name="line.1927"></a>
-<span class="sourceLineNo">1928</span>  public static void main(String[] args) throws IOException {<a name="line.1928"></a>
-<span class="sourceLineNo">1929</span>    if (args.length &lt; 2) {<a name="line.1929"></a>
-<span class="sourceLineNo">1930</span>      usage();<a name="line.1930"></a>
-<span class="sourceLineNo">1931</span>      System.exit(-1);<a name="line.1931"></a>
-<span class="sourceLineNo">1932</span>    }<a name="line.1932"></a>
-<span class="sourceLineNo">1933</span>    // either dump using the WALPrettyPrinter or split, depending on args<a name="line.1933"></a>
-<span class="sourceLineNo">1934</span>    if (args[0].compareTo("--dump") == 0) {<a name="line.1934"></a>
-<span class="sourceLineNo">1935</span>      WALPrettyPrinter.run(Arrays.copyOfRange(args, 1, args.length));<a name="line.1935"></a>
-<span class="sourceLineNo">1936</span>    } else if (args[0].compareTo("--perf") == 0) {<a name="line.1936"></a>
-<span class="sourceLineNo">1937</span>      LOG.fatal("Please use the WALPerformanceEvaluation tool instead. i.e.:");<a name="line.1937"></a>
-<span class="sourceLineNo">1938</span>      LOG.fatal("\thbase org.apache.hadoop.hbase.wal.WALPerformanceEvaluation --iterations " +<a name="line.1938"></a>
-<span class="sourceLineNo">1939</span>          args[1]);<a name="line.1939"></a>
-<span class="sourceLineNo">1940</span>      System.exit(-1);<a name="line.1940"></a>
-<span class="sourceLineNo">1941</span>    } else if (args[0].compareTo("--split") == 0) {<a name="line.1941"></a>
-<span class="sourceLineNo">1942</span>      Configuration conf = HBaseConfiguration.create();<a name="line.1942"></a>
-<span class="sourceLineNo">1943</span>      for (int i = 1; i &lt; args.length; i++) {<a name="line.1943"></a>
-<span class="sourceLineNo">1944</span>        try {<a name="line.1944"></a>
-<span class="sourceLineNo">1945</span>          Path logPath = new Path(args[i]);<a name="line.1945"></a>
-<span class="sourceLineNo">1946</span>          FSUtils.setFsDefault(conf, logPath);<a name="line.1946"></a>
-<span class="sourceLineNo">1947</span>          split(conf, logPath);<a name="line.1947"></a>
-<span class="sourceLineNo">1948</span>        } catch (IOException t) {<a name="line.1948"></a>
-<span class="sourceLineNo">1949</span>          t.printStackTrace(System.err);<a name="line.1949"></a>
-<span class="sourceLineNo">1950</span>          System.exit(-1);<a name="line.1950"></a>
-<span class="sourceLineNo">1951</span>        }<a name="line.1951"></a>
-<span class="sourceLineNo">1952</span>      }<a name="line.1952"></a>
-<span class="sourceLineNo">1953</span>    } else {<a name="line.1953"></a>
-<span class="sourceLineNo">1954</span>      usage();<a name="line.1954"></a>
-<span class="sourceLineNo">1955</span>      System.exit(-1);<a name="line.1955"></a>
-<span class="sourceLineNo">1956</span>    }<a name="line.1956"></a>
-<span class="sourceLineNo">1957</span>  }<a name="line.1957"></a>
-<span class="sourceLineNo">1958</span><a name="line.1958"></a>
-<span class="sourceLineNo">1959</span>  /**<a name="line.1959"></a>
-<span class="sourceLineNo">1960</span>   * This method gets the pipeline for the current WAL.<a name="line.1960"></a>
-<span class="sourceLineNo">1961</span>   */<a name="line.1961"></a>
-<span class="sourceLineNo">1962</span>  @VisibleForTesting<a name="line.1962"></a>
-<span class="sourceLineNo">1963</span>  DatanodeInfo[] getPipeLine() {<a name="line.1963"></a>
-<span class="sourceLineNo">1964</span>    if (this.hdfs_out != null) {<a name="line.1964"></a>
-<span class="sourceLineNo">1965</span>      if (this.hdfs_out.getWrappedStream() instanceof DFSOutputStream) {<a name="line.1965"></a>
-<span class="sourceLineNo">1966</span>        return ((DFSOutputStream) this.hdfs_out.getWrappedStream()).getPipeline();<a name="line.1966"></a>
-<span class="sourceLineNo">1967</span>      }<a name="line.1967"></a>
-<span class="sourceLineNo">1968</span>    }<a name="line.1968"></a>
-<span class="sourceLineNo">1969</span>    return new DatanodeInfo[0];<a name="line.1969"></a>
-<span class="sourceLineNo">1970</span>  }<a name="line.1970"></a>
-<span class="sourceLineNo">1971</span>}<a name="line.1971"></a>
+<span class="sourceLineNo">1892</span>  /**<a name="line.1892"></a>
+<span class="sourceLineNo">1893</span>   * Exposed for testing only.  Use to tricks like halt the ring buffer appending.<a name="line.1893"></a>
+<span class="sourceLineNo">1894</span>   */<a name="line.1894"></a>
+<span class="sourceLineNo">1895</span>  @VisibleForTesting<a name="line.1895"></a>
+<span class="sourceLineNo">1896</span>  void atHeadOfRingBufferEventHandlerAppend() {<a name="line.1896"></a>
+<span class="sourceLineNo">1897</span>    // Noop<a name="line.1897"></a>
+<span class="sourceLineNo">1898</span>  }<a name="line.1898"></a>
+<span class="sourceLineNo">1899</span><a name="line.1899"></a>
+<span class="sourceLineNo">1900</span>  private static IOException ensureIOException(final Throwable t) {<a name="line.1900"></a>
+<span class="sourceLineNo">1901</span>    return (t instanceof IOException)? (IOException)t: new IOException(t);<a name="line.1901"></a>
+<span class="sourceLineNo">1902</span>  }<a name="line.1902"></a>
+<span class="sourceLineNo">1903</span><a name="line.1903"></a>
+<span class="sourceLineNo">1904</span>  private static void usage() {<a name="line.1904"></a>
+<span class="sourceLineNo">1905</span>    System.err.println("Usage: FSHLog &lt;ARGS&gt;");<a name="line.1905"></a>
+<span class="sourceLineNo">1906</span>    System.err.println("Arguments:");<a name="line.1906"></a>
+<span class="sourceLineNo">1907</span>    System.err.println(" --dump  Dump textual representation of passed one or more files");<a name="line.1907"></a>
+<span class="sourceLineNo">1908</span>    System.err.println("         For example: " +<a name="line.1908"></a>
+<span class="sourceLineNo">1909</span>      "FSHLog --dump hdfs://example.com:9000/hbase/.logs/MACHINE/LOGFILE");<a name="line.1909"></a>
+<span class="sourceLineNo">1910</span>    System.err.println(" --split Split the passed directory of WAL logs");<a name="line.1910"></a>
+<span class="sourceLineNo">1911</span>    System.err.println("         For example: " +<a name="line.1911"></a>
+<span class="sourceLineNo">1912</span>      "FSHLog --split hdfs://example.com:9000/hbase/.logs/DIR");<a name="line.1912"></a>
+<span class="sourceLineNo">1913</span>  }<a name="line.1913"></a>
+<span class="sourceLineNo">1914</span><a name="line.1914"></a>
+<span class="sourceLineNo">1915</span>  /**<a name="line.1915"></a>
+<span class="sourceLineNo">1916</span>   * Pass one or more log file names and it will either dump out a text version<a name="line.1916"></a>
+<span class="sourceLineNo">1917</span>   * on &lt;code&gt;stdout&lt;/code&gt; or split the specified log files.<a name="line.1917"></a>
+<span class="sourceLineNo">1918</span>   *<a name="line.1918"></a>
+<span class="sourceLineNo">1919</span>   * @param args<a name="line.1919"></a>
+<span class="sourceLineNo">1920</span>   * @throws IOException<a name="line.1920"></a>
+<span class="sourceLineNo">1921</span>   */<a name="line.1921"></a>
+<span class="sourceLineNo">1922</span>  public static void main(String[] args) throws IOException {<a name="line.1922"></a>
+<span class="sourceLineNo">1923</span>    if (args.length &lt; 2) {<a name="line.1923"></a>
+<span class="sourceLineNo">1924</span>      usage();<a name="line.1924"></a>
+<span class="sourceLineNo">1925</span>      System.exit(-1);<a name="line.1925"></a>
+<span class="sourceLineNo">1926</span>    }<a name="line.1926"></a>
+<span class="sourceLineNo">1927</span>    // either dump using the WALPrettyPrinter or split, depending on args<a name="line.1927"></a>
+<span class="sourceLineNo">1928</span>    if (args[0].compareTo("--dump") == 0) {<a name="line.1928"></a>
+<span class="sourceLineNo">1929</span>      WALPrettyPrinter.run(Arrays.copyOfRange(args, 1, args.length));<a name="line.1929"></a>
+<span class="sourceLineNo">1930</span>    } else if (args[0].compareTo("--perf") == 0) {<a name="line.1930"></a>
+<span class="sourceLineNo">1931</span>      LOG.fatal("Please use the WALPerformanceEvaluation tool instead. i.e.:");<a name="line.1931"></a>
+<span class="sourceLineNo">1932</span>      LOG.fatal("\thbase org.apache.hadoop.hbase.wal.WALPerformanceEvaluation --iterations " +<a name="line.1932"></a>
+<span class="sourceLineNo">1933</span>          args[1]);<a name="line.1933"></a>
+<span class="sourceLineNo">1934</span>      System.exit(-1);<a name="line.1934"></a>
+<span class="sourceLineNo">1935</span>    } else if (args[0].compareTo("--split") == 0) {<a name="line.1935"></a>
+<span class="sourceLineNo">1936</span>      Configuration conf = HBaseConfiguration.create();<a name="line.1936"></a>
+<span class="sourceLineNo">1937</span>      for (int i = 1; i &lt; args.length; i++) {<a name="line.1937"></a>
+<span class="sourceLineNo">1938</span>        try {<a name="line.1938"></a>
+<span class="sourceLineNo">1939</span>          Path logPath = new Path(args[i]);<a name="line.1939"></a>
+<span class="sourceLineNo">1940</span>          FSUtils.setFsDefault(conf, logPath);<a name="line.1940"></a>
+<span class="sourceLineNo">1941</span>          split(conf, logPath);<a name="line.1941"></a>
+<span class="sourceLineNo">1942</span>        } catch (IOException t) {<a name="line.1942"></a>
+<span class="sourceLineNo">1943</span>          t.printStackTrace(System.err);<a name="line.1943"></a>
+<span class="sourceLineNo">1944</span>          System.exit(-1);<a name="line.1944"></a>
+<span class="sourceLineNo">1945</span>        }<a name="line.1945"></a>
+<span class="sourceLineNo">1946</span>      }<a name="line.1946"></a>
+<span class="sourceLineNo">1947</span>    } else {<a name="line.1947"></a>
+<span class="sourceLineNo">1948</span>      usage();<a name="line.1948"></a>
+<span class="sourceLineNo">1949</span>      System.exit(-1);<a name="line.1949"></a>
+<span class="sourceLineNo">1950</span>    }<a name="line.1950"></a>
+<span class="sourceLineNo">1951</span>  }<a name="line.1951"></a>
+<span class="sourceLineNo">1952</span><a name="line.1952"></a>
+<span class="sourceLineNo">1953</span>  /**<a name="line.1953"></a>
+<span class="sourceLineNo">1954</span>   * This method gets the pipeline for the current WAL.<a name="line.1954"></a>
+<span class="sourceLineNo">1955</span>   */<a name="line.1955"></a>
+<span class="sourceLineNo">1956</span>  @VisibleForTesting<a name="line.1956"></a>
+<span class="sourceLineNo">1957</span>  DatanodeInfo[] getPipeLine() {<a name="line.1957"></a>
+<span class="sourceLineNo">1958</span>    if (this.hdfs_out != null) {<a name="line.1958"></a>
+<span class="sourceLineNo">1959</span>      if (this.hdfs_out.getWrappedStream() instanceof DFSOutputStream) {<a name="line.1959"></a>
+<span class="sourceLineNo">1960</span>        return ((DFSOutputStream) this.hdfs_out.getWrappedStream()).getPipeline();<a name="line.1960"></a>
+<span class="sourceLineNo">1961</span>      }<a name="line.1961"></a>
+<span class="sourceLineNo">1962</span>    }<a name="line.1962"></a>
+<span class="sourceLineNo">1963</span>    return new DatanodeInfo[0];<a name="line.1963"></a>
+<span class="sourceLineNo">1964</span>  }<a name="line.1964"></a>
+<span class="sourceLineNo">1965</span>}<a name="line.1965"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/f843f57d/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/wal/FSHLog.SafePointZigZagLatch.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/wal/FSHLog.SafePointZigZagLatch.html b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/wal/FSHLog.SafePointZigZagLatch.html
index ca636ce..06e7632 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/wal/FSHLog.SafePointZigZagLatch.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/wal/FSHLog.SafePointZigZagLatch.html
@@ -1761,222 +1761,216 @@
 <span class="sourceLineNo">1753</span>        }<a name="line.1753"></a>
 <span class="sourceLineNo">1754</span><a name="line.1754"></a>
 <span class="sourceLineNo">1755</span>        // TODO: Check size and if big go ahead and call a sync if we have enough data.<a name="line.1755"></a>
-<span class="sourceLineNo">1756</span><a name="line.1756"></a>
-<span class="sourceLineNo">1757</span>        // If not a batch, return to consume more events from the ring buffer before proceeding;<a name="line.1757"></a>
-<span class="sourceLineNo">1758</span>        // we want to get up a batch of syncs and appends before we go do a filesystem sync.<a name="line.1758"></a>
-<span class="sourceLineNo">1759</span>        if (!endOfBatch || this.syncFuturesCount &lt;= 0) return;<a name="line.1759"></a>
-<span class="sourceLineNo">1760</span><a name="line.1760"></a>
-<span class="sourceLineNo">1761</span>        // Now we have a batch.<a name="line.1761"></a>
-<span class="sourceLineNo">1762</span><a name="line.1762"></a>
-<span class="sourceLineNo">1763</span>        if (LOG.isTraceEnabled()) {<a name="line.1763"></a>
-<span class="sourceLineNo">1764</span>          LOG.trace("Sequence=" + sequence + ", syncCount=" + this.syncFuturesCount);<a name="line.1764"></a>
-<span class="sourceLineNo">1765</span>        }<a name="line.1765"></a>
-<span class="sourceLineNo">1766</span><a name="line.1766"></a>
-<span class="sourceLineNo">1767</span>        if (this.exception == null) {<a name="line.1767"></a>
-<span class="sourceLineNo">1768</span>          // Below expects that the offer 'transfers' responsibility for the outstanding syncs to<a name="line.1768"></a>
-<span class="sourceLineNo">1769</span>          // the syncRunner. We should never get an exception in here.<a name="line.1769"></a>
-<span class="sourceLineNo">1770</span>          this.syncRunnerIndex = (this.syncRunnerIndex + 1) % this.syncRunners.length;<a name="line.1770"></a>
-<span class="sourceLineNo">1771</span>          try {<a name="line.1771"></a>
-<span class="sourceLineNo">1772</span>            this.syncRunners[this.syncRunnerIndex].offer(sequence, this.syncFutures,<a name="line.1772"></a>
-<span class="sourceLineNo">1773</span>              this.syncFuturesCount);<a name="line.1773"></a>
-<span class="sourceLineNo">1774</span>          } catch (Exception e) {<a name="line.1774"></a>
-<span class="sourceLineNo">1775</span>            // Should NEVER get here.<a name="line.1775"></a>
-<span class="sourceLineNo">1776</span>            requestLogRoll();<a name="line.1776"></a>
-<span class="sourceLineNo">1777</span>            this.exception = new DamagedWALException("Failed offering sync", e);<a name="line.1777"></a>
-<span class="sourceLineNo">1778</span>          }<a name="line.1778"></a>
+<span class="sourceLineNo">1756</span>        // This is a sync. If existing exception, fall through. Else look to see if batch.<a name="line.1756"></a>
+<span class="sourceLineNo">1757</span>        if (this.exception == null) {<a name="line.1757"></a>
+<span class="sourceLineNo">1758</span>          // If not a batch, return to consume more events from the ring buffer before proceeding;<a name="line.1758"></a>
+<span class="sourceLineNo">1759</span>          // we want to get up a batch of syncs and appends before we go do a filesystem sync.<a name="line.1759"></a>
+<span class="sourceLineNo">1760</span>          if (!endOfBatch || this.syncFuturesCount &lt;= 0) return;<a name="line.1760"></a>
+<span class="sourceLineNo">1761</span>          // Below expects that the offer 'transfers' responsibility for the outstanding syncs to<a name="line.1761"></a>
+<span class="sourceLineNo">1762</span>          // the syncRunner. We should never get an exception in here.<a name="line.1762"></a>
+<span class="sourceLineNo">1763</span>          this.syncRunnerIndex = (this.syncRunnerIndex + 1) % this.syncRunners.length;<a name="line.1763"></a>
+<span class="sourceLineNo">1764</span>          try {<a name="line.1764"></a>
+<span class="sourceLineNo">1765</span>            this.syncRunners[this.syncRunnerIndex].offer(sequence, this.syncFutures,<a name="line.1765"></a>
+<span class="sourceLineNo">1766</span>              this.syncFuturesCount);<a name="line.1766"></a>
+<span class="sourceLineNo">1767</span>          } catch (Exception e) {<a name="line.1767"></a>
+<span class="sourceLineNo">1768</span>            // Should NEVER get here.<a name="line.1768"></a>
+<span class="sourceLineNo">1769</span>            requestLogRoll();<a name="line.1769"></a>
+<span class="sourceLineNo">1770</span>            this.exception = new DamagedWALException("Failed offering sync", e);<a name="line.1770"></a>
+<span class="sourceLineNo">1771</span>          }<a name="line.1771"></a>
+<span class="sourceLineNo">1772</span>        }<a name="line.1772"></a>
+<span class="sourceLineNo">1773</span>        // We may have picked up an exception above trying to offer sync<a name="line.1773"></a>
+<span class="sourceLineNo">1774</span>        if (this.exception != null) {<a name="line.1774"></a>
+<span class="sourceLineNo">1775</span>          cleanupOutstandingSyncsOnException(sequence,<a name="line.1775"></a>
+<span class="sourceLineNo">1776</span>            this.exception instanceof DamagedWALException?<a name="line.1776"></a>
+<span class="sourceLineNo">1777</span>              this.exception:<a name="line.1777"></a>
+<span class="sourceLineNo">1778</span>              new DamagedWALException("On sync", this.exception));<a name="line.1778"></a>
 <span class="sourceLineNo">1779</span>        }<a name="line.1779"></a>
-<span class="sourceLineNo">1780</span>        // We may have picked up an exception above trying to offer sync<a name="line.1780"></a>
-<span class="sourceLineNo">1781</span>        if (this.exception != null) {<a name="line.1781"></a>
-<span class="sourceLineNo">1782</span>          cleanupOutstandingSyncsOnException(sequence,<a name="line.1782"></a>
-<span class="sourceLineNo">1783</span>            new DamagedWALException("On sync", this.exception));<a name="line.1783"></a>
-<span class="sourceLineNo">1784</span>        }<a name="line.1784"></a>
-<span class="sourceLineNo">1785</span>        attainSafePoint(sequence);<a name="line.1785"></a>
-<span class="sourceLineNo">1786</span>        this.syncFuturesCount = 0;<a name="line.1786"></a>
-<span class="sourceLineNo">1787</span>      } catch (Throwable t) {<a name="line.1787"></a>
-<span class="sourceLineNo">1788</span>        LOG.error("UNEXPECTED!!! syncFutures.length=" + this.syncFutures.length, t);<a name="line.1788"></a>
-<span class="sourceLineNo">1789</span>      }<a name="line.1789"></a>
+<span class="sourceLineNo">1780</span>        attainSafePoint(sequence);<a name="line.1780"></a>
+<span class="sourceLineNo">1781</span>        this.syncFuturesCount = 0;<a name="line.1781"></a>
+<span class="sourceLineNo">1782</span>      } catch (Throwable t) {<a name="line.1782"></a>
+<span class="sourceLineNo">1783</span>        LOG.error("UNEXPECTED!!! syncFutures.length=" + this.syncFutures.length, t);<a name="line.1783"></a>
+<span class="sourceLineNo">1784</span>      }<a name="line.1784"></a>
+<span class="sourceLineNo">1785</span>    }<a name="line.1785"></a>
+<span class="sourceLineNo">1786</span><a name="line.1786"></a>
+<span class="sourceLineNo">1787</span>    SafePointZigZagLatch attainSafePoint() {<a name="line.1787"></a>
+<span class="sourceLineNo">1788</span>      this.zigzagLatch = new SafePointZigZagLatch();<a name="line.1788"></a>
+<span class="sourceLineNo">1789</span>      return this.zigzagLatch;<a name="line.1789"></a>
 <span class="sourceLineNo">1790</span>    }<a name="line.1790"></a>
 <span class="sourceLineNo">1791</span><a name="line.1791"></a>
-<span class="sourceLineNo">1792</span>    SafePointZigZagLatch attainSafePoint() {<a name="line.1792"></a>
-<span class="sourceLineNo">1793</span>      this.zigzagLatch = new SafePointZigZagLatch();<a name="line.1793"></a>
-<span class="sourceLineNo">1794</span>      return this.zigzagLatch;<a name="line.1794"></a>
-<span class="sourceLineNo">1795</span>    }<a name="line.1795"></a>
-<span class="sourceLineNo">1796</span><a name="line.1796"></a>
-<span class="sourceLineNo">1797</span>    /**<a name="line.1797"></a>
-<span class="sourceLineNo">1798</span>     * Check if we should attain safe point.  If so, go there and then wait till signalled before<a name="line.1798"></a>
-<span class="sourceLineNo">1799</span>     * we proceeding.<a name="line.1799"></a>
-<span class="sourceLineNo">1800</span>     */<a name="line.1800"></a>
-<span class="sourceLineNo">1801</span>    private void attainSafePoint(final long currentSequence) {<a name="line.1801"></a>
-<span class="sourceLineNo">1802</span>      if (this.zigzagLatch == null || !this.zigzagLatch.isCocked()) return;<a name="line.1802"></a>
-<span class="sourceLineNo">1803</span>      // If here, another thread is waiting on us to get to safe point.  Don't leave it hanging.<a name="line.1803"></a>
-<span class="sourceLineNo">1804</span>      beforeWaitOnSafePoint();<a name="line.1804"></a>
-<span class="sourceLineNo">1805</span>      try {<a name="line.1805"></a>
-<span class="sourceLineNo">1806</span>        // Wait on outstanding syncers; wait for them to finish syncing (unless we've been<a name="line.1806"></a>
-<span class="sourceLineNo">1807</span>        // shutdown or unless our latch has been thrown because we have been aborted or unless<a name="line.1807"></a>
-<span class="sourceLineNo">1808</span>        // this WAL is broken and we can't get a sync/append to complete).<a name="line.1808"></a>
-<span class="sourceLineNo">1809</span>        while (!this.shutdown &amp;&amp; this.zigzagLatch.isCocked() &amp;&amp;<a name="line.1809"></a>
-<span class="sourceLineNo">1810</span>            highestSyncedSequence.get() &lt; currentSequence &amp;&amp;<a name="line.1810"></a>
-<span class="sourceLineNo">1811</span>            // We could be in here and all syncs are failing or failed. Check for this. Otherwise<a name="line.1811"></a>
-<span class="sourceLineNo">1812</span>            // we'll just be stuck here for ever. In other words, ensure there syncs running.<a name="line.1812"></a>
-<span class="sourceLineNo">1813</span>            isOutstandingSyncs()) {<a name="line.1813"></a>
-<span class="sourceLineNo">1814</span>          synchronized (this.safePointWaiter) {<a name="line.1814"></a>
-<span class="sourceLineNo">1815</span>            this.safePointWaiter.wait(0, 1);<a name="line.1815"></a>
-<span class="sourceLineNo">1816</span>          }<a name="line.1816"></a>
-<span class="sourceLineNo">1817</span>        }<a name="line.1817"></a>
-<span class="sourceLineNo">1818</span>        // Tell waiting thread we've attained safe point. Can clear this.throwable if set here<a name="line.1818"></a>
-<span class="sourceLineNo">1819</span>        // because we know that next event through the ringbuffer will be going to a new WAL<a name="line.1819"></a>
-<span class="sourceLineNo">1820</span>        // after we do the zigzaglatch dance.<a name="line.1820"></a>
-<span class="sourceLineNo">1821</span>        this.exception = null;<a name="line.1821"></a>
-<span class="sourceLineNo">1822</span>        this.zigzagLatch.safePointAttained();<a name="line.1822"></a>
-<span class="sourceLineNo">1823</span>      } catch (InterruptedException e) {<a name="line.1823"></a>
-<span class="sourceLineNo">1824</span>        LOG.warn("Interrupted ", e);<a name="line.1824"></a>
-<span class="sourceLineNo">1825</span>        Thread.currentThread().interrupt();<a name="line.1825"></a>
-<span class="sourceLineNo">1826</span>      }<a name="line.1826"></a>
-<span class="sourceLineNo">1827</span>    }<a name="line.1827"></a>
-<span class="sourceLineNo">1828</span><a name="line.1828"></a>
-<span class="sourceLineNo">1829</span>    /**<a name="line.1829"></a>
-<span class="sourceLineNo">1830</span>     * Append to the WAL.  Does all CP and WAL listener calls.<a name="line.1830"></a>
-<span class="sourceLineNo">1831</span>     * @param entry<a name="line.1831"></a>
-<span class="sourceLineNo">1832</span>     * @throws Exception<a name="line.1832"></a>
-<span class="sourceLineNo">1833</span>     */<a name="line.1833"></a>
-<span class="sourceLineNo">1834</span>    void append(final FSWALEntry entry) throws Exception {<a name="line.1834"></a>
-<span class="sourceLineNo">1835</span>      // TODO: WORK ON MAKING THIS APPEND FASTER. DOING WAY TOO MUCH WORK WITH CPs, PBing, etc.<a name="line.1835"></a>
-<span class="sourceLineNo">1836</span>      atHeadOfRingBufferEventHandlerAppend();<a name="line.1836"></a>
-<span class="sourceLineNo">1837</span><a name="line.1837"></a>
-<span class="sourceLineNo">1838</span>      long start = EnvironmentEdgeManager.currentTime();<a name="line.1838"></a>
-<span class="sourceLineNo">1839</span>      byte [] encodedRegionName = entry.getKey().getEncodedRegionName();<a name="line.1839"></a>
-<span class="sourceLineNo">1840</span>      long regionSequenceId = WALKey.NO_SEQUENCE_ID;<a name="line.1840"></a>
-<span class="sourceLineNo">1841</span>      try {<a name="line.1841"></a>
-<span class="sourceLineNo">1842</span>        // We are about to append this edit; update the region-scoped sequence number.  Do it<a name="line.1842"></a>
-<span class="sourceLineNo">1843</span>        // here inside this single appending/writing thread.  Events are ordered on the ringbuffer<a name="line.1843"></a>
-<span class="sourceLineNo">1844</span>        // so region sequenceids will also be in order.<a name="line.1844"></a>
-<span class="sourceLineNo">1845</span>        regionSequenceId = entry.stampRegionSequenceId();<a name="line.1845"></a>
-<span class="sourceLineNo">1846</span>        // Edits are empty, there is nothing to append.  Maybe empty when we are looking for a<a name="line.1846"></a>
-<span class="sourceLineNo">1847</span>        // region sequence id only, a region edit/sequence id that is not associated with an actual<a name="line.1847"></a>
-<span class="sourceLineNo">1848</span>        // edit. It has to go through all the rigmarole to be sure we have the right ordering.<a name="line.1848"></a>
-<span class="sourceLineNo">1849</span>        if (entry.getEdit().isEmpty()) {<a name="line.1849"></a>
-<span class="sourceLineNo">1850</span>          return;<a name="line.1850"></a>
-<span class="sourceLineNo">1851</span>        }<a name="line.1851"></a>
-<span class="sourceLineNo">1852</span><a name="line.1852"></a>
-<span class="sourceLineNo">1853</span>        // Coprocessor hook.<a name="line.1853"></a>
-<span class="sourceLineNo">1854</span>        if (!coprocessorHost.preWALWrite(entry.getHRegionInfo(), entry.getKey(),<a name="line.1854"></a>
-<span class="sourceLineNo">1855</span>            entry.getEdit())) {<a name="line.1855"></a>
-<span class="sourceLineNo">1856</span>          if (entry.getEdit().isReplay()) {<a name="line.1856"></a>
-<span class="sourceLineNo">1857</span>            // Set replication scope null so that this won't be replicated<a name="line.1857"></a>
-<span class="sourceLineNo">1858</span>            entry.getKey().setScopes(null);<a name="line.1858"></a>
-<span class="sourceLineNo">1859</span>          }<a name="line.1859"></a>
-<span class="sourceLineNo">1860</span>        }<a name="line.1860"></a>
-<span class="sourceLineNo">1861</span>        if (!listeners.isEmpty()) {<a name="line.1861"></a>
-<span class="sourceLineNo">1862</span>          for (WALActionsListener i: listeners) {<a name="line.1862"></a>
-<span class="sourceLineNo">1863</span>            // TODO: Why does listener take a table description and CPs take a regioninfo?  Fix.<a name="line.1863"></a>
-<span class="sourceLineNo">1864</span>            i.visitLogEntryBeforeWrite(entry.getHTableDescriptor(), entry.getKey(),<a name="line.1864"></a>
-<span class="sourceLineNo">1865</span>              entry.getEdit());<a name="line.1865"></a>
-<span class="sourceLineNo">1866</span>          }<a name="line.1866"></a>
-<span class="sourceLineNo">1867</span>        }<a name="line.1867"></a>
-<span class="sourceLineNo">1868</span><a name="line.1868"></a>
-<span class="sourceLineNo">1869</span>        writer.append(entry);<a name="line.1869"></a>
-<span class="sourceLineNo">1870</span>        assert highestUnsyncedSequence &lt; entry.getSequence();<a name="line.1870"></a>
-<span class="sourceLineNo">1871</span>        highestUnsyncedSequence = entry.getSequence();<a name="line.1871"></a>
-<span class="sourceLineNo">1872</span>        sequenceIdAccounting.update(encodedRegionName, entry.getFamilyNames(), regionSequenceId,<a name="line.1872"></a>
-<span class="sourceLineNo">1873</span>          entry.isInMemstore());<a name="line.1873"></a>
-<span class="sourceLineNo">1874</span>        coprocessorHost.postWALWrite(entry.getHRegionInfo(), entry.getKey(), entry.getEdit());<a name="line.1874"></a>
-<span class="sourceLineNo">1875</span>        // Update metrics.<a name="line.1875"></a>
-<span class="sourceLineNo">1876</span>        postAppend(entry, EnvironmentEdgeManager.currentTime() - start);<a name="line.1876"></a>
-<span class="sourceLineNo">1877</span>      } catch (Exception e) {<a name="line.1877"></a>
-<span class="sourceLineNo">1878</span>        String msg = "Append sequenceId=" + regionSequenceId +<a name="line.1878"></a>
-<span class="sourceLineNo">1879</span>          ", requesting roll of WAL";<a name="line.1879"></a>
-<span class="sourceLineNo">1880</span>        LOG.warn(msg, e);<a name="line.1880"></a>
-<span class="sourceLineNo">1881</span>        requestLogRoll();<a name="line.1881"></a>
-<span class="sourceLineNo">1882</span>        throw new DamagedWALException(msg, e);<a name="line.1882"></a>
-<span class="sourceLineNo">1883</span>      }<a name="line.1883"></a>
-<span class="sourceLineNo">1884</span>      numEntries.incrementAndGet();<a name="line.1884"></a>
-<span class="sourceLineNo">1885</span>    }<a name="line.1885"></a>
-<span class="sourceLineNo">1886</span><a name="line.1886"></a>
-<span class="sourceLineNo">1887</span>    @Override<a name="line.1887"></a>
-<span class="sourceLineNo">1888</span>    public void onStart() {<a name="line.1888"></a>
-<span class="sourceLineNo">1889</span>      for (SyncRunner syncRunner: this.syncRunners) syncRunner.start();<a name="line.1889"></a>
-<span class="sourceLineNo">1890</span>    }<a name="line.1890"></a>
+<span class="sourceLineNo">1792</span>    /**<a name="line.1792"></a>
+<span class="sourceLineNo">1793</span>     * Check if we should attain safe point.  If so, go there and then wait till signalled before<a name="line.1793"></a>
+<span class="sourceLineNo">1794</span>     * we proceeding.<a name="line.1794"></a>
+<span class="sourceLineNo">1795</span>     */<a name="line.1795"></a>
+<span class="sourceLineNo">1796</span>    private void attainSafePoint(final long currentSequence) {<a name="line.1796"></a>
+<span class="sourceLineNo">1797</span>      if (this.zigzagLatch == null || !this.zigzagLatch.isCocked()) return;<a name="line.1797"></a>
+<span class="sourceLineNo">1798</span>      // If here, another thread is waiting on us to get to safe point.  Don't leave it hanging.<a name="line.1798"></a>
+<span class="sourceLineNo">1799</span>      beforeWaitOnSafePoint();<a name="line.1799"></a>
+<span class="sourceLineNo">1800</span>      try {<a name="line.1800"></a>
+<span class="sourceLineNo">1801</span>        // Wait on outstanding syncers; wait for them to finish syncing (unless we've been<a name="line.1801"></a>
+<span class="sourceLineNo">1802</span>        // shutdown or unless our latch has been thrown because we have been aborted or unless<a name="line.1802"></a>
+<span class="sourceLineNo">1803</span>        // this WAL is broken and we can't get a sync/append to complete).<a name="line.1803"></a>
+<span class="sourceLineNo">1804</span>        while (!this.shutdown &amp;&amp; this.zigzagLatch.isCocked() &amp;&amp;<a name="line.1804"></a>
+<span class="sourceLineNo">1805</span>            highestSyncedSequence.get() &lt; currentSequence &amp;&amp;<a name="line.1805"></a>
+<span class="sourceLineNo">1806</span>            // We could be in here and all syncs are failing or failed. Check for this. Otherwise<a name="line.1806"></a>
+<span class="sourceLineNo">1807</span>            // we'll just be stuck here for ever. In other words, ensure there syncs running.<a name="line.1807"></a>
+<span class="sourceLineNo">1808</span>            isOutstandingSyncs()) {<a name="line.1808"></a>
+<span class="sourceLineNo">1809</span>          synchronized (this.safePointWaiter) {<a name="line.1809"></a>
+<span class="sourceLineNo">1810</span>            this.safePointWaiter.wait(0, 1);<a name="line.1810"></a>
+<span class="sourceLineNo">1811</span>          }<a name="line.1811"></a>
+<span class="sourceLineNo">1812</span>        }<a name="line.1812"></a>
+<span class="sourceLineNo">1813</span>        // Tell waiting thread we've attained safe point. Can clear this.throwable if set here<a name="line.1813"></a>
+<span class="sourceLineNo">1814</span>        // because we know that next event through the ringbuffer will be going to a new WAL<a name="line.1814"></a>
+<span class="sourceLineNo">1815</span>        // after we do the zigzaglatch dance.<a name="line.1815"></a>
+<span class="sourceLineNo">1816</span>        this.exception = null;<a name="line.1816"></a>
+<span class="sourceLineNo">1817</span>        this.zigzagLatch.safePointAttained();<a name="line.1817"></a>
+<span class="sourceLineNo">1818</span>      } catch (InterruptedException e) {<a name="line.1818"></a>
+<span class="sourceLineNo">1819</span>        LOG.warn("Interrupted ", e);<a name="line.1819"></a>
+<span class="sourceLineNo">1820</span>        Thread.currentThread().interrupt();<a name="line.1820"></a>
+<span class="sourceLineNo">1821</span>      }<a name="line.1821"></a>
+<span class="sourceLineNo">1822</span>    }<a name="line.1822"></a>
+<span class="sourceLineNo">1823</span><a name="line.1823"></a>
+<span class="sourceLineNo">1824</span>    /**<a name="line.1824"></a>
+<span class="sourceLineNo">1825</span>     * Append to the WAL.  Does all CP and WAL listener calls.<a name="line.1825"></a>
+<span class="sourceLineNo">1826</span>     * @param entry<a name="line.1826"></a>
+<span class="sourceLineNo">1827</span>     * @throws Exception<a name="line.1827"></a>
+<span class="sourceLineNo">1828</span>     */<a name="line.1828"></a>
+<span class="sourceLineNo">1829</span>    void append(final FSWALEntry entry) throws Exception {<a name="line.1829"></a>
+<span class="sourceLineNo">1830</span>      // TODO: WORK ON MAKING THIS APPEND FASTER. DOING WAY TOO MUCH WORK WITH CPs, PBing, etc.<a name="line.1830"></a>
+<span class="sourceLineNo">1831</span>      atHeadOfRingBufferEventHandlerAppend();<a name="line.1831"></a>
+<span class="sourceLineNo">1832</span><a name="line.1832"></a>
+<span class="sourceLineNo">1833</span>      long start = EnvironmentEdgeManager.currentTime();<a name="line.1833"></a>
+<span class="sourceLineNo">1834</span>      byte [] encodedRegionName = entry.getKey().getEncodedRegionName();<a name="line.1834"></a>
+<span class="sourceLineNo">1835</span>      long regionSequenceId = WALKey.NO_SEQUENCE_ID;<a name="line.1835"></a>
+<span class="sourceLineNo">1836</span>      try {<a name="line.1836"></a>
+<span class="sourceLineNo">1837</span>        // We are about to append this edit; update the region-scoped sequence number.  Do it<a name="line.1837"></a>
+<span class="sourceLineNo">1838</span>        // here inside this single appending/writing thread.  Events are ordered on the ringbuffer<a name="line.1838"></a>
+<span class="sourceLineNo">1839</span>        // so region sequenceids will also be in order.<a name="line.1839"></a>
+<span class="sourceLineNo">1840</span>        regionSequenceId = entry.stampRegionSequenceId();<a name="line.1840"></a>
+<span class="sourceLineNo">1841</span>        // Edits are empty, there is nothing to append.  Maybe empty when we are looking for a<a name="line.1841"></a>
+<span class="sourceLineNo">1842</span>        // region sequence id only, a region edit/sequence id that is not associated with an actual<a name="line.1842"></a>
+<span class="sourceLineNo">1843</span>        // edit. It has to go through all the rigmarole to be sure we have the right ordering.<a name="line.1843"></a>
+<span class="sourceLineNo">1844</span>        if (entry.getEdit().isEmpty()) {<a name="line.1844"></a>
+<span class="sourceLineNo">1845</span>          return;<a name="line.1845"></a>
+<span class="sourceLineNo">1846</span>        }<a name="line.1846"></a>
+<span class="sourceLineNo">1847</span><a name="line.1847"></a>
+<span class="sourceLineNo">1848</span>        // Coprocessor hook.<a name="line.1848"></a>
+<span class="sourceLineNo">1849</span>        if (!coprocessorHost.preWALWrite(entry.getHRegionInfo(), entry.getKey(),<a name="line.1849"></a>
+<span class="sourceLineNo">1850</span>            entry.getEdit())) {<a name="line.1850"></a>
+<span class="sourceLineNo">1851</span>          if (entry.getEdit().isReplay()) {<a name="line.1851"></a>
+<span class="sourceLineNo">1852</span>            // Set replication scope null so that this won't be replicated<a name="line.1852"></a>
+<span class="sourceLineNo">1853</span>            entry.getKey().setScopes(null);<a name="line.1853"></a>
+<span class="sourceLineNo">1854</span>          }<a name="line.1854"></a>
+<span class="sourceLineNo">1855</span>        }<a name="line.1855"></a>
+<span class="sourceLineNo">1856</span>        if (!listeners.isEmpty()) {<a name="line.1856"></a>
+<span class="sourceLineNo">1857</span>          for (WALActionsListener i: listeners) {<a name="line.1857"></a>
+<span class="sourceLineNo">1858</span>            // TODO: Why does listener take a table description and CPs take a regioninfo?  Fix.<a name="line.1858"></a>
+<span class="sourceLineNo">1859</span>            i.visitLogEntryBeforeWrite(entry.getHTableDescriptor(), entry.getKey(),<a name="line.1859"></a>
+<span class="sourceLineNo">1860</span>              entry.getEdit());<a name="line.1860"></a>
+<span class="sourceLineNo">1861</span>          }<a name="line.1861"></a>
+<span class="sourceLineNo">1862</span>        }<a name="line.1862"></a>
+<span class="sourceLineNo">1863</span><a name="line.1863"></a>
+<span class="sourceLineNo">1864</span>        writer.append(entry);<a name="line.1864"></a>
+<span class="sourceLineNo">1865</span>        assert highestUnsyncedSequence &lt; entry.getSequence();<a name="line.1865"></a>
+<span class="sourceLineNo">1866</span>        highestUnsyncedSequence = entry.getSequence();<a name="line.1866"></a>
+<span class="sourceLineNo">1867</span>        sequenceIdAccounting.update(encodedRegionName, entry.getFamilyNames(), regionSequenceId,<a name="line.1867"></a>
+<span class="sourceLineNo">1868</span>          entry.isInMemstore());<a name="line.1868"></a>
+<span class="sourceLineNo">1869</span>        coprocessorHost.postWALWrite(entry.getHRegionInfo(), entry.getKey(), entry.getEdit());<a name="line.1869"></a>
+<span class="sourceLineNo">1870</span>        // Update metrics.<a name="line.1870"></a>
+<span class="sourceLineNo">1871</span>        postAppend(entry, EnvironmentEdgeManager.currentTime() - start);<a name="line.1871"></a>
+<span class="sourceLineNo">1872</span>      } catch (Exception e) {<a name="line.1872"></a>
+<span class="sourceLineNo">1873</span>        String msg = "Append sequenceId=" + regionSequenceId + ", requesting roll of WAL";<a name="line.1873"></a>
+<span class="sourceLineNo">1874</span>        LOG.warn(msg, e);<a name="line.1874"></a>
+<span class="sourceLineNo">1875</span>        requestLogRoll();<a name="line.1875"></a>
+<span class="sourceLineNo">1876</span>        throw new DamagedWALException(msg, e);<a name="line.1876"></a>
+<span class="sourceLineNo">1877</span>      }<a name="line.1877"></a>
+<span class="sourceLineNo">1878</span>      numEntries.incrementAndGet();<a name="line.1878"></a>
+<span class="sourceLineNo">1879</span>    }<a name="line.1879"></a>
+<span class="sourceLineNo">1880</span><a name="line.1880"></a>
+<span class="sourceLineNo">1881</span>    @Override<a name="line.1881"></a>
+<span class="sourceLineNo">1882</span>    public void onStart() {<a name="line.1882"></a>
+<span class="sourceLineNo">1883</span>      for (SyncRunner syncRunner: this.syncRunners) syncRunner.start();<a name="line.1883"></a>
+<span class="sourceLineNo">1884</span>    }<a name="line.1884"></a>
+<span class="sourceLineNo">1885</span><a name="line.1885"></a>
+<span class="sourceLineNo">1886</span>    @Override<a name="line.1886"></a>
+<span class="sourceLineNo">1887</span>    public void onShutdown() {<a name="line.1887"></a>
+<span class="sourceLineNo">1888</span>      for (SyncRunner syncRunner: this.syncRunners) syncRunner.interrupt();<a name="line.1888"></a>
+<span class="sourceLineNo">1889</span>    }<a name="line.1889"></a>
+<span class="sourceLineNo">1890</span>  }<a name="line.1890"></a>
 <span class="sourceLineNo">1891</span><a name="line.1891"></a>
-<span class="sourceLineNo">1892</span>    @Override<a name="line.1892"></a>
-<span class="sourceLineNo">1893</span>    public void onShutdown() {<a name="line.1893"></a>
-<span class="sourceLineNo">1894</span>      for (SyncRunner syncRunner: this.syncRunners) syncRunner.interrupt();<a name="line.1894"></a>
-<span class="sourceLineNo">1895</span>    }<a name="line.1895"></a>
-<span class="sourceLineNo">1896</span>  }<a name="line.1896"></a>
-<span class="sourceLineNo">1897</span><a name="line.1897"></a>
-<span class="sourceLineNo">1898</span>  /**<a name="line.1898"></a>
-<span class="sourceLineNo">1899</span>   * Exposed for testing only.  Use to tricks like halt the ring buffer appending.<a name="line.1899"></a>
-<span class="sourceLineNo">1900</span>   */<a name="line.1900"></a>
-<span class="sourceLineNo">1901</span>  @VisibleForTesting<a name="line.1901"></a>
-<span class="sourceLineNo">1902</span>  void atHeadOfRingBufferEventHandlerAppend() {<a name="line.1902"></a>
-<span class="sourceLineNo">1903</span>    // Noop<a name="line.1903"></a>
-<span class="sourceLineNo">1904</span>  }<a name="line.1904"></a>
-<span class="sourceLineNo">1905</span><a name="line.1905"></a>
-<span class="sourceLineNo">1906</span>  private static IOException ensureIOException(final Throwable t) {<a name="line.1906"></a>
-<span class="sourceLineNo">1907</span>    return (t instanceof IOException)? (IOException)t: new IOException(t);<a name="line.1907"></a>
-<span class="sourceLineNo">1908</span>  }<a name="line.1908"></a>
-<span class="sourceLineNo">1909</span><a name="line.1909"></a>
-<span class="sourceLineNo">1910</span>  private static void usage() {<a name="line.1910"></a>
-<span class="sourceLineNo">1911</span>    System.err.println("Usage: FSHLog &lt;ARGS&gt;");<a name="line.1911"></a>
-<span class="sourceLineNo">1912</span>    System.err.println("Arguments:");<a name="line.1912"></a>
-<span class="sourceLineNo">1913</span>    System.err.println(" --dump  Dump textual representation of passed one or more files");<a name="line.1913"></a>
-<span class="sourceLineNo">1914</span>    System.err.println("         For example: " +<a name="line.1914"></a>
-<span class="sourceLineNo">1915</span>      "FSHLog --dump hdfs://example.com:9000/hbase/.logs/MACHINE/LOGFILE");<a name="line.1915"></a>
-<span class="sourceLineNo">1916</span>    System.err.println(" --split Split the passed directory of WAL logs");<a name="line.1916"></a>
-<span class="sourceLineNo">1917</span>    System.err.println("         For example: " +<a name="line.1917"></a>
-<span class="sourceLineNo">1918</span>      "FSHLog --split hdfs://example.com:9000/hbase/.logs/DIR");<a name="line.1918"></a>
-<span class="sourceLineNo">1919</span>  }<a name="line.1919"></a>
-<span class="sourceLineNo">1920</span><a name="line.1920"></a>
-<span class="sourceLineNo">1921</span>  /**<a name="line.1921"></a>
-<span class="sourceLineNo">1922</span>   * Pass one or more log file names and it will either dump out a text version<a name="line.1922"></a>
-<span class="sourceLineNo">1923</span>   * on &lt;code&gt;stdout&lt;/code&gt; or split the specified log files.<a name="line.1923"></a>
-<span class="sourceLineNo">1924</span>   *<a name="line.1924"></a>
-<span class="sourceLineNo">1925</span>   * @param args<a name="line.1925"></a>
-<span class="sourceLineNo">1926</span>   * @throws IOException<a name="line.1926"></a>
-<span class="sourceLineNo">1927</span>   */<a name="line.1927"></a>
-<span class="sourceLineNo">1928</span>  public static void main(String[] args) throws IOException {<a name="line.1928"></a>
-<span class="sourceLineNo">1929</span>    if (args.length &lt; 2) {<a name="line.1929"></a>
-<span class="sourceLineNo">1930</span>      usage();<a name="line.1930"></a>
-<span class="sourceLineNo">1931</span>      System.exit(-1);<a name="line.1931"></a>
-<span class="sourceLineNo">1932</span>    }<a name="line.1932"></a>
-<span class="sourceLineNo">1933</span>    // either dump using the WALPrettyPrinter or split, depending on args<a name="line.1933"></a>
-<span class="sourceLineNo">1934</span>    if (args[0].compareTo("--dump") == 0) {<a name="line.1934"></a>
-<span class="sourceLineNo">1935</span>      WALPrettyPrinter.run(Arrays.copyOfRange(args, 1, args.length));<a name="line.1935"></a>
-<span class="sourceLineNo">1936</span>    } else if (args[0].compareTo("--perf") == 0) {<a name="line.1936"></a>
-<span class="sourceLineNo">1937</span>      LOG.fatal("Please use the WALPerformanceEvaluation tool instead. i.e.:");<a name="line.1937"></a>
-<span class="sourceLineNo">1938</span>      LOG.fatal("\thbase org.apache.hadoop.hbase.wal.WALPerformanceEvaluation --iterations " +<a name="line.1938"></a>
-<span class="sourceLineNo">1939</span>          args[1]);<a name="line.1939"></a>
-<span class="sourceLineNo">1940</span>      System.exit(-1);<a name="line.1940"></a>
-<span class="sourceLineNo">1941</span>    } else if (args[0].compareTo("--split") == 0) {<a name="line.1941"></a>
-<span class="sourceLineNo">1942</span>      Configuration conf = HBaseConfiguration.create();<a name="line.1942"></a>
-<span class="sourceLineNo">1943</span>      for (int i = 1; i &lt; args.length; i++) {<a name="line.1943"></a>
-<span class="sourceLineNo">1944</span>        try {<a name="line.1944"></a>
-<span class="sourceLineNo">1945</span>          Path logPath = new Path(args[i]);<a name="line.1945"></a>
-<span class="sourceLineNo">1946</span>          FSUtils.setFsDefault(conf, logPath);<a name="line.1946"></a>
-<span class="sourceLineNo">1947</span>          split(conf, logPath);<a name="line.1947"></a>
-<span class="sourceLineNo">1948</span>        } catch (IOException t) {<a name="line.1948"></a>
-<span class="sourceLineNo">1949</span>          t.printStackTrace(System.err);<a name="line.1949"></a>
-<span class="sourceLineNo">1950</span>          System.exit(-1);<a name="line.1950"></a>
-<span class="sourceLineNo">1951</span>        }<a name="line.1951"></a>
-<span class="sourceLineNo">1952</span>      }<a name="line.1952"></a>
-<span class="sourceLineNo">1953</span>    } else {<a name="line.1953"></a>
-<span class="sourceLineNo">1954</span>      usage();<a name="line.1954"></a>
-<span class="sourceLineNo">1955</span>      System.exit(-1);<a name="line.1955"></a>
-<span class="sourceLineNo">1956</span>    }<a name="line.1956"></a>
-<span class="sourceLineNo">1957</span>  }<a name="line.1957"></a>
-<span class="sourceLineNo">1958</span><a name="line.1958"></a>
-<span class="sourceLineNo">1959</span>  /**<a name="line.1959"></a>
-<span class="sourceLineNo">1960</span>   * This method gets the pipeline for the current WAL.<a name="line.1960"></a>
-<span class="sourceLineNo">1961</span>   */<a name="line.1961"></a>
-<span class="sourceLineNo">1962</span>  @VisibleForTesting<a name="line.1962"></a>
-<span class="sourceLineNo">1963</span>  DatanodeInfo[] getPipeLine() {<a name="line.1963"></a>
-<span class="sourceLineNo">1964</span>    if (this.hdfs_out != null) {<a name="line.1964"></a>
-<span class="sourceLineNo">1965</span>      if (this.hdfs_out.getWrappedStream() instanceof DFSOutputStream) {<a name="line.1965"></a>
-<span class="sourceLineNo">1966</span>        return ((DFSOutputStream) this.hdfs_out.getWrappedStream()).getPipeline();<a name="line.1966"></a>
-<span class="sourceLineNo">1967</span>      }<a name="line.1967"></a>
-<span class="sourceLineNo">1968</span>    }<a name="line.1968"></a>
-<span class="sourceLineNo">1969</span>    return new DatanodeInfo[0];<a name="line.1969"></a>
-<span class="sourceLineNo">1970</span>  }<a name="line.1970"></a>
-<span class="sourceLineNo">1971</span>}<a name="line.1971"></a>
+<span class="sourceLineNo">1892</span>  /**<a name="line.1892"></a>
+<span class="sourceLineNo">1893</span>   * Exposed for testing only.  Use to tricks like halt the ring buffer appending.<a name="line.1893"></a>
+<span class="sourceLineNo">1894</span>   */<a name="line.1894"></a>
+<span class="sourceLineNo">1895</span>  @VisibleForTesting<a name="line.1895"></a>
+<span class="sourceLineNo">1896</span>  void atHeadOfRingBufferEventHandlerAppend() {<a name="line.1896"></a>
+<span class="sourceLineNo">1897</span>    // Noop<a name="line.1897"></a>
+<span class="sourceLineNo">1898</span>  }<a name="line.1898"></a>
+<span class="sourceLineNo">1899</span><a name="line.1899"></a>
+<span class="sourceLineNo">1900</span>  private static IOException ensureIOException(final Throwable t) {<a name="line.1900"></a>
+<span class="sourceLineNo">1901</span>    return (t instanceof IOException)? (IOException)t: new IOException(t);<a name="line.1901"></a>
+<span class="sourceLineNo">1902</span>  }<a name="line.1902"></a>
+<span class="sourceLineNo">1903</span><a name="line.1903"></a>
+<span class="sourceLineNo">1904</span>  private static void usage() {<a name="line.1904"></a>
+<span class="sourceLineNo">1905</span>    System.err.println("Usage: FSHLog &lt;ARGS&gt;");<a name="line.1905"></a>
+<span class="sourceLineNo">1906</span>    System.err.println("Arguments:");<a name="line.1906"></a>
+<span class="sourceLineNo">1907</span>    System.err.println(" --dump  Dump textual representation of passed one or more files");<a name="line.1907"></a>
+<span class="sourceLineNo">1908</span>    System.err.println("         For example: " +<a name="line.1908"></a>
+<span class="sourceLineNo">1909</span>      "FSHLog --dump hdfs://example.com:9000/hbase/.logs/MACHINE/LOGFILE");<a name="line.1909"></a>
+<span class="sourceLineNo">1910</span>    System.err.println(" --split Split the passed directory of WAL logs");<a name="line.1910"></a>
+<span class="sourceLineNo">1911</span>    System.err.println("         For example: " +<a name="line.1911"></a>
+<span class="sourceLineNo">1912</span>      "FSHLog --split hdfs://example.com:9000/hbase/.logs/DIR");<a name="line.1912"></a>
+<span class="sourceLineNo">1913</span>  }<a name="line.1913"></a>
+<span class="sourceLineNo">1914</span><a name="line.1914"></a>
+<span class="sourceLineNo">1915</span>  /**<a name="line.1915"></a>
+<span class="sourceLineNo">1916</span>   * Pass one or more log file names and it will either dump out a text version<a name="line.1916"></a>
+<span class="sourceLineNo">1917</span>   * on &lt;code&gt;stdout&lt;/code&gt; or split the specified log files.<a name="line.1917"></a>
+<span class="sourceLineNo">1918</span>   *<a name="line.1918"></a>
+<span class="sourceLineNo">1919</span>   * @param args<a name="line.1919"></a>
+<span class="sourceLineNo">1920</span>   * @throws IOException<a name="line.1920"></a>
+<span class="sourceLineNo">1921</span>   */<a name="line.1921"></a>
+<span class="sourceLineNo">1922</span>  public static void main(String[] args) throws IOException {<a name="line.1922"></a>
+<span class="sourceLineNo">1923</span>    if (args.length &lt; 2) {<a name="line.1923"></a>
+<span class="sourceLineNo">1924</span>      usage();<a name="line.1924"></a>
+<span class="sourceLineNo">1925</span>      System.exit(-1);<a name="line.1925"></a>
+<span class="sourceLineNo">1926</span>    }<a name="line.1926"></a>
+<span class="sourceLineNo">1927</span>    // either dump using the WALPrettyPrinter or split, depending on args<a name="line.1927"></a>
+<span class="sourceLineNo">1928</span>    if (args[0].compareTo("--dump") == 0) {<a name="line.1928"></a>
+<span class="sourceLineNo">1929</span>      WALPrettyPrinter.run(Arrays.copyOfRange(args, 1, args.length));<a name="line.1929"></a>
+<span class="sourceLineNo">1930</span>    } else if (args[0].compareTo("--perf") == 0) {<a name="line.1930"></a>
+<span class="sourceLineNo">1931</span>      LOG.fatal("Please use the WALPerformanceEvaluation tool instead. i.e.:");<a name="line.1931"></a>
+<span class="sourceLineNo">1932</span>      LOG.fatal("\thbase org.apache.hadoop.hbase.wal.WALPerformanceEvaluation --iterations " +<a name="line.1932"></a>
+<span class="sourceLineNo">1933</span>          args[1]);<a name="line.1933"></a>
+<span class="sourceLineNo">1934</span>      System.exit(-1);<a name="line.1934"></a>
+<span class="sourceLineNo">1935</span>    } else if (args[0].compareTo("--split") == 0) {<a name="line.1935"></a>
+<span class="sourceLineNo">1936</span>      Configuration conf = HBaseConfiguration.create();<a name="line.1936"></a>
+<span class="sourceLineNo">1937</span>      for (int i = 1; i &lt; args.length; i++) {<a name="line.1937"></a>
+<span class="sourceLineNo">1938</span>        try {<a name="line.1938"></a>
+<span class="sourceLineNo">1939</span>          Path logPath = new Path(args[i]);<a name="line.1939"></a>
+<span class="sourceLineNo">1940</span>          FSUtils.setFsDefault(conf, logPath);<a name="line.1940"></a>
+<span class="sourceLineNo">1941</span>          split(conf, logPath);<a name="line.1941"></a>
+<span class="sourceLineNo">1942</span>        } catch (IOException t) {<a name="line.1942"></a>
+<span class="sourceLineNo">1943</span>          t.printStackTrace(System.err);<a name="line.1943"></a>
+<span class="sourceLineNo">1944</span>          System.exit(-1);<a name="line.1944"></a>
+<span class="sourceLineNo">1945</span>        }<a name="line.1945"></a>
+<span class="sourceLineNo">1946</span>      }<a name="line.1946"></a>
+<span class="sourceLineNo">1947</span>    } else {<a name="line.1947"></a>
+<span class="sourceLineNo">1948</span>      usage();<a name="line.1948"></a>
+<span class="sourceLineNo">1949</span>      System.exit(-1);<a name="line.1949"></a>
+<span class="sourceLineNo">1950</span>    }<a name="line.1950"></a>
+<span class="sourceLineNo">1951</span>  }<a name="line.1951"></a>
+<span class="sourceLineNo">1952</span><a name="line.1952"></a>
+<span class="sourceLineNo">1953</span>  /**<a name="line.1953"></a>
+<span class="sourceLineNo">1954</span>   * This method gets the pipeline for the current WAL.<a name="line.1954"></a>
+<span class="sourceLineNo">1955</span>   */<a name="line.1955"></a>
+<span class="sourceLineNo">1956</span>  @VisibleForTesting<a name="line.1956"></a>
+<span class="sourceLineNo">1957</span>  DatanodeInfo[] getPipeLine() {<a name="line.1957"></a>
+<span class="sourceLineNo">1958</span>    if (this.hdfs_out != null) {<a name="line.1958"></a>
+<span class="sourceLineNo">1959</span>      if (this.hdfs_out.getWrappedStream() instanceof DFSOutputStream) {<a name="line.1959"></a>
+<span class="sourceLineNo">1960</span>        return ((DFSOutputStream) this.hdfs_out.getWrappedStream()).getPipeline();<a name="line.1960"></a>
+<span class="sourceLineNo">1961</span>      }<a name="line.1961"></a>
+<span class="sourceLineNo">1962</span>    }<a name="line.1962"></a>
+<span class="sourceLineNo">1963</span>    return new DatanodeInfo[0];<a name="line.1963"></a>
+<span class="sourceLineNo">1964</span>  }<a name="line.1964"></a>
+<span class="sourceLineNo">1965</span>}<a name="line.1965"></a>
 
 
 


Mime
View raw message