hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [25/51] [partial] hbase-site git commit: Published site at .
Date Wed, 06 Sep 2017 15:14:19 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e2f20c83/devapidocs/src-html/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.SimpleReporter.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.SimpleReporter.html b/devapidocs/src-html/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.SimpleReporter.html
index 64bce33..f8a036f 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.SimpleReporter.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.SimpleReporter.html
@@ -53,7 +53,7 @@
 <span class="sourceLineNo">045</span>import org.apache.commons.cli.Options;<a name="line.45"></a>
 <span class="sourceLineNo">046</span>import org.apache.commons.cli.ParseException;<a name="line.46"></a>
 <span class="sourceLineNo">047</span>import org.apache.commons.cli.PosixParser;<a name="line.47"></a>
-<span class="sourceLineNo">048</span>import org.apache.commons.lang.StringUtils;<a name="line.48"></a>
+<span class="sourceLineNo">048</span>import org.apache.commons.lang3.StringUtils;<a name="line.48"></a>
 <span class="sourceLineNo">049</span>import org.apache.commons.logging.Log;<a name="line.49"></a>
 <span class="sourceLineNo">050</span>import org.apache.commons.logging.LogFactory;<a name="line.50"></a>
 <span class="sourceLineNo">051</span>import org.apache.hadoop.conf.Configuration;<a name="line.51"></a>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e2f20c83/devapidocs/src-html/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.html b/devapidocs/src-html/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.html
index 64bce33..f8a036f 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.html
@@ -53,7 +53,7 @@
 <span class="sourceLineNo">045</span>import org.apache.commons.cli.Options;<a name="line.45"></a>
 <span class="sourceLineNo">046</span>import org.apache.commons.cli.ParseException;<a name="line.46"></a>
 <span class="sourceLineNo">047</span>import org.apache.commons.cli.PosixParser;<a name="line.47"></a>
-<span class="sourceLineNo">048</span>import org.apache.commons.lang.StringUtils;<a name="line.48"></a>
+<span class="sourceLineNo">048</span>import org.apache.commons.lang3.StringUtils;<a name="line.48"></a>
 <span class="sourceLineNo">049</span>import org.apache.commons.logging.Log;<a name="line.49"></a>
 <span class="sourceLineNo">050</span>import org.apache.commons.logging.LogFactory;<a name="line.50"></a>
 <span class="sourceLineNo">051</span>import org.apache.hadoop.conf.Configuration;<a name="line.51"></a>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e2f20c83/devapidocs/src-html/org/apache/hadoop/hbase/io/hfile/LruBlockCache.BlockBucket.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/io/hfile/LruBlockCache.BlockBucket.html b/devapidocs/src-html/org/apache/hadoop/hbase/io/hfile/LruBlockCache.BlockBucket.html
index 55c1e83..989423f 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/io/hfile/LruBlockCache.BlockBucket.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/io/hfile/LruBlockCache.BlockBucket.html
@@ -848,375 +848,377 @@
 <span class="sourceLineNo">840</span>   *<a name="line.840"></a>
 <span class="sourceLineNo">841</span>   * @return max size in bytes<a name="line.841"></a>
 <span class="sourceLineNo">842</span>   */<a name="line.842"></a>
-<span class="sourceLineNo">843</span>  public long getMaxSize() {<a name="line.843"></a>
-<span class="sourceLineNo">844</span>    return this.maxSize;<a name="line.844"></a>
-<span class="sourceLineNo">845</span>  }<a name="line.845"></a>
-<span class="sourceLineNo">846</span><a name="line.846"></a>
-<span class="sourceLineNo">847</span>  @Override<a name="line.847"></a>
-<span class="sourceLineNo">848</span>  public long getCurrentSize() {<a name="line.848"></a>
-<span class="sourceLineNo">849</span>    return this.size.get();<a name="line.849"></a>
-<span class="sourceLineNo">850</span>  }<a name="line.850"></a>
-<span class="sourceLineNo">851</span><a name="line.851"></a>
-<span class="sourceLineNo">852</span>  @Override<a name="line.852"></a>
-<span class="sourceLineNo">853</span>  public long getCurrentDataSize() {<a name="line.853"></a>
-<span class="sourceLineNo">854</span>    return this.dataBlockSize.get();<a name="line.854"></a>
-<span class="sourceLineNo">855</span>  }<a name="line.855"></a>
-<span class="sourceLineNo">856</span><a name="line.856"></a>
-<span class="sourceLineNo">857</span>  @Override<a name="line.857"></a>
-<span class="sourceLineNo">858</span>  public long getFreeSize() {<a name="line.858"></a>
-<span class="sourceLineNo">859</span>    return getMaxSize() - getCurrentSize();<a name="line.859"></a>
-<span class="sourceLineNo">860</span>  }<a name="line.860"></a>
-<span class="sourceLineNo">861</span><a name="line.861"></a>
-<span class="sourceLineNo">862</span>  @Override<a name="line.862"></a>
-<span class="sourceLineNo">863</span>  public long size() {<a name="line.863"></a>
-<span class="sourceLineNo">864</span>    return getMaxSize();<a name="line.864"></a>
-<span class="sourceLineNo">865</span>  }<a name="line.865"></a>
-<span class="sourceLineNo">866</span><a name="line.866"></a>
-<span class="sourceLineNo">867</span>  @Override<a name="line.867"></a>
-<span class="sourceLineNo">868</span>  public long getBlockCount() {<a name="line.868"></a>
-<span class="sourceLineNo">869</span>    return this.elements.get();<a name="line.869"></a>
-<span class="sourceLineNo">870</span>  }<a name="line.870"></a>
-<span class="sourceLineNo">871</span><a name="line.871"></a>
-<span class="sourceLineNo">872</span>  @Override<a name="line.872"></a>
-<span class="sourceLineNo">873</span>  public long getDataBlockCount() {<a name="line.873"></a>
-<span class="sourceLineNo">874</span>    return this.dataBlockElements.get();<a name="line.874"></a>
-<span class="sourceLineNo">875</span>  }<a name="line.875"></a>
-<span class="sourceLineNo">876</span><a name="line.876"></a>
-<span class="sourceLineNo">877</span>  EvictionThread getEvictionThread() {<a name="line.877"></a>
-<span class="sourceLineNo">878</span>    return this.evictionThread;<a name="line.878"></a>
-<span class="sourceLineNo">879</span>  }<a name="line.879"></a>
-<span class="sourceLineNo">880</span><a name="line.880"></a>
-<span class="sourceLineNo">881</span>  /*<a name="line.881"></a>
-<span class="sourceLineNo">882</span>   * Eviction thread.  Sits in waiting state until an eviction is triggered<a name="line.882"></a>
-<span class="sourceLineNo">883</span>   * when the cache size grows above the acceptable level.&lt;p&gt;<a name="line.883"></a>
-<span class="sourceLineNo">884</span>   *<a name="line.884"></a>
-<span class="sourceLineNo">885</span>   * Thread is triggered into action by {@link LruBlockCache#runEviction()}<a name="line.885"></a>
-<span class="sourceLineNo">886</span>   */<a name="line.886"></a>
-<span class="sourceLineNo">887</span>  static class EvictionThread extends HasThread {<a name="line.887"></a>
-<span class="sourceLineNo">888</span><a name="line.888"></a>
-<span class="sourceLineNo">889</span>    private WeakReference&lt;LruBlockCache&gt; cache;<a name="line.889"></a>
-<span class="sourceLineNo">890</span>    private volatile boolean go = true;<a name="line.890"></a>
-<span class="sourceLineNo">891</span>    // flag set after enter the run method, used for test<a name="line.891"></a>
-<span class="sourceLineNo">892</span>    private boolean enteringRun = false;<a name="line.892"></a>
-<span class="sourceLineNo">893</span><a name="line.893"></a>
-<span class="sourceLineNo">894</span>    public EvictionThread(LruBlockCache cache) {<a name="line.894"></a>
-<span class="sourceLineNo">895</span>      super(Thread.currentThread().getName() + ".LruBlockCache.EvictionThread");<a name="line.895"></a>
-<span class="sourceLineNo">896</span>      setDaemon(true);<a name="line.896"></a>
-<span class="sourceLineNo">897</span>      this.cache = new WeakReference&lt;&gt;(cache);<a name="line.897"></a>
-<span class="sourceLineNo">898</span>    }<a name="line.898"></a>
-<span class="sourceLineNo">899</span><a name="line.899"></a>
-<span class="sourceLineNo">900</span>    @Override<a name="line.900"></a>
-<span class="sourceLineNo">901</span>    public void run() {<a name="line.901"></a>
-<span class="sourceLineNo">902</span>      enteringRun = true;<a name="line.902"></a>
-<span class="sourceLineNo">903</span>      while (this.go) {<a name="line.903"></a>
-<span class="sourceLineNo">904</span>        synchronized (this) {<a name="line.904"></a>
-<span class="sourceLineNo">905</span>          try {<a name="line.905"></a>
-<span class="sourceLineNo">906</span>            this.wait(1000 * 10/*Don't wait for ever*/);<a name="line.906"></a>
-<span class="sourceLineNo">907</span>          } catch (InterruptedException e) {<a name="line.907"></a>
-<span class="sourceLineNo">908</span>            LOG.warn("Interrupted eviction thread ", e);<a name="line.908"></a>
-<span class="sourceLineNo">909</span>            Thread.currentThread().interrupt();<a name="line.909"></a>
-<span class="sourceLineNo">910</span>          }<a name="line.910"></a>
-<span class="sourceLineNo">911</span>        }<a name="line.911"></a>
-<span class="sourceLineNo">912</span>        LruBlockCache cache = this.cache.get();<a name="line.912"></a>
-<span class="sourceLineNo">913</span>        if (cache == null) break;<a name="line.913"></a>
-<span class="sourceLineNo">914</span>        cache.evict();<a name="line.914"></a>
-<span class="sourceLineNo">915</span>      }<a name="line.915"></a>
-<span class="sourceLineNo">916</span>    }<a name="line.916"></a>
-<span class="sourceLineNo">917</span><a name="line.917"></a>
-<span class="sourceLineNo">918</span>    @edu.umd.cs.findbugs.annotations.SuppressWarnings(value="NN_NAKED_NOTIFY",<a name="line.918"></a>
-<span class="sourceLineNo">919</span>        justification="This is what we want")<a name="line.919"></a>
-<span class="sourceLineNo">920</span>    public void evict() {<a name="line.920"></a>
-<span class="sourceLineNo">921</span>      synchronized (this) {<a name="line.921"></a>
-<span class="sourceLineNo">922</span>        this.notifyAll();<a name="line.922"></a>
-<span class="sourceLineNo">923</span>      }<a name="line.923"></a>
-<span class="sourceLineNo">924</span>    }<a name="line.924"></a>
-<span class="sourceLineNo">925</span><a name="line.925"></a>
-<span class="sourceLineNo">926</span>    synchronized void shutdown() {<a name="line.926"></a>
-<span class="sourceLineNo">927</span>      this.go = false;<a name="line.927"></a>
-<span class="sourceLineNo">928</span>      this.notifyAll();<a name="line.928"></a>
-<span class="sourceLineNo">929</span>    }<a name="line.929"></a>
-<span class="sourceLineNo">930</span><a name="line.930"></a>
-<span class="sourceLineNo">931</span>    /**<a name="line.931"></a>
-<span class="sourceLineNo">932</span>     * Used for the test.<a name="line.932"></a>
-<span class="sourceLineNo">933</span>     */<a name="line.933"></a>
-<span class="sourceLineNo">934</span>    boolean isEnteringRun() {<a name="line.934"></a>
-<span class="sourceLineNo">935</span>      return this.enteringRun;<a name="line.935"></a>
-<span class="sourceLineNo">936</span>    }<a name="line.936"></a>
-<span class="sourceLineNo">937</span>  }<a name="line.937"></a>
-<span class="sourceLineNo">938</span><a name="line.938"></a>
-<span class="sourceLineNo">939</span>  /*<a name="line.939"></a>
-<span class="sourceLineNo">940</span>   * Statistics thread.  Periodically prints the cache statistics to the log.<a name="line.940"></a>
-<span class="sourceLineNo">941</span>   */<a name="line.941"></a>
-<span class="sourceLineNo">942</span>  static class StatisticsThread extends Thread {<a name="line.942"></a>
-<span class="sourceLineNo">943</span><a name="line.943"></a>
-<span class="sourceLineNo">944</span>    private final LruBlockCache lru;<a name="line.944"></a>
+<span class="sourceLineNo">843</span><a name="line.843"></a>
+<span class="sourceLineNo">844</span>  @Override<a name="line.844"></a>
+<span class="sourceLineNo">845</span>  public long getMaxSize() {<a name="line.845"></a>
+<span class="sourceLineNo">846</span>    return this.maxSize;<a name="line.846"></a>
+<span class="sourceLineNo">847</span>  }<a name="line.847"></a>
+<span class="sourceLineNo">848</span><a name="line.848"></a>
+<span class="sourceLineNo">849</span>  @Override<a name="line.849"></a>
+<span class="sourceLineNo">850</span>  public long getCurrentSize() {<a name="line.850"></a>
+<span class="sourceLineNo">851</span>    return this.size.get();<a name="line.851"></a>
+<span class="sourceLineNo">852</span>  }<a name="line.852"></a>
+<span class="sourceLineNo">853</span><a name="line.853"></a>
+<span class="sourceLineNo">854</span>  @Override<a name="line.854"></a>
+<span class="sourceLineNo">855</span>  public long getCurrentDataSize() {<a name="line.855"></a>
+<span class="sourceLineNo">856</span>    return this.dataBlockSize.get();<a name="line.856"></a>
+<span class="sourceLineNo">857</span>  }<a name="line.857"></a>
+<span class="sourceLineNo">858</span><a name="line.858"></a>
+<span class="sourceLineNo">859</span>  @Override<a name="line.859"></a>
+<span class="sourceLineNo">860</span>  public long getFreeSize() {<a name="line.860"></a>
+<span class="sourceLineNo">861</span>    return getMaxSize() - getCurrentSize();<a name="line.861"></a>
+<span class="sourceLineNo">862</span>  }<a name="line.862"></a>
+<span class="sourceLineNo">863</span><a name="line.863"></a>
+<span class="sourceLineNo">864</span>  @Override<a name="line.864"></a>
+<span class="sourceLineNo">865</span>  public long size() {<a name="line.865"></a>
+<span class="sourceLineNo">866</span>    return getMaxSize();<a name="line.866"></a>
+<span class="sourceLineNo">867</span>  }<a name="line.867"></a>
+<span class="sourceLineNo">868</span><a name="line.868"></a>
+<span class="sourceLineNo">869</span>  @Override<a name="line.869"></a>
+<span class="sourceLineNo">870</span>  public long getBlockCount() {<a name="line.870"></a>
+<span class="sourceLineNo">871</span>    return this.elements.get();<a name="line.871"></a>
+<span class="sourceLineNo">872</span>  }<a name="line.872"></a>
+<span class="sourceLineNo">873</span><a name="line.873"></a>
+<span class="sourceLineNo">874</span>  @Override<a name="line.874"></a>
+<span class="sourceLineNo">875</span>  public long getDataBlockCount() {<a name="line.875"></a>
+<span class="sourceLineNo">876</span>    return this.dataBlockElements.get();<a name="line.876"></a>
+<span class="sourceLineNo">877</span>  }<a name="line.877"></a>
+<span class="sourceLineNo">878</span><a name="line.878"></a>
+<span class="sourceLineNo">879</span>  EvictionThread getEvictionThread() {<a name="line.879"></a>
+<span class="sourceLineNo">880</span>    return this.evictionThread;<a name="line.880"></a>
+<span class="sourceLineNo">881</span>  }<a name="line.881"></a>
+<span class="sourceLineNo">882</span><a name="line.882"></a>
+<span class="sourceLineNo">883</span>  /*<a name="line.883"></a>
+<span class="sourceLineNo">884</span>   * Eviction thread.  Sits in waiting state until an eviction is triggered<a name="line.884"></a>
+<span class="sourceLineNo">885</span>   * when the cache size grows above the acceptable level.&lt;p&gt;<a name="line.885"></a>
+<span class="sourceLineNo">886</span>   *<a name="line.886"></a>
+<span class="sourceLineNo">887</span>   * Thread is triggered into action by {@link LruBlockCache#runEviction()}<a name="line.887"></a>
+<span class="sourceLineNo">888</span>   */<a name="line.888"></a>
+<span class="sourceLineNo">889</span>  static class EvictionThread extends HasThread {<a name="line.889"></a>
+<span class="sourceLineNo">890</span><a name="line.890"></a>
+<span class="sourceLineNo">891</span>    private WeakReference&lt;LruBlockCache&gt; cache;<a name="line.891"></a>
+<span class="sourceLineNo">892</span>    private volatile boolean go = true;<a name="line.892"></a>
+<span class="sourceLineNo">893</span>    // flag set after enter the run method, used for test<a name="line.893"></a>
+<span class="sourceLineNo">894</span>    private boolean enteringRun = false;<a name="line.894"></a>
+<span class="sourceLineNo">895</span><a name="line.895"></a>
+<span class="sourceLineNo">896</span>    public EvictionThread(LruBlockCache cache) {<a name="line.896"></a>
+<span class="sourceLineNo">897</span>      super(Thread.currentThread().getName() + ".LruBlockCache.EvictionThread");<a name="line.897"></a>
+<span class="sourceLineNo">898</span>      setDaemon(true);<a name="line.898"></a>
+<span class="sourceLineNo">899</span>      this.cache = new WeakReference&lt;&gt;(cache);<a name="line.899"></a>
+<span class="sourceLineNo">900</span>    }<a name="line.900"></a>
+<span class="sourceLineNo">901</span><a name="line.901"></a>
+<span class="sourceLineNo">902</span>    @Override<a name="line.902"></a>
+<span class="sourceLineNo">903</span>    public void run() {<a name="line.903"></a>
+<span class="sourceLineNo">904</span>      enteringRun = true;<a name="line.904"></a>
+<span class="sourceLineNo">905</span>      while (this.go) {<a name="line.905"></a>
+<span class="sourceLineNo">906</span>        synchronized (this) {<a name="line.906"></a>
+<span class="sourceLineNo">907</span>          try {<a name="line.907"></a>
+<span class="sourceLineNo">908</span>            this.wait(1000 * 10/*Don't wait for ever*/);<a name="line.908"></a>
+<span class="sourceLineNo">909</span>          } catch (InterruptedException e) {<a name="line.909"></a>
+<span class="sourceLineNo">910</span>            LOG.warn("Interrupted eviction thread ", e);<a name="line.910"></a>
+<span class="sourceLineNo">911</span>            Thread.currentThread().interrupt();<a name="line.911"></a>
+<span class="sourceLineNo">912</span>          }<a name="line.912"></a>
+<span class="sourceLineNo">913</span>        }<a name="line.913"></a>
+<span class="sourceLineNo">914</span>        LruBlockCache cache = this.cache.get();<a name="line.914"></a>
+<span class="sourceLineNo">915</span>        if (cache == null) break;<a name="line.915"></a>
+<span class="sourceLineNo">916</span>        cache.evict();<a name="line.916"></a>
+<span class="sourceLineNo">917</span>      }<a name="line.917"></a>
+<span class="sourceLineNo">918</span>    }<a name="line.918"></a>
+<span class="sourceLineNo">919</span><a name="line.919"></a>
+<span class="sourceLineNo">920</span>    @edu.umd.cs.findbugs.annotations.SuppressWarnings(value="NN_NAKED_NOTIFY",<a name="line.920"></a>
+<span class="sourceLineNo">921</span>        justification="This is what we want")<a name="line.921"></a>
+<span class="sourceLineNo">922</span>    public void evict() {<a name="line.922"></a>
+<span class="sourceLineNo">923</span>      synchronized (this) {<a name="line.923"></a>
+<span class="sourceLineNo">924</span>        this.notifyAll();<a name="line.924"></a>
+<span class="sourceLineNo">925</span>      }<a name="line.925"></a>
+<span class="sourceLineNo">926</span>    }<a name="line.926"></a>
+<span class="sourceLineNo">927</span><a name="line.927"></a>
+<span class="sourceLineNo">928</span>    synchronized void shutdown() {<a name="line.928"></a>
+<span class="sourceLineNo">929</span>      this.go = false;<a name="line.929"></a>
+<span class="sourceLineNo">930</span>      this.notifyAll();<a name="line.930"></a>
+<span class="sourceLineNo">931</span>    }<a name="line.931"></a>
+<span class="sourceLineNo">932</span><a name="line.932"></a>
+<span class="sourceLineNo">933</span>    /**<a name="line.933"></a>
+<span class="sourceLineNo">934</span>     * Used for the test.<a name="line.934"></a>
+<span class="sourceLineNo">935</span>     */<a name="line.935"></a>
+<span class="sourceLineNo">936</span>    boolean isEnteringRun() {<a name="line.936"></a>
+<span class="sourceLineNo">937</span>      return this.enteringRun;<a name="line.937"></a>
+<span class="sourceLineNo">938</span>    }<a name="line.938"></a>
+<span class="sourceLineNo">939</span>  }<a name="line.939"></a>
+<span class="sourceLineNo">940</span><a name="line.940"></a>
+<span class="sourceLineNo">941</span>  /*<a name="line.941"></a>
+<span class="sourceLineNo">942</span>   * Statistics thread.  Periodically prints the cache statistics to the log.<a name="line.942"></a>
+<span class="sourceLineNo">943</span>   */<a name="line.943"></a>
+<span class="sourceLineNo">944</span>  static class StatisticsThread extends Thread {<a name="line.944"></a>
 <span class="sourceLineNo">945</span><a name="line.945"></a>
-<span class="sourceLineNo">946</span>    public StatisticsThread(LruBlockCache lru) {<a name="line.946"></a>
-<span class="sourceLineNo">947</span>      super("LruBlockCacheStats");<a name="line.947"></a>
-<span class="sourceLineNo">948</span>      setDaemon(true);<a name="line.948"></a>
-<span class="sourceLineNo">949</span>      this.lru = lru;<a name="line.949"></a>
-<span class="sourceLineNo">950</span>    }<a name="line.950"></a>
-<span class="sourceLineNo">951</span><a name="line.951"></a>
-<span class="sourceLineNo">952</span>    @Override<a name="line.952"></a>
-<span class="sourceLineNo">953</span>    public void run() {<a name="line.953"></a>
-<span class="sourceLineNo">954</span>      lru.logStats();<a name="line.954"></a>
-<span class="sourceLineNo">955</span>    }<a name="line.955"></a>
-<span class="sourceLineNo">956</span>  }<a name="line.956"></a>
-<span class="sourceLineNo">957</span><a name="line.957"></a>
-<span class="sourceLineNo">958</span>  public void logStats() {<a name="line.958"></a>
-<span class="sourceLineNo">959</span>    // Log size<a name="line.959"></a>
-<span class="sourceLineNo">960</span>    long totalSize = heapSize();<a name="line.960"></a>
-<span class="sourceLineNo">961</span>    long freeSize = maxSize - totalSize;<a name="line.961"></a>
-<span class="sourceLineNo">962</span>    LruBlockCache.LOG.info("totalSize=" + StringUtils.byteDesc(totalSize) + ", " +<a name="line.962"></a>
-<span class="sourceLineNo">963</span>        "freeSize=" + StringUtils.byteDesc(freeSize) + ", " +<a name="line.963"></a>
-<span class="sourceLineNo">964</span>        "max=" + StringUtils.byteDesc(this.maxSize) + ", " +<a name="line.964"></a>
-<span class="sourceLineNo">965</span>        "blockCount=" + getBlockCount() + ", " +<a name="line.965"></a>
-<span class="sourceLineNo">966</span>        "accesses=" + stats.getRequestCount() + ", " +<a name="line.966"></a>
-<span class="sourceLineNo">967</span>        "hits=" + stats.getHitCount() + ", " +<a name="line.967"></a>
-<span class="sourceLineNo">968</span>        "hitRatio=" + (stats.getHitCount() == 0 ?<a name="line.968"></a>
-<span class="sourceLineNo">969</span>          "0" : (StringUtils.formatPercent(stats.getHitRatio(), 2)+ ", ")) + ", " +<a name="line.969"></a>
-<span class="sourceLineNo">970</span>        "cachingAccesses=" + stats.getRequestCachingCount() + ", " +<a name="line.970"></a>
-<span class="sourceLineNo">971</span>        "cachingHits=" + stats.getHitCachingCount() + ", " +<a name="line.971"></a>
-<span class="sourceLineNo">972</span>        "cachingHitsRatio=" + (stats.getHitCachingCount() == 0 ?<a name="line.972"></a>
-<span class="sourceLineNo">973</span>          "0,": (StringUtils.formatPercent(stats.getHitCachingRatio(), 2) + ", ")) +<a name="line.973"></a>
-<span class="sourceLineNo">974</span>        "evictions=" + stats.getEvictionCount() + ", " +<a name="line.974"></a>
-<span class="sourceLineNo">975</span>        "evicted=" + stats.getEvictedCount() + ", " +<a name="line.975"></a>
-<span class="sourceLineNo">976</span>        "evictedPerRun=" + stats.evictedPerEviction());<a name="line.976"></a>
-<span class="sourceLineNo">977</span>  }<a name="line.977"></a>
-<span class="sourceLineNo">978</span><a name="line.978"></a>
-<span class="sourceLineNo">979</span>  /**<a name="line.979"></a>
-<span class="sourceLineNo">980</span>   * Get counter statistics for this cache.<a name="line.980"></a>
-<span class="sourceLineNo">981</span>   *<a name="line.981"></a>
-<span class="sourceLineNo">982</span>   * &lt;p&gt;Includes: total accesses, hits, misses, evicted blocks, and runs<a name="line.982"></a>
-<span class="sourceLineNo">983</span>   * of the eviction processes.<a name="line.983"></a>
-<span class="sourceLineNo">984</span>   */<a name="line.984"></a>
-<span class="sourceLineNo">985</span>  public CacheStats getStats() {<a name="line.985"></a>
-<span class="sourceLineNo">986</span>    return this.stats;<a name="line.986"></a>
-<span class="sourceLineNo">987</span>  }<a name="line.987"></a>
-<span class="sourceLineNo">988</span><a name="line.988"></a>
-<span class="sourceLineNo">989</span>  public final static long CACHE_FIXED_OVERHEAD = ClassSize.align(<a name="line.989"></a>
-<span class="sourceLineNo">990</span>      (4 * Bytes.SIZEOF_LONG) + (11 * ClassSize.REFERENCE) +<a name="line.990"></a>
-<span class="sourceLineNo">991</span>      (6 * Bytes.SIZEOF_FLOAT) + (2 * Bytes.SIZEOF_BOOLEAN)<a name="line.991"></a>
-<span class="sourceLineNo">992</span>      + ClassSize.OBJECT);<a name="line.992"></a>
-<span class="sourceLineNo">993</span><a name="line.993"></a>
-<span class="sourceLineNo">994</span>  @Override<a name="line.994"></a>
-<span class="sourceLineNo">995</span>  public long heapSize() {<a name="line.995"></a>
-<span class="sourceLineNo">996</span>    return getCurrentSize();<a name="line.996"></a>
-<span class="sourceLineNo">997</span>  }<a name="line.997"></a>
-<span class="sourceLineNo">998</span><a name="line.998"></a>
-<span class="sourceLineNo">999</span>  private static long calculateOverhead(long maxSize, long blockSize, int concurrency) {<a name="line.999"></a>
-<span class="sourceLineNo">1000</span>    // FindBugs ICAST_INTEGER_MULTIPLY_CAST_TO_LONG<a name="line.1000"></a>
-<span class="sourceLineNo">1001</span>    return CACHE_FIXED_OVERHEAD + ClassSize.CONCURRENT_HASHMAP<a name="line.1001"></a>
-<span class="sourceLineNo">1002</span>           + ((long) Math.ceil(maxSize * 1.2 / blockSize) * ClassSize.CONCURRENT_HASHMAP_ENTRY)<a name="line.1002"></a>
-<span class="sourceLineNo">1003</span>           + ((long) concurrency * ClassSize.CONCURRENT_HASHMAP_SEGMENT);<a name="line.1003"></a>
-<span class="sourceLineNo">1004</span>  }<a name="line.1004"></a>
-<span class="sourceLineNo">1005</span><a name="line.1005"></a>
-<span class="sourceLineNo">1006</span>  @Override<a name="line.1006"></a>
-<span class="sourceLineNo">1007</span>  public Iterator&lt;CachedBlock&gt; iterator() {<a name="line.1007"></a>
-<span class="sourceLineNo">1008</span>    final Iterator&lt;LruCachedBlock&gt; iterator = map.values().iterator();<a name="line.1008"></a>
-<span class="sourceLineNo">1009</span><a name="line.1009"></a>
-<span class="sourceLineNo">1010</span>    return new Iterator&lt;CachedBlock&gt;() {<a name="line.1010"></a>
-<span class="sourceLineNo">1011</span>      private final long now = System.nanoTime();<a name="line.1011"></a>
-<span class="sourceLineNo">1012</span><a name="line.1012"></a>
-<span class="sourceLineNo">1013</span>      @Override<a name="line.1013"></a>
-<span class="sourceLineNo">1014</span>      public boolean hasNext() {<a name="line.1014"></a>
-<span class="sourceLineNo">1015</span>        return iterator.hasNext();<a name="line.1015"></a>
-<span class="sourceLineNo">1016</span>      }<a name="line.1016"></a>
-<span class="sourceLineNo">1017</span><a name="line.1017"></a>
-<span class="sourceLineNo">1018</span>      @Override<a name="line.1018"></a>
-<span class="sourceLineNo">1019</span>      public CachedBlock next() {<a name="line.1019"></a>
-<span class="sourceLineNo">1020</span>        final LruCachedBlock b = iterator.next();<a name="line.1020"></a>
-<span class="sourceLineNo">1021</span>        return new CachedBlock() {<a name="line.1021"></a>
-<span class="sourceLineNo">1022</span>          @Override<a name="line.1022"></a>
-<span class="sourceLineNo">1023</span>          public String toString() {<a name="line.1023"></a>
-<span class="sourceLineNo">1024</span>            return BlockCacheUtil.toString(this, now);<a name="line.1024"></a>
-<span class="sourceLineNo">1025</span>          }<a name="line.1025"></a>
-<span class="sourceLineNo">1026</span><a name="line.1026"></a>
-<span class="sourceLineNo">1027</span>          @Override<a name="line.1027"></a>
-<span class="sourceLineNo">1028</span>          public BlockPriority getBlockPriority() {<a name="line.1028"></a>
-<span class="sourceLineNo">1029</span>            return b.getPriority();<a name="line.1029"></a>
-<span class="sourceLineNo">1030</span>          }<a name="line.1030"></a>
-<span class="sourceLineNo">1031</span><a name="line.1031"></a>
-<span class="sourceLineNo">1032</span>          @Override<a name="line.1032"></a>
-<span class="sourceLineNo">1033</span>          public BlockType getBlockType() {<a name="line.1033"></a>
-<span class="sourceLineNo">1034</span>            return b.getBuffer().getBlockType();<a name="line.1034"></a>
-<span class="sourceLineNo">1035</span>          }<a name="line.1035"></a>
-<span class="sourceLineNo">1036</span><a name="line.1036"></a>
-<span class="sourceLineNo">1037</span>          @Override<a name="line.1037"></a>
-<span class="sourceLineNo">1038</span>          public long getOffset() {<a name="line.1038"></a>
-<span class="sourceLineNo">1039</span>            return b.getCacheKey().getOffset();<a name="line.1039"></a>
-<span class="sourceLineNo">1040</span>          }<a name="line.1040"></a>
-<span class="sourceLineNo">1041</span><a name="line.1041"></a>
-<span class="sourceLineNo">1042</span>          @Override<a name="line.1042"></a>
-<span class="sourceLineNo">1043</span>          public long getSize() {<a name="line.1043"></a>
-<span class="sourceLineNo">1044</span>            return b.getBuffer().heapSize();<a name="line.1044"></a>
-<span class="sourceLineNo">1045</span>          }<a name="line.1045"></a>
-<span class="sourceLineNo">1046</span><a name="line.1046"></a>
-<span class="sourceLineNo">1047</span>          @Override<a name="line.1047"></a>
-<span class="sourceLineNo">1048</span>          public long getCachedTime() {<a name="line.1048"></a>
-<span class="sourceLineNo">1049</span>            return b.getCachedTime();<a name="line.1049"></a>
-<span class="sourceLineNo">1050</span>          }<a name="line.1050"></a>
-<span class="sourceLineNo">1051</span><a name="line.1051"></a>
-<span class="sourceLineNo">1052</span>          @Override<a name="line.1052"></a>
-<span class="sourceLineNo">1053</span>          public String getFilename() {<a name="line.1053"></a>
-<span class="sourceLineNo">1054</span>            return b.getCacheKey().getHfileName();<a name="line.1054"></a>
-<span class="sourceLineNo">1055</span>          }<a name="line.1055"></a>
-<span class="sourceLineNo">1056</span><a name="line.1056"></a>
-<span class="sourceLineNo">1057</span>          @Override<a name="line.1057"></a>
-<span class="sourceLineNo">1058</span>          public int compareTo(CachedBlock other) {<a name="line.1058"></a>
-<span class="sourceLineNo">1059</span>            int diff = this.getFilename().compareTo(other.getFilename());<a name="line.1059"></a>
-<span class="sourceLineNo">1060</span>            if (diff != 0) return diff;<a name="line.1060"></a>
-<span class="sourceLineNo">1061</span>            diff = Long.compare(this.getOffset(), other.getOffset());<a name="line.1061"></a>
+<span class="sourceLineNo">946</span>    private final LruBlockCache lru;<a name="line.946"></a>
+<span class="sourceLineNo">947</span><a name="line.947"></a>
+<span class="sourceLineNo">948</span>    public StatisticsThread(LruBlockCache lru) {<a name="line.948"></a>
+<span class="sourceLineNo">949</span>      super("LruBlockCacheStats");<a name="line.949"></a>
+<span class="sourceLineNo">950</span>      setDaemon(true);<a name="line.950"></a>
+<span class="sourceLineNo">951</span>      this.lru = lru;<a name="line.951"></a>
+<span class="sourceLineNo">952</span>    }<a name="line.952"></a>
+<span class="sourceLineNo">953</span><a name="line.953"></a>
+<span class="sourceLineNo">954</span>    @Override<a name="line.954"></a>
+<span class="sourceLineNo">955</span>    public void run() {<a name="line.955"></a>
+<span class="sourceLineNo">956</span>      lru.logStats();<a name="line.956"></a>
+<span class="sourceLineNo">957</span>    }<a name="line.957"></a>
+<span class="sourceLineNo">958</span>  }<a name="line.958"></a>
+<span class="sourceLineNo">959</span><a name="line.959"></a>
+<span class="sourceLineNo">960</span>  public void logStats() {<a name="line.960"></a>
+<span class="sourceLineNo">961</span>    // Log size<a name="line.961"></a>
+<span class="sourceLineNo">962</span>    long totalSize = heapSize();<a name="line.962"></a>
+<span class="sourceLineNo">963</span>    long freeSize = maxSize - totalSize;<a name="line.963"></a>
+<span class="sourceLineNo">964</span>    LruBlockCache.LOG.info("totalSize=" + StringUtils.byteDesc(totalSize) + ", " +<a name="line.964"></a>
+<span class="sourceLineNo">965</span>        "freeSize=" + StringUtils.byteDesc(freeSize) + ", " +<a name="line.965"></a>
+<span class="sourceLineNo">966</span>        "max=" + StringUtils.byteDesc(this.maxSize) + ", " +<a name="line.966"></a>
+<span class="sourceLineNo">967</span>        "blockCount=" + getBlockCount() + ", " +<a name="line.967"></a>
+<span class="sourceLineNo">968</span>        "accesses=" + stats.getRequestCount() + ", " +<a name="line.968"></a>
+<span class="sourceLineNo">969</span>        "hits=" + stats.getHitCount() + ", " +<a name="line.969"></a>
+<span class="sourceLineNo">970</span>        "hitRatio=" + (stats.getHitCount() == 0 ?<a name="line.970"></a>
+<span class="sourceLineNo">971</span>          "0" : (StringUtils.formatPercent(stats.getHitRatio(), 2)+ ", ")) + ", " +<a name="line.971"></a>
+<span class="sourceLineNo">972</span>        "cachingAccesses=" + stats.getRequestCachingCount() + ", " +<a name="line.972"></a>
+<span class="sourceLineNo">973</span>        "cachingHits=" + stats.getHitCachingCount() + ", " +<a name="line.973"></a>
+<span class="sourceLineNo">974</span>        "cachingHitsRatio=" + (stats.getHitCachingCount() == 0 ?<a name="line.974"></a>
+<span class="sourceLineNo">975</span>          "0,": (StringUtils.formatPercent(stats.getHitCachingRatio(), 2) + ", ")) +<a name="line.975"></a>
+<span class="sourceLineNo">976</span>        "evictions=" + stats.getEvictionCount() + ", " +<a name="line.976"></a>
+<span class="sourceLineNo">977</span>        "evicted=" + stats.getEvictedCount() + ", " +<a name="line.977"></a>
+<span class="sourceLineNo">978</span>        "evictedPerRun=" + stats.evictedPerEviction());<a name="line.978"></a>
+<span class="sourceLineNo">979</span>  }<a name="line.979"></a>
+<span class="sourceLineNo">980</span><a name="line.980"></a>
+<span class="sourceLineNo">981</span>  /**<a name="line.981"></a>
+<span class="sourceLineNo">982</span>   * Get counter statistics for this cache.<a name="line.982"></a>
+<span class="sourceLineNo">983</span>   *<a name="line.983"></a>
+<span class="sourceLineNo">984</span>   * &lt;p&gt;Includes: total accesses, hits, misses, evicted blocks, and runs<a name="line.984"></a>
+<span class="sourceLineNo">985</span>   * of the eviction processes.<a name="line.985"></a>
+<span class="sourceLineNo">986</span>   */<a name="line.986"></a>
+<span class="sourceLineNo">987</span>  public CacheStats getStats() {<a name="line.987"></a>
+<span class="sourceLineNo">988</span>    return this.stats;<a name="line.988"></a>
+<span class="sourceLineNo">989</span>  }<a name="line.989"></a>
+<span class="sourceLineNo">990</span><a name="line.990"></a>
+<span class="sourceLineNo">991</span>  public final static long CACHE_FIXED_OVERHEAD = ClassSize.align(<a name="line.991"></a>
+<span class="sourceLineNo">992</span>      (4 * Bytes.SIZEOF_LONG) + (11 * ClassSize.REFERENCE) +<a name="line.992"></a>
+<span class="sourceLineNo">993</span>      (6 * Bytes.SIZEOF_FLOAT) + (2 * Bytes.SIZEOF_BOOLEAN)<a name="line.993"></a>
+<span class="sourceLineNo">994</span>      + ClassSize.OBJECT);<a name="line.994"></a>
+<span class="sourceLineNo">995</span><a name="line.995"></a>
+<span class="sourceLineNo">996</span>  @Override<a name="line.996"></a>
+<span class="sourceLineNo">997</span>  public long heapSize() {<a name="line.997"></a>
+<span class="sourceLineNo">998</span>    return getCurrentSize();<a name="line.998"></a>
+<span class="sourceLineNo">999</span>  }<a name="line.999"></a>
+<span class="sourceLineNo">1000</span><a name="line.1000"></a>
+<span class="sourceLineNo">1001</span>  private static long calculateOverhead(long maxSize, long blockSize, int concurrency) {<a name="line.1001"></a>
+<span class="sourceLineNo">1002</span>    // FindBugs ICAST_INTEGER_MULTIPLY_CAST_TO_LONG<a name="line.1002"></a>
+<span class="sourceLineNo">1003</span>    return CACHE_FIXED_OVERHEAD + ClassSize.CONCURRENT_HASHMAP<a name="line.1003"></a>
+<span class="sourceLineNo">1004</span>           + ((long) Math.ceil(maxSize * 1.2 / blockSize) * ClassSize.CONCURRENT_HASHMAP_ENTRY)<a name="line.1004"></a>
+<span class="sourceLineNo">1005</span>           + ((long) concurrency * ClassSize.CONCURRENT_HASHMAP_SEGMENT);<a name="line.1005"></a>
+<span class="sourceLineNo">1006</span>  }<a name="line.1006"></a>
+<span class="sourceLineNo">1007</span><a name="line.1007"></a>
+<span class="sourceLineNo">1008</span>  @Override<a name="line.1008"></a>
+<span class="sourceLineNo">1009</span>  public Iterator&lt;CachedBlock&gt; iterator() {<a name="line.1009"></a>
+<span class="sourceLineNo">1010</span>    final Iterator&lt;LruCachedBlock&gt; iterator = map.values().iterator();<a name="line.1010"></a>
+<span class="sourceLineNo">1011</span><a name="line.1011"></a>
+<span class="sourceLineNo">1012</span>    return new Iterator&lt;CachedBlock&gt;() {<a name="line.1012"></a>
+<span class="sourceLineNo">1013</span>      private final long now = System.nanoTime();<a name="line.1013"></a>
+<span class="sourceLineNo">1014</span><a name="line.1014"></a>
+<span class="sourceLineNo">1015</span>      @Override<a name="line.1015"></a>
+<span class="sourceLineNo">1016</span>      public boolean hasNext() {<a name="line.1016"></a>
+<span class="sourceLineNo">1017</span>        return iterator.hasNext();<a name="line.1017"></a>
+<span class="sourceLineNo">1018</span>      }<a name="line.1018"></a>
+<span class="sourceLineNo">1019</span><a name="line.1019"></a>
+<span class="sourceLineNo">1020</span>      @Override<a name="line.1020"></a>
+<span class="sourceLineNo">1021</span>      public CachedBlock next() {<a name="line.1021"></a>
+<span class="sourceLineNo">1022</span>        final LruCachedBlock b = iterator.next();<a name="line.1022"></a>
+<span class="sourceLineNo">1023</span>        return new CachedBlock() {<a name="line.1023"></a>
+<span class="sourceLineNo">1024</span>          @Override<a name="line.1024"></a>
+<span class="sourceLineNo">1025</span>          public String toString() {<a name="line.1025"></a>
+<span class="sourceLineNo">1026</span>            return BlockCacheUtil.toString(this, now);<a name="line.1026"></a>
+<span class="sourceLineNo">1027</span>          }<a name="line.1027"></a>
+<span class="sourceLineNo">1028</span><a name="line.1028"></a>
+<span class="sourceLineNo">1029</span>          @Override<a name="line.1029"></a>
+<span class="sourceLineNo">1030</span>          public BlockPriority getBlockPriority() {<a name="line.1030"></a>
+<span class="sourceLineNo">1031</span>            return b.getPriority();<a name="line.1031"></a>
+<span class="sourceLineNo">1032</span>          }<a name="line.1032"></a>
+<span class="sourceLineNo">1033</span><a name="line.1033"></a>
+<span class="sourceLineNo">1034</span>          @Override<a name="line.1034"></a>
+<span class="sourceLineNo">1035</span>          public BlockType getBlockType() {<a name="line.1035"></a>
+<span class="sourceLineNo">1036</span>            return b.getBuffer().getBlockType();<a name="line.1036"></a>
+<span class="sourceLineNo">1037</span>          }<a name="line.1037"></a>
+<span class="sourceLineNo">1038</span><a name="line.1038"></a>
+<span class="sourceLineNo">1039</span>          @Override<a name="line.1039"></a>
+<span class="sourceLineNo">1040</span>          public long getOffset() {<a name="line.1040"></a>
+<span class="sourceLineNo">1041</span>            return b.getCacheKey().getOffset();<a name="line.1041"></a>
+<span class="sourceLineNo">1042</span>          }<a name="line.1042"></a>
+<span class="sourceLineNo">1043</span><a name="line.1043"></a>
+<span class="sourceLineNo">1044</span>          @Override<a name="line.1044"></a>
+<span class="sourceLineNo">1045</span>          public long getSize() {<a name="line.1045"></a>
+<span class="sourceLineNo">1046</span>            return b.getBuffer().heapSize();<a name="line.1046"></a>
+<span class="sourceLineNo">1047</span>          }<a name="line.1047"></a>
+<span class="sourceLineNo">1048</span><a name="line.1048"></a>
+<span class="sourceLineNo">1049</span>          @Override<a name="line.1049"></a>
+<span class="sourceLineNo">1050</span>          public long getCachedTime() {<a name="line.1050"></a>
+<span class="sourceLineNo">1051</span>            return b.getCachedTime();<a name="line.1051"></a>
+<span class="sourceLineNo">1052</span>          }<a name="line.1052"></a>
+<span class="sourceLineNo">1053</span><a name="line.1053"></a>
+<span class="sourceLineNo">1054</span>          @Override<a name="line.1054"></a>
+<span class="sourceLineNo">1055</span>          public String getFilename() {<a name="line.1055"></a>
+<span class="sourceLineNo">1056</span>            return b.getCacheKey().getHfileName();<a name="line.1056"></a>
+<span class="sourceLineNo">1057</span>          }<a name="line.1057"></a>
+<span class="sourceLineNo">1058</span><a name="line.1058"></a>
+<span class="sourceLineNo">1059</span>          @Override<a name="line.1059"></a>
+<span class="sourceLineNo">1060</span>          public int compareTo(CachedBlock other) {<a name="line.1060"></a>
+<span class="sourceLineNo">1061</span>            int diff = this.getFilename().compareTo(other.getFilename());<a name="line.1061"></a>
 <span class="sourceLineNo">1062</span>            if (diff != 0) return diff;<a name="line.1062"></a>
-<span class="sourceLineNo">1063</span>            if (other.getCachedTime() &lt; 0 || this.getCachedTime() &lt; 0) {<a name="line.1063"></a>
-<span class="sourceLineNo">1064</span>              throw new IllegalStateException(this.getCachedTime() + ", " + other.getCachedTime());<a name="line.1064"></a>
-<span class="sourceLineNo">1065</span>            }<a name="line.1065"></a>
-<span class="sourceLineNo">1066</span>            return Long.compare(other.getCachedTime(), this.getCachedTime());<a name="line.1066"></a>
-<span class="sourceLineNo">1067</span>          }<a name="line.1067"></a>
-<span class="sourceLineNo">1068</span><a name="line.1068"></a>
-<span class="sourceLineNo">1069</span>          @Override<a name="line.1069"></a>
-<span class="sourceLineNo">1070</span>          public int hashCode() {<a name="line.1070"></a>
-<span class="sourceLineNo">1071</span>            return b.hashCode();<a name="line.1071"></a>
-<span class="sourceLineNo">1072</span>          }<a name="line.1072"></a>
-<span class="sourceLineNo">1073</span><a name="line.1073"></a>
-<span class="sourceLineNo">1074</span>          @Override<a name="line.1074"></a>
-<span class="sourceLineNo">1075</span>          public boolean equals(Object obj) {<a name="line.1075"></a>
-<span class="sourceLineNo">1076</span>            if (obj instanceof CachedBlock) {<a name="line.1076"></a>
-<span class="sourceLineNo">1077</span>              CachedBlock cb = (CachedBlock)obj;<a name="line.1077"></a>
-<span class="sourceLineNo">1078</span>              return compareTo(cb) == 0;<a name="line.1078"></a>
-<span class="sourceLineNo">1079</span>            } else {<a name="line.1079"></a>
-<span class="sourceLineNo">1080</span>              return false;<a name="line.1080"></a>
-<span class="sourceLineNo">1081</span>            }<a name="line.1081"></a>
-<span class="sourceLineNo">1082</span>          }<a name="line.1082"></a>
-<span class="sourceLineNo">1083</span>        };<a name="line.1083"></a>
-<span class="sourceLineNo">1084</span>      }<a name="line.1084"></a>
-<span class="sourceLineNo">1085</span><a name="line.1085"></a>
-<span class="sourceLineNo">1086</span>      @Override<a name="line.1086"></a>
-<span class="sourceLineNo">1087</span>      public void remove() {<a name="line.1087"></a>
-<span class="sourceLineNo">1088</span>        throw new UnsupportedOperationException();<a name="line.1088"></a>
-<span class="sourceLineNo">1089</span>      }<a name="line.1089"></a>
-<span class="sourceLineNo">1090</span>    };<a name="line.1090"></a>
-<span class="sourceLineNo">1091</span>  }<a name="line.1091"></a>
-<span class="sourceLineNo">1092</span><a name="line.1092"></a>
-<span class="sourceLineNo">1093</span>  // Simple calculators of sizes given factors and maxSize<a name="line.1093"></a>
+<span class="sourceLineNo">1063</span>            diff = Long.compare(this.getOffset(), other.getOffset());<a name="line.1063"></a>
+<span class="sourceLineNo">1064</span>            if (diff != 0) return diff;<a name="line.1064"></a>
+<span class="sourceLineNo">1065</span>            if (other.getCachedTime() &lt; 0 || this.getCachedTime() &lt; 0) {<a name="line.1065"></a>
+<span class="sourceLineNo">1066</span>              throw new IllegalStateException(this.getCachedTime() + ", " + other.getCachedTime());<a name="line.1066"></a>
+<span class="sourceLineNo">1067</span>            }<a name="line.1067"></a>
+<span class="sourceLineNo">1068</span>            return Long.compare(other.getCachedTime(), this.getCachedTime());<a name="line.1068"></a>
+<span class="sourceLineNo">1069</span>          }<a name="line.1069"></a>
+<span class="sourceLineNo">1070</span><a name="line.1070"></a>
+<span class="sourceLineNo">1071</span>          @Override<a name="line.1071"></a>
+<span class="sourceLineNo">1072</span>          public int hashCode() {<a name="line.1072"></a>
+<span class="sourceLineNo">1073</span>            return b.hashCode();<a name="line.1073"></a>
+<span class="sourceLineNo">1074</span>          }<a name="line.1074"></a>
+<span class="sourceLineNo">1075</span><a name="line.1075"></a>
+<span class="sourceLineNo">1076</span>          @Override<a name="line.1076"></a>
+<span class="sourceLineNo">1077</span>          public boolean equals(Object obj) {<a name="line.1077"></a>
+<span class="sourceLineNo">1078</span>            if (obj instanceof CachedBlock) {<a name="line.1078"></a>
+<span class="sourceLineNo">1079</span>              CachedBlock cb = (CachedBlock)obj;<a name="line.1079"></a>
+<span class="sourceLineNo">1080</span>              return compareTo(cb) == 0;<a name="line.1080"></a>
+<span class="sourceLineNo">1081</span>            } else {<a name="line.1081"></a>
+<span class="sourceLineNo">1082</span>              return false;<a name="line.1082"></a>
+<span class="sourceLineNo">1083</span>            }<a name="line.1083"></a>
+<span class="sourceLineNo">1084</span>          }<a name="line.1084"></a>
+<span class="sourceLineNo">1085</span>        };<a name="line.1085"></a>
+<span class="sourceLineNo">1086</span>      }<a name="line.1086"></a>
+<span class="sourceLineNo">1087</span><a name="line.1087"></a>
+<span class="sourceLineNo">1088</span>      @Override<a name="line.1088"></a>
+<span class="sourceLineNo">1089</span>      public void remove() {<a name="line.1089"></a>
+<span class="sourceLineNo">1090</span>        throw new UnsupportedOperationException();<a name="line.1090"></a>
+<span class="sourceLineNo">1091</span>      }<a name="line.1091"></a>
+<span class="sourceLineNo">1092</span>    };<a name="line.1092"></a>
+<span class="sourceLineNo">1093</span>  }<a name="line.1093"></a>
 <span class="sourceLineNo">1094</span><a name="line.1094"></a>
-<span class="sourceLineNo">1095</span>  long acceptableSize() {<a name="line.1095"></a>
-<span class="sourceLineNo">1096</span>    return (long)Math.floor(this.maxSize * this.acceptableFactor);<a name="line.1096"></a>
-<span class="sourceLineNo">1097</span>  }<a name="line.1097"></a>
-<span class="sourceLineNo">1098</span>  private long minSize() {<a name="line.1098"></a>
-<span class="sourceLineNo">1099</span>    return (long)Math.floor(this.maxSize * this.minFactor);<a name="line.1099"></a>
-<span class="sourceLineNo">1100</span>  }<a name="line.1100"></a>
-<span class="sourceLineNo">1101</span>  private long singleSize() {<a name="line.1101"></a>
-<span class="sourceLineNo">1102</span>    return (long)Math.floor(this.maxSize * this.singleFactor * this.minFactor);<a name="line.1102"></a>
-<span class="sourceLineNo">1103</span>  }<a name="line.1103"></a>
-<span class="sourceLineNo">1104</span>  private long multiSize() {<a name="line.1104"></a>
-<span class="sourceLineNo">1105</span>    return (long)Math.floor(this.maxSize * this.multiFactor * this.minFactor);<a name="line.1105"></a>
-<span class="sourceLineNo">1106</span>  }<a name="line.1106"></a>
-<span class="sourceLineNo">1107</span>  private long memorySize() {<a name="line.1107"></a>
-<span class="sourceLineNo">1108</span>    return (long) Math.floor(this.maxSize * this.memoryFactor * this.minFactor);<a name="line.1108"></a>
-<span class="sourceLineNo">1109</span>  }<a name="line.1109"></a>
-<span class="sourceLineNo">1110</span><a name="line.1110"></a>
-<span class="sourceLineNo">1111</span>  public void shutdown() {<a name="line.1111"></a>
-<span class="sourceLineNo">1112</span>    if (victimHandler != null) {<a name="line.1112"></a>
-<span class="sourceLineNo">1113</span>      victimHandler.shutdown();<a name="line.1113"></a>
-<span class="sourceLineNo">1114</span>    }<a name="line.1114"></a>
-<span class="sourceLineNo">1115</span>    this.scheduleThreadPool.shutdown();<a name="line.1115"></a>
-<span class="sourceLineNo">1116</span>    for (int i = 0; i &lt; 10; i++) {<a name="line.1116"></a>
-<span class="sourceLineNo">1117</span>      if (!this.scheduleThreadPool.isShutdown()) {<a name="line.1117"></a>
-<span class="sourceLineNo">1118</span>        try {<a name="line.1118"></a>
-<span class="sourceLineNo">1119</span>          Thread.sleep(10);<a name="line.1119"></a>
-<span class="sourceLineNo">1120</span>        } catch (InterruptedException e) {<a name="line.1120"></a>
-<span class="sourceLineNo">1121</span>          LOG.warn("Interrupted while sleeping");<a name="line.1121"></a>
-<span class="sourceLineNo">1122</span>          Thread.currentThread().interrupt();<a name="line.1122"></a>
-<span class="sourceLineNo">1123</span>          break;<a name="line.1123"></a>
-<span class="sourceLineNo">1124</span>        }<a name="line.1124"></a>
-<span class="sourceLineNo">1125</span>      }<a name="line.1125"></a>
-<span class="sourceLineNo">1126</span>    }<a name="line.1126"></a>
-<span class="sourceLineNo">1127</span><a name="line.1127"></a>
-<span class="sourceLineNo">1128</span>    if (!this.scheduleThreadPool.isShutdown()) {<a name="line.1128"></a>
-<span class="sourceLineNo">1129</span>      List&lt;Runnable&gt; runnables = this.scheduleThreadPool.shutdownNow();<a name="line.1129"></a>
-<span class="sourceLineNo">1130</span>      LOG.debug("Still running " + runnables);<a name="line.1130"></a>
-<span class="sourceLineNo">1131</span>    }<a name="line.1131"></a>
-<span class="sourceLineNo">1132</span>    this.evictionThread.shutdown();<a name="line.1132"></a>
-<span class="sourceLineNo">1133</span>  }<a name="line.1133"></a>
-<span class="sourceLineNo">1134</span><a name="line.1134"></a>
-<span class="sourceLineNo">1135</span>  /** Clears the cache. Used in tests. */<a name="line.1135"></a>
-<span class="sourceLineNo">1136</span>  @VisibleForTesting<a name="line.1136"></a>
-<span class="sourceLineNo">1137</span>  public void clearCache() {<a name="line.1137"></a>
-<span class="sourceLineNo">1138</span>    this.map.clear();<a name="line.1138"></a>
-<span class="sourceLineNo">1139</span>    this.elements.set(0);<a name="line.1139"></a>
-<span class="sourceLineNo">1140</span>  }<a name="line.1140"></a>
-<span class="sourceLineNo">1141</span><a name="line.1141"></a>
-<span class="sourceLineNo">1142</span>  /**<a name="line.1142"></a>
-<span class="sourceLineNo">1143</span>   * Used in testing. May be very inefficient.<a name="line.1143"></a>
-<span class="sourceLineNo">1144</span>   *<a name="line.1144"></a>
-<span class="sourceLineNo">1145</span>   * @return the set of cached file names<a name="line.1145"></a>
-<span class="sourceLineNo">1146</span>   */<a name="line.1146"></a>
-<span class="sourceLineNo">1147</span>  @VisibleForTesting<a name="line.1147"></a>
-<span class="sourceLineNo">1148</span>  SortedSet&lt;String&gt; getCachedFileNamesForTest() {<a name="line.1148"></a>
-<span class="sourceLineNo">1149</span>    SortedSet&lt;String&gt; fileNames = new TreeSet&lt;&gt;();<a name="line.1149"></a>
-<span class="sourceLineNo">1150</span>    for (BlockCacheKey cacheKey : map.keySet()) {<a name="line.1150"></a>
-<span class="sourceLineNo">1151</span>      fileNames.add(cacheKey.getHfileName());<a name="line.1151"></a>
-<span class="sourceLineNo">1152</span>    }<a name="line.1152"></a>
-<span class="sourceLineNo">1153</span>    return fileNames;<a name="line.1153"></a>
-<span class="sourceLineNo">1154</span>  }<a name="line.1154"></a>
-<span class="sourceLineNo">1155</span><a name="line.1155"></a>
-<span class="sourceLineNo">1156</span>  @VisibleForTesting<a name="line.1156"></a>
-<span class="sourceLineNo">1157</span>  Map&lt;BlockType, Integer&gt; getBlockTypeCountsForTest() {<a name="line.1157"></a>
-<span class="sourceLineNo">1158</span>    Map&lt;BlockType, Integer&gt; counts = new EnumMap&lt;&gt;(BlockType.class);<a name="line.1158"></a>
-<span class="sourceLineNo">1159</span>    for (LruCachedBlock cb : map.values()) {<a name="line.1159"></a>
-<span class="sourceLineNo">1160</span>      BlockType blockType = cb.getBuffer().getBlockType();<a name="line.1160"></a>
-<span class="sourceLineNo">1161</span>      Integer count = counts.get(blockType);<a name="line.1161"></a>
-<span class="sourceLineNo">1162</span>      counts.put(blockType, (count == null ? 0 : count) + 1);<a name="line.1162"></a>
-<span class="sourceLineNo">1163</span>    }<a name="line.1163"></a>
-<span class="sourceLineNo">1164</span>    return counts;<a name="line.1164"></a>
-<span class="sourceLineNo">1165</span>  }<a name="line.1165"></a>
-<span class="sourceLineNo">1166</span><a name="line.1166"></a>
-<span class="sourceLineNo">1167</span>  @VisibleForTesting<a name="line.1167"></a>
-<span class="sourceLineNo">1168</span>  public Map&lt;DataBlockEncoding, Integer&gt; getEncodingCountsForTest() {<a name="line.1168"></a>
-<span class="sourceLineNo">1169</span>    Map&lt;DataBlockEncoding, Integer&gt; counts = new EnumMap&lt;&gt;(DataBlockEncoding.class);<a name="line.1169"></a>
-<span class="sourceLineNo">1170</span>    for (LruCachedBlock block : map.values()) {<a name="line.1170"></a>
-<span class="sourceLineNo">1171</span>      DataBlockEncoding encoding = ((HFileBlock) block.getBuffer()).getDataBlockEncoding();<a name="line.1171"></a>
-<span class="sourceLineNo">1172</span>      Integer count = counts.get(encoding);<a name="line.1172"></a>
-<span class="sourceLineNo">1173</span>      counts.put(encoding, (count == null ? 0 : count) + 1);<a name="line.1173"></a>
-<span class="sourceLineNo">1174</span>    }<a name="line.1174"></a>
-<span class="sourceLineNo">1175</span>    return counts;<a name="line.1175"></a>
-<span class="sourceLineNo">1176</span>  }<a name="line.1176"></a>
-<span class="sourceLineNo">1177</span><a name="line.1177"></a>
-<span class="sourceLineNo">1178</span>  public void setVictimCache(BlockCache handler) {<a name="line.1178"></a>
-<span class="sourceLineNo">1179</span>    assert victimHandler == null;<a name="line.1179"></a>
-<span class="sourceLineNo">1180</span>    victimHandler = handler;<a name="line.1180"></a>
-<span class="sourceLineNo">1181</span>  }<a name="line.1181"></a>
-<span class="sourceLineNo">1182</span><a name="line.1182"></a>
-<span class="sourceLineNo">1183</span>  @VisibleForTesting<a name="line.1183"></a>
-<span class="sourceLineNo">1184</span>  Map&lt;BlockCacheKey, LruCachedBlock&gt; getMapForTests() {<a name="line.1184"></a>
-<span class="sourceLineNo">1185</span>    return map;<a name="line.1185"></a>
-<span class="sourceLineNo">1186</span>  }<a name="line.1186"></a>
-<span class="sourceLineNo">1187</span><a name="line.1187"></a>
-<span class="sourceLineNo">1188</span>  BlockCache getVictimHandler() {<a name="line.1188"></a>
-<span class="sourceLineNo">1189</span>    return this.victimHandler;<a name="line.1189"></a>
-<span class="sourceLineNo">1190</span>  }<a name="line.1190"></a>
-<span class="sourceLineNo">1191</span><a name="line.1191"></a>
-<span class="sourceLineNo">1192</span>  @Override<a name="line.1192"></a>
-<span class="sourceLineNo">1193</span>  @JsonIgnore<a name="line.1193"></a>
-<span class="sourceLineNo">1194</span>  public BlockCache[] getBlockCaches() {<a name="line.1194"></a>
-<span class="sourceLineNo">1195</span>    if (victimHandler != null)<a name="line.1195"></a>
-<span class="sourceLineNo">1196</span>      return new BlockCache[] {this, this.victimHandler};<a name="line.1196"></a>
-<span class="sourceLineNo">1197</span>    return null;<a name="line.1197"></a>
-<span class="sourceLineNo">1198</span>  }<a name="line.1198"></a>
-<span class="sourceLineNo">1199</span><a name="line.1199"></a>
-<span class="sourceLineNo">1200</span>  @Override<a name="line.1200"></a>
-<span class="sourceLineNo">1201</span>  public void returnBlock(BlockCacheKey cacheKey, Cacheable block) {<a name="line.1201"></a>
-<span class="sourceLineNo">1202</span>    // There is no SHARED type here in L1. But the block might have been served from the Victim<a name="line.1202"></a>
-<span class="sourceLineNo">1203</span>    // handler L2 cache. (when the Combined mode = false). So just try return this block to<a name="line.1203"></a>
-<span class="sourceLineNo">1204</span>    // L2 victim handler cache.<a name="line.1204"></a>
-<span class="sourceLineNo">1205</span>    // Note : In case of CombinedBlockCache, we will have this victimHandler configured for L1<a name="line.1205"></a>
-<span class="sourceLineNo">1206</span>    // cache. But CombinedBlockCache will only call returnBlock on L2 cache.<a name="line.1206"></a>
-<span class="sourceLineNo">1207</span>    if (this.victimHandler != null) {<a name="line.1207"></a>
-<span class="sourceLineNo">1208</span>      this.victimHandler.returnBlock(cacheKey, block);<a name="line.1208"></a>
-<span class="sourceLineNo">1209</span>    }<a name="line.1209"></a>
-<span class="sourceLineNo">1210</span>  }<a name="line.1210"></a>
-<span class="sourceLineNo">1211</span>}<a name="line.1211"></a>
+<span class="sourceLineNo">1095</span>  // Simple calculators of sizes given factors and maxSize<a name="line.1095"></a>
+<span class="sourceLineNo">1096</span><a name="line.1096"></a>
+<span class="sourceLineNo">1097</span>  long acceptableSize() {<a name="line.1097"></a>
+<span class="sourceLineNo">1098</span>    return (long)Math.floor(this.maxSize * this.acceptableFactor);<a name="line.1098"></a>
+<span class="sourceLineNo">1099</span>  }<a name="line.1099"></a>
+<span class="sourceLineNo">1100</span>  private long minSize() {<a name="line.1100"></a>
+<span class="sourceLineNo">1101</span>    return (long)Math.floor(this.maxSize * this.minFactor);<a name="line.1101"></a>
+<span class="sourceLineNo">1102</span>  }<a name="line.1102"></a>
+<span class="sourceLineNo">1103</span>  private long singleSize() {<a name="line.1103"></a>
+<span class="sourceLineNo">1104</span>    return (long)Math.floor(this.maxSize * this.singleFactor * this.minFactor);<a name="line.1104"></a>
+<span class="sourceLineNo">1105</span>  }<a name="line.1105"></a>
+<span class="sourceLineNo">1106</span>  private long multiSize() {<a name="line.1106"></a>
+<span class="sourceLineNo">1107</span>    return (long)Math.floor(this.maxSize * this.multiFactor * this.minFactor);<a name="line.1107"></a>
+<span class="sourceLineNo">1108</span>  }<a name="line.1108"></a>
+<span class="sourceLineNo">1109</span>  private long memorySize() {<a name="line.1109"></a>
+<span class="sourceLineNo">1110</span>    return (long) Math.floor(this.maxSize * this.memoryFactor * this.minFactor);<a name="line.1110"></a>
+<span class="sourceLineNo">1111</span>  }<a name="line.1111"></a>
+<span class="sourceLineNo">1112</span><a name="line.1112"></a>
+<span class="sourceLineNo">1113</span>  public void shutdown() {<a name="line.1113"></a>
+<span class="sourceLineNo">1114</span>    if (victimHandler != null) {<a name="line.1114"></a>
+<span class="sourceLineNo">1115</span>      victimHandler.shutdown();<a name="line.1115"></a>
+<span class="sourceLineNo">1116</span>    }<a name="line.1116"></a>
+<span class="sourceLineNo">1117</span>    this.scheduleThreadPool.shutdown();<a name="line.1117"></a>
+<span class="sourceLineNo">1118</span>    for (int i = 0; i &lt; 10; i++) {<a name="line.1118"></a>
+<span class="sourceLineNo">1119</span>      if (!this.scheduleThreadPool.isShutdown()) {<a name="line.1119"></a>
+<span class="sourceLineNo">1120</span>        try {<a name="line.1120"></a>
+<span class="sourceLineNo">1121</span>          Thread.sleep(10);<a name="line.1121"></a>
+<span class="sourceLineNo">1122</span>        } catch (InterruptedException e) {<a name="line.1122"></a>
+<span class="sourceLineNo">1123</span>          LOG.warn("Interrupted while sleeping");<a name="line.1123"></a>
+<span class="sourceLineNo">1124</span>          Thread.currentThread().interrupt();<a name="line.1124"></a>
+<span class="sourceLineNo">1125</span>          break;<a name="line.1125"></a>
+<span class="sourceLineNo">1126</span>        }<a name="line.1126"></a>
+<span class="sourceLineNo">1127</span>      }<a name="line.1127"></a>
+<span class="sourceLineNo">1128</span>    }<a name="line.1128"></a>
+<span class="sourceLineNo">1129</span><a name="line.1129"></a>
+<span class="sourceLineNo">1130</span>    if (!this.scheduleThreadPool.isShutdown()) {<a name="line.1130"></a>
+<span class="sourceLineNo">1131</span>      List&lt;Runnable&gt; runnables = this.scheduleThreadPool.shutdownNow();<a name="line.1131"></a>
+<span class="sourceLineNo">1132</span>      LOG.debug("Still running " + runnables);<a name="line.1132"></a>
+<span class="sourceLineNo">1133</span>    }<a name="line.1133"></a>
+<span class="sourceLineNo">1134</span>    this.evictionThread.shutdown();<a name="line.1134"></a>
+<span class="sourceLineNo">1135</span>  }<a name="line.1135"></a>
+<span class="sourceLineNo">1136</span><a name="line.1136"></a>
+<span class="sourceLineNo">1137</span>  /** Clears the cache. Used in tests. */<a name="line.1137"></a>
+<span class="sourceLineNo">1138</span>  @VisibleForTesting<a name="line.1138"></a>
+<span class="sourceLineNo">1139</span>  public void clearCache() {<a name="line.1139"></a>
+<span class="sourceLineNo">1140</span>    this.map.clear();<a name="line.1140"></a>
+<span class="sourceLineNo">1141</span>    this.elements.set(0);<a name="line.1141"></a>
+<span class="sourceLineNo">1142</span>  }<a name="line.1142"></a>
+<span class="sourceLineNo">1143</span><a name="line.1143"></a>
+<span class="sourceLineNo">1144</span>  /**<a name="line.1144"></a>
+<span class="sourceLineNo">1145</span>   * Used in testing. May be very inefficient.<a name="line.1145"></a>
+<span class="sourceLineNo">1146</span>   *<a name="line.1146"></a>
+<span class="sourceLineNo">1147</span>   * @return the set of cached file names<a name="line.1147"></a>
+<span class="sourceLineNo">1148</span>   */<a name="line.1148"></a>
+<span class="sourceLineNo">1149</span>  @VisibleForTesting<a name="line.1149"></a>
+<span class="sourceLineNo">1150</span>  SortedSet&lt;String&gt; getCachedFileNamesForTest() {<a name="line.1150"></a>
+<span class="sourceLineNo">1151</span>    SortedSet&lt;String&gt; fileNames = new TreeSet&lt;&gt;();<a name="line.1151"></a>
+<span class="sourceLineNo">1152</span>    for (BlockCacheKey cacheKey : map.keySet()) {<a name="line.1152"></a>
+<span class="sourceLineNo">1153</span>      fileNames.add(cacheKey.getHfileName());<a name="line.1153"></a>
+<span class="sourceLineNo">1154</span>    }<a name="line.1154"></a>
+<span class="sourceLineNo">1155</span>    return fileNames;<a name="line.1155"></a>
+<span class="sourceLineNo">1156</span>  }<a name="line.1156"></a>
+<span class="sourceLineNo">1157</span><a name="line.1157"></a>
+<span class="sourceLineNo">1158</span>  @VisibleForTesting<a name="line.1158"></a>
+<span class="sourceLineNo">1159</span>  Map&lt;BlockType, Integer&gt; getBlockTypeCountsForTest() {<a name="line.1159"></a>
+<span class="sourceLineNo">1160</span>    Map&lt;BlockType, Integer&gt; counts = new EnumMap&lt;&gt;(BlockType.class);<a name="line.1160"></a>
+<span class="sourceLineNo">1161</span>    for (LruCachedBlock cb : map.values()) {<a name="line.1161"></a>
+<span class="sourceLineNo">1162</span>      BlockType blockType = cb.getBuffer().getBlockType();<a name="line.1162"></a>
+<span class="sourceLineNo">1163</span>      Integer count = counts.get(blockType);<a name="line.1163"></a>
+<span class="sourceLineNo">1164</span>      counts.put(blockType, (count == null ? 0 : count) + 1);<a name="line.1164"></a>
+<span class="sourceLineNo">1165</span>    }<a name="line.1165"></a>
+<span class="sourceLineNo">1166</span>    return counts;<a name="line.1166"></a>
+<span class="sourceLineNo">1167</span>  }<a name="line.1167"></a>
+<span class="sourceLineNo">1168</span><a name="line.1168"></a>
+<span class="sourceLineNo">1169</span>  @VisibleForTesting<a name="line.1169"></a>
+<span class="sourceLineNo">1170</span>  public Map&lt;DataBlockEncoding, Integer&gt; getEncodingCountsForTest() {<a name="line.1170"></a>
+<span class="sourceLineNo">1171</span>    Map&lt;DataBlockEncoding, Integer&gt; counts = new EnumMap&lt;&gt;(DataBlockEncoding.class);<a name="line.1171"></a>
+<span class="sourceLineNo">1172</span>    for (LruCachedBlock block : map.values()) {<a name="line.1172"></a>
+<span class="sourceLineNo">1173</span>      DataBlockEncoding encoding = ((HFileBlock) block.getBuffer()).getDataBlockEncoding();<a name="line.1173"></a>
+<span class="sourceLineNo">1174</span>      Integer count = counts.get(encoding);<a name="line.1174"></a>
+<span class="sourceLineNo">1175</span>      counts.put(encoding, (count == null ? 0 : count) + 1);<a name="line.1175"></a>
+<span class="sourceLineNo">1176</span>    }<a name="line.1176"></a>
+<span class="sourceLineNo">1177</span>    return counts;<a name="line.1177"></a>
+<span class="sourceLineNo">1178</span>  }<a name="line.1178"></a>
+<span class="sourceLineNo">1179</span><a name="line.1179"></a>
+<span class="sourceLineNo">1180</span>  public void setVictimCache(BlockCache handler) {<a name="line.1180"></a>
+<span class="sourceLineNo">1181</span>    assert victimHandler == null;<a name="line.1181"></a>
+<span class="sourceLineNo">1182</span>    victimHandler = handler;<a name="line.1182"></a>
+<span class="sourceLineNo">1183</span>  }<a name="line.1183"></a>
+<span class="sourceLineNo">1184</span><a name="line.1184"></a>
+<span class="sourceLineNo">1185</span>  @VisibleForTesting<a name="line.1185"></a>
+<span class="sourceLineNo">1186</span>  Map&lt;BlockCacheKey, LruCachedBlock&gt; getMapForTests() {<a name="line.1186"></a>
+<span class="sourceLineNo">1187</span>    return map;<a name="line.1187"></a>
+<span class="sourceLineNo">1188</span>  }<a name="line.1188"></a>
+<span class="sourceLineNo">1189</span><a name="line.1189"></a>
+<span class="sourceLineNo">1190</span>  BlockCache getVictimHandler() {<a name="line.1190"></a>
+<span class="sourceLineNo">1191</span>    return this.victimHandler;<a name="line.1191"></a>
+<span class="sourceLineNo">1192</span>  }<a name="line.1192"></a>
+<span class="sourceLineNo">1193</span><a name="line.1193"></a>
+<span class="sourceLineNo">1194</span>  @Override<a name="line.1194"></a>
+<span class="sourceLineNo">1195</span>  @JsonIgnore<a name="line.1195"></a>
+<span class="sourceLineNo">1196</span>  public BlockCache[] getBlockCaches() {<a name="line.1196"></a>
+<span class="sourceLineNo">1197</span>    if (victimHandler != null)<a name="line.1197"></a>
+<span class="sourceLineNo">1198</span>      return new BlockCache[] {this, this.victimHandler};<a name="line.1198"></a>
+<span class="sourceLineNo">1199</span>    return null;<a name="line.1199"></a>
+<span class="sourceLineNo">1200</span>  }<a name="line.1200"></a>
+<span class="sourceLineNo">1201</span><a name="line.1201"></a>
+<span class="sourceLineNo">1202</span>  @Override<a name="line.1202"></a>
+<span class="sourceLineNo">1203</span>  public void returnBlock(BlockCacheKey cacheKey, Cacheable block) {<a name="line.1203"></a>
+<span class="sourceLineNo">1204</span>    // There is no SHARED type here in L1. But the block might have been served from the Victim<a name="line.1204"></a>
+<span class="sourceLineNo">1205</span>    // handler L2 cache. (when the Combined mode = false). So just try return this block to<a name="line.1205"></a>
+<span class="sourceLineNo">1206</span>    // L2 victim handler cache.<a name="line.1206"></a>
+<span class="sourceLineNo">1207</span>    // Note : In case of CombinedBlockCache, we will have this victimHandler configured for L1<a name="line.1207"></a>
+<span class="sourceLineNo">1208</span>    // cache. But CombinedBlockCache will only call returnBlock on L2 cache.<a name="line.1208"></a>
+<span class="sourceLineNo">1209</span>    if (this.victimHandler != null) {<a name="line.1209"></a>
+<span class="sourceLineNo">1210</span>      this.victimHandler.returnBlock(cacheKey, block);<a name="line.1210"></a>
+<span class="sourceLineNo">1211</span>    }<a name="line.1211"></a>
+<span class="sourceLineNo">1212</span>  }<a name="line.1212"></a>
+<span class="sourceLineNo">1213</span>}<a name="line.1213"></a>
 
 
 


Mime
View raw message