hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [10/43] hbase-site git commit: Published site at 82d554e3783372cc6b05489452c815b57c06f6cd.
Date Fri, 05 May 2017 14:58:47 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e2c783b2/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/CompactSplitThread.CompactionRunner.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/CompactSplitThread.CompactionRunner.html b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/CompactSplitThread.CompactionRunner.html
index 43cc877..6408c36 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/CompactSplitThread.CompactionRunner.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/CompactSplitThread.CompactionRunner.html
@@ -428,256 +428,259 @@
 <span class="sourceLineNo">420</span>    private int queuedPriority;<a name="line.420"></a>
 <span class="sourceLineNo">421</span>    private ThreadPoolExecutor parent;<a name="line.421"></a>
 <span class="sourceLineNo">422</span>    private User user;<a name="line.422"></a>
-<span class="sourceLineNo">423</span><a name="line.423"></a>
-<span class="sourceLineNo">424</span>    public CompactionRunner(Store store, Region region,<a name="line.424"></a>
-<span class="sourceLineNo">425</span>        CompactionContext compaction, ThreadPoolExecutor parent, User user) {<a name="line.425"></a>
-<span class="sourceLineNo">426</span>      super();<a name="line.426"></a>
-<span class="sourceLineNo">427</span>      this.store = store;<a name="line.427"></a>
-<span class="sourceLineNo">428</span>      this.region = (HRegion)region;<a name="line.428"></a>
-<span class="sourceLineNo">429</span>      this.compaction = compaction;<a name="line.429"></a>
-<span class="sourceLineNo">430</span>      this.queuedPriority = (this.compaction == null)<a name="line.430"></a>
-<span class="sourceLineNo">431</span>          ? store.getCompactPriority() : compaction.getRequest().getPriority();<a name="line.431"></a>
-<span class="sourceLineNo">432</span>      this.parent = parent;<a name="line.432"></a>
-<span class="sourceLineNo">433</span>      this.user = user;<a name="line.433"></a>
-<span class="sourceLineNo">434</span>    }<a name="line.434"></a>
-<span class="sourceLineNo">435</span><a name="line.435"></a>
-<span class="sourceLineNo">436</span>    @Override<a name="line.436"></a>
-<span class="sourceLineNo">437</span>    public String toString() {<a name="line.437"></a>
-<span class="sourceLineNo">438</span>      return (this.compaction != null) ? ("Request = " + compaction.getRequest())<a name="line.438"></a>
-<span class="sourceLineNo">439</span>          : ("Store = " + store.toString() + ", pri = " + queuedPriority);<a name="line.439"></a>
-<span class="sourceLineNo">440</span>    }<a name="line.440"></a>
-<span class="sourceLineNo">441</span><a name="line.441"></a>
-<span class="sourceLineNo">442</span>    private void doCompaction(User user) {<a name="line.442"></a>
-<span class="sourceLineNo">443</span>      // Common case - system compaction without a file selection. Select now.<a name="line.443"></a>
-<span class="sourceLineNo">444</span>      if (this.compaction == null) {<a name="line.444"></a>
-<span class="sourceLineNo">445</span>        int oldPriority = this.queuedPriority;<a name="line.445"></a>
-<span class="sourceLineNo">446</span>        this.queuedPriority = this.store.getCompactPriority();<a name="line.446"></a>
-<span class="sourceLineNo">447</span>        if (this.queuedPriority &gt; oldPriority) {<a name="line.447"></a>
-<span class="sourceLineNo">448</span>          // Store priority decreased while we were in queue (due to some other compaction?),<a name="line.448"></a>
-<span class="sourceLineNo">449</span>          // requeue with new priority to avoid blocking potential higher priorities.<a name="line.449"></a>
-<span class="sourceLineNo">450</span>          this.parent.execute(this);<a name="line.450"></a>
-<span class="sourceLineNo">451</span>          return;<a name="line.451"></a>
-<span class="sourceLineNo">452</span>        }<a name="line.452"></a>
-<span class="sourceLineNo">453</span>        try {<a name="line.453"></a>
-<span class="sourceLineNo">454</span>          this.compaction = selectCompaction(this.region, this.store, queuedPriority, null, user);<a name="line.454"></a>
-<span class="sourceLineNo">455</span>        } catch (IOException ex) {<a name="line.455"></a>
-<span class="sourceLineNo">456</span>          LOG.error("Compaction selection failed " + this, ex);<a name="line.456"></a>
-<span class="sourceLineNo">457</span>          server.checkFileSystem();<a name="line.457"></a>
-<span class="sourceLineNo">458</span>          return;<a name="line.458"></a>
-<span class="sourceLineNo">459</span>        }<a name="line.459"></a>
-<span class="sourceLineNo">460</span>        if (this.compaction == null) return; // nothing to do<a name="line.460"></a>
-<span class="sourceLineNo">461</span>        // Now see if we are in correct pool for the size; if not, go to the correct one.<a name="line.461"></a>
-<span class="sourceLineNo">462</span>        // We might end up waiting for a while, so cancel the selection.<a name="line.462"></a>
-<span class="sourceLineNo">463</span>        assert this.compaction.hasSelection();<a name="line.463"></a>
-<span class="sourceLineNo">464</span>        ThreadPoolExecutor pool = store.throttleCompaction(<a name="line.464"></a>
-<span class="sourceLineNo">465</span>            compaction.getRequest().getSize()) ? longCompactions : shortCompactions;<a name="line.465"></a>
-<span class="sourceLineNo">466</span><a name="line.466"></a>
-<span class="sourceLineNo">467</span>        // Long compaction pool can process small job<a name="line.467"></a>
-<span class="sourceLineNo">468</span>        // Short compaction pool should not process large job<a name="line.468"></a>
-<span class="sourceLineNo">469</span>        if (this.parent == shortCompactions &amp;&amp; pool == longCompactions) {<a name="line.469"></a>
-<span class="sourceLineNo">470</span>          this.store.cancelRequestedCompaction(this.compaction);<a name="line.470"></a>
-<span class="sourceLineNo">471</span>          this.compaction = null;<a name="line.471"></a>
-<span class="sourceLineNo">472</span>          this.parent = pool;<a name="line.472"></a>
-<span class="sourceLineNo">473</span>          this.parent.execute(this);<a name="line.473"></a>
-<span class="sourceLineNo">474</span>          return;<a name="line.474"></a>
-<span class="sourceLineNo">475</span>        }<a name="line.475"></a>
-<span class="sourceLineNo">476</span>      }<a name="line.476"></a>
-<span class="sourceLineNo">477</span>      // Finally we can compact something.<a name="line.477"></a>
-<span class="sourceLineNo">478</span>      assert this.compaction != null;<a name="line.478"></a>
-<span class="sourceLineNo">479</span><a name="line.479"></a>
-<span class="sourceLineNo">480</span>      this.compaction.getRequest().beforeExecute();<a name="line.480"></a>
-<span class="sourceLineNo">481</span>      try {<a name="line.481"></a>
-<span class="sourceLineNo">482</span>        // Note: please don't put single-compaction logic here;<a name="line.482"></a>
-<span class="sourceLineNo">483</span>        //       put it into region/store/etc. This is CST logic.<a name="line.483"></a>
-<span class="sourceLineNo">484</span>        long start = EnvironmentEdgeManager.currentTime();<a name="line.484"></a>
-<span class="sourceLineNo">485</span>        boolean completed =<a name="line.485"></a>
-<span class="sourceLineNo">486</span>            region.compact(compaction, store, compactionThroughputController, user);<a name="line.486"></a>
-<span class="sourceLineNo">487</span>        long now = EnvironmentEdgeManager.currentTime();<a name="line.487"></a>
-<span class="sourceLineNo">488</span>        LOG.info(((completed) ? "Completed" : "Aborted") + " compaction: " +<a name="line.488"></a>
-<span class="sourceLineNo">489</span>              this + "; duration=" + StringUtils.formatTimeDiff(now, start));<a name="line.489"></a>
-<span class="sourceLineNo">490</span>        if (completed) {<a name="line.490"></a>
-<span class="sourceLineNo">491</span>          // degenerate case: blocked regions require recursive enqueues<a name="line.491"></a>
-<span class="sourceLineNo">492</span>          if (store.getCompactPriority() &lt;= 0) {<a name="line.492"></a>
-<span class="sourceLineNo">493</span>            requestSystemCompaction(region, store, "Recursive enqueue");<a name="line.493"></a>
-<span class="sourceLineNo">494</span>          } else {<a name="line.494"></a>
-<span class="sourceLineNo">495</span>            // see if the compaction has caused us to exceed max region size<a name="line.495"></a>
-<span class="sourceLineNo">496</span>            requestSplit(region);<a name="line.496"></a>
-<span class="sourceLineNo">497</span>          }<a name="line.497"></a>
-<span class="sourceLineNo">498</span>        }<a name="line.498"></a>
-<span class="sourceLineNo">499</span>      } catch (IOException ex) {<a name="line.499"></a>
-<span class="sourceLineNo">500</span>        IOException remoteEx =<a name="line.500"></a>
-<span class="sourceLineNo">501</span>            ex instanceof RemoteException ? ((RemoteException) ex).unwrapRemoteException() : ex;<a name="line.501"></a>
-<span class="sourceLineNo">502</span>        LOG.error("Compaction failed " + this, remoteEx);<a name="line.502"></a>
-<span class="sourceLineNo">503</span>        if (remoteEx != ex) {<a name="line.503"></a>
-<span class="sourceLineNo">504</span>          LOG.info("Compaction failed at original callstack: " + formatStackTrace(ex));<a name="line.504"></a>
-<span class="sourceLineNo">505</span>        }<a name="line.505"></a>
-<span class="sourceLineNo">506</span>        region.reportCompactionRequestFailure();<a name="line.506"></a>
-<span class="sourceLineNo">507</span>        server.checkFileSystem();<a name="line.507"></a>
-<span class="sourceLineNo">508</span>      } catch (Exception ex) {<a name="line.508"></a>
-<span class="sourceLineNo">509</span>        LOG.error("Compaction failed " + this, ex);<a name="line.509"></a>
-<span class="sourceLineNo">510</span>        region.reportCompactionRequestFailure();<a name="line.510"></a>
-<span class="sourceLineNo">511</span>        server.checkFileSystem();<a name="line.511"></a>
-<span class="sourceLineNo">512</span>      } finally {<a name="line.512"></a>
-<span class="sourceLineNo">513</span>        LOG.debug("CompactSplitThread Status: " + CompactSplitThread.this);<a name="line.513"></a>
-<span class="sourceLineNo">514</span>      }<a name="line.514"></a>
-<span class="sourceLineNo">515</span>      this.compaction.getRequest().afterExecute();<a name="line.515"></a>
-<span class="sourceLineNo">516</span>    }<a name="line.516"></a>
-<span class="sourceLineNo">517</span><a name="line.517"></a>
-<span class="sourceLineNo">518</span>    @Override<a name="line.518"></a>
-<span class="sourceLineNo">519</span>    public void run() {<a name="line.519"></a>
-<span class="sourceLineNo">520</span>      Preconditions.checkNotNull(server);<a name="line.520"></a>
-<span class="sourceLineNo">521</span>      if (server.isStopped()<a name="line.521"></a>
-<span class="sourceLineNo">522</span>          || (region.getTableDesc() != null &amp;&amp; !region.getTableDesc().isCompactionEnabled())) {<a name="line.522"></a>
-<span class="sourceLineNo">523</span>        return;<a name="line.523"></a>
-<span class="sourceLineNo">524</span>      }<a name="line.524"></a>
-<span class="sourceLineNo">525</span>      doCompaction(user);<a name="line.525"></a>
-<span class="sourceLineNo">526</span>    }<a name="line.526"></a>
-<span class="sourceLineNo">527</span><a name="line.527"></a>
-<span class="sourceLineNo">528</span>    private String formatStackTrace(Exception ex) {<a name="line.528"></a>
-<span class="sourceLineNo">529</span>      StringWriter sw = new StringWriter();<a name="line.529"></a>
-<span class="sourceLineNo">530</span>      PrintWriter pw = new PrintWriter(sw);<a name="line.530"></a>
-<span class="sourceLineNo">531</span>      ex.printStackTrace(pw);<a name="line.531"></a>
-<span class="sourceLineNo">532</span>      pw.flush();<a name="line.532"></a>
-<span class="sourceLineNo">533</span>      return sw.toString();<a name="line.533"></a>
-<span class="sourceLineNo">534</span>    }<a name="line.534"></a>
-<span class="sourceLineNo">535</span><a name="line.535"></a>
-<span class="sourceLineNo">536</span>    @Override<a name="line.536"></a>
-<span class="sourceLineNo">537</span>    public int compareTo(CompactionRunner o) {<a name="line.537"></a>
-<span class="sourceLineNo">538</span>      // Only compare the underlying request (if any), for queue sorting purposes.<a name="line.538"></a>
-<span class="sourceLineNo">539</span>      int compareVal = queuedPriority - o.queuedPriority; // compare priority<a name="line.539"></a>
-<span class="sourceLineNo">540</span>      if (compareVal != 0) return compareVal;<a name="line.540"></a>
-<span class="sourceLineNo">541</span>      CompactionContext tc = this.compaction, oc = o.compaction;<a name="line.541"></a>
-<span class="sourceLineNo">542</span>      // Sort pre-selected (user?) compactions before system ones with equal priority.<a name="line.542"></a>
-<span class="sourceLineNo">543</span>      return (tc == null) ? ((oc == null) ? 0 : 1)<a name="line.543"></a>
-<span class="sourceLineNo">544</span>          : ((oc == null) ? -1 : tc.getRequest().compareTo(oc.getRequest()));<a name="line.544"></a>
-<span class="sourceLineNo">545</span>    }<a name="line.545"></a>
-<span class="sourceLineNo">546</span>  }<a name="line.546"></a>
-<span class="sourceLineNo">547</span><a name="line.547"></a>
-<span class="sourceLineNo">548</span>  /**<a name="line.548"></a>
-<span class="sourceLineNo">549</span>   * Cleanup class to use when rejecting a compaction request from the queue.<a name="line.549"></a>
-<span class="sourceLineNo">550</span>   */<a name="line.550"></a>
-<span class="sourceLineNo">551</span>  private static class Rejection implements RejectedExecutionHandler {<a name="line.551"></a>
-<span class="sourceLineNo">552</span>    @Override<a name="line.552"></a>
-<span class="sourceLineNo">553</span>    public void rejectedExecution(Runnable runnable, ThreadPoolExecutor pool) {<a name="line.553"></a>
-<span class="sourceLineNo">554</span>      if (runnable instanceof CompactionRunner) {<a name="line.554"></a>
-<span class="sourceLineNo">555</span>        CompactionRunner runner = (CompactionRunner)runnable;<a name="line.555"></a>
-<span class="sourceLineNo">556</span>        LOG.debug("Compaction Rejected: " + runner);<a name="line.556"></a>
-<span class="sourceLineNo">557</span>        runner.store.cancelRequestedCompaction(runner.compaction);<a name="line.557"></a>
-<span class="sourceLineNo">558</span>      }<a name="line.558"></a>
-<span class="sourceLineNo">559</span>    }<a name="line.559"></a>
-<span class="sourceLineNo">560</span>  }<a name="line.560"></a>
-<span class="sourceLineNo">561</span><a name="line.561"></a>
-<span class="sourceLineNo">562</span>  /**<a name="line.562"></a>
-<span class="sourceLineNo">563</span>   * {@inheritDoc}<a name="line.563"></a>
-<span class="sourceLineNo">564</span>   */<a name="line.564"></a>
-<span class="sourceLineNo">565</span>  @Override<a name="line.565"></a>
-<span class="sourceLineNo">566</span>  public void onConfigurationChange(Configuration newConf) {<a name="line.566"></a>
-<span class="sourceLineNo">567</span>    // Check if number of large / small compaction threads has changed, and then<a name="line.567"></a>
-<span class="sourceLineNo">568</span>    // adjust the core pool size of the thread pools, by using the<a name="line.568"></a>
-<span class="sourceLineNo">569</span>    // setCorePoolSize() method. According to the javadocs, it is safe to<a name="line.569"></a>
-<span class="sourceLineNo">570</span>    // change the core pool size on-the-fly. We need to reset the maximum<a name="line.570"></a>
-<span class="sourceLineNo">571</span>    // pool size, as well.<a name="line.571"></a>
-<span class="sourceLineNo">572</span>    int largeThreads = Math.max(1, newConf.getInt(<a name="line.572"></a>
-<span class="sourceLineNo">573</span>            LARGE_COMPACTION_THREADS,<a name="line.573"></a>
-<span class="sourceLineNo">574</span>            LARGE_COMPACTION_THREADS_DEFAULT));<a name="line.574"></a>
-<span class="sourceLineNo">575</span>    if (this.longCompactions.getCorePoolSize() != largeThreads) {<a name="line.575"></a>
-<span class="sourceLineNo">576</span>      LOG.info("Changing the value of " + LARGE_COMPACTION_THREADS +<a name="line.576"></a>
-<span class="sourceLineNo">577</span>              " from " + this.longCompactions.getCorePoolSize() + " to " +<a name="line.577"></a>
-<span class="sourceLineNo">578</span>              largeThreads);<a name="line.578"></a>
-<span class="sourceLineNo">579</span>      if(this.longCompactions.getCorePoolSize() &lt; largeThreads) {<a name="line.579"></a>
-<span class="sourceLineNo">580</span>        this.longCompactions.setMaximumPoolSize(largeThreads);<a name="line.580"></a>
-<span class="sourceLineNo">581</span>        this.longCompactions.setCorePoolSize(largeThreads);<a name="line.581"></a>
-<span class="sourceLineNo">582</span>      } else {<a name="line.582"></a>
-<span class="sourceLineNo">583</span>        this.longCompactions.setCorePoolSize(largeThreads);<a name="line.583"></a>
-<span class="sourceLineNo">584</span>        this.longCompactions.setMaximumPoolSize(largeThreads);<a name="line.584"></a>
-<span class="sourceLineNo">585</span>      }<a name="line.585"></a>
-<span class="sourceLineNo">586</span>    }<a name="line.586"></a>
-<span class="sourceLineNo">587</span><a name="line.587"></a>
-<span class="sourceLineNo">588</span>    int smallThreads = newConf.getInt(SMALL_COMPACTION_THREADS,<a name="line.588"></a>
-<span class="sourceLineNo">589</span>            SMALL_COMPACTION_THREADS_DEFAULT);<a name="line.589"></a>
-<span class="sourceLineNo">590</span>    if (this.shortCompactions.getCorePoolSize() != smallThreads) {<a name="line.590"></a>
-<span class="sourceLineNo">591</span>      LOG.info("Changing the value of " + SMALL_COMPACTION_THREADS +<a name="line.591"></a>
-<span class="sourceLineNo">592</span>                " from " + this.shortCompactions.getCorePoolSize() + " to " +<a name="line.592"></a>
-<span class="sourceLineNo">593</span>                smallThreads);<a name="line.593"></a>
-<span class="sourceLineNo">594</span>      if(this.shortCompactions.getCorePoolSize() &lt; smallThreads) {<a name="line.594"></a>
-<span class="sourceLineNo">595</span>        this.shortCompactions.setMaximumPoolSize(smallThreads);<a name="line.595"></a>
-<span class="sourceLineNo">596</span>        this.shortCompactions.setCorePoolSize(smallThreads);<a name="line.596"></a>
-<span class="sourceLineNo">597</span>      } else {<a name="line.597"></a>
-<span class="sourceLineNo">598</span>        this.shortCompactions.setCorePoolSize(smallThreads);<a name="line.598"></a>
-<span class="sourceLineNo">599</span>        this.shortCompactions.setMaximumPoolSize(smallThreads);<a name="line.599"></a>
-<span class="sourceLineNo">600</span>      }<a name="line.600"></a>
-<span class="sourceLineNo">601</span>    }<a name="line.601"></a>
-<span class="sourceLineNo">602</span><a name="line.602"></a>
-<span class="sourceLineNo">603</span>    int splitThreads = newConf.getInt(SPLIT_THREADS,<a name="line.603"></a>
-<span class="sourceLineNo">604</span>            SPLIT_THREADS_DEFAULT);<a name="line.604"></a>
-<span class="sourceLineNo">605</span>    if (this.splits.getCorePoolSize() != splitThreads) {<a name="line.605"></a>
-<span class="sourceLineNo">606</span>      LOG.info("Changing the value of " + SPLIT_THREADS +<a name="line.606"></a>
-<span class="sourceLineNo">607</span>                " from " + this.splits.getCorePoolSize() + " to " +<a name="line.607"></a>
-<span class="sourceLineNo">608</span>                splitThreads);<a name="line.608"></a>
-<span class="sourceLineNo">609</span>      if(this.splits.getCorePoolSize() &lt; splitThreads) {<a name="line.609"></a>
-<span class="sourceLineNo">610</span>        this.splits.setMaximumPoolSize(splitThreads);<a name="line.610"></a>
-<span class="sourceLineNo">611</span>        this.splits.setCorePoolSize(splitThreads);<a name="line.611"></a>
-<span class="sourceLineNo">612</span>      } else {<a name="line.612"></a>
-<span class="sourceLineNo">613</span>        this.splits.setCorePoolSize(splitThreads);<a name="line.613"></a>
-<span class="sourceLineNo">614</span>        this.splits.setMaximumPoolSize(splitThreads);<a name="line.614"></a>
-<span class="sourceLineNo">615</span>      }<a name="line.615"></a>
-<span class="sourceLineNo">616</span>    }<a name="line.616"></a>
-<span class="sourceLineNo">617</span><a name="line.617"></a>
-<span class="sourceLineNo">618</span>    ThroughputController old = this.compactionThroughputController;<a name="line.618"></a>
-<span class="sourceLineNo">619</span>    if (old != null) {<a name="line.619"></a>
-<span class="sourceLineNo">620</span>      old.stop("configuration change");<a name="line.620"></a>
-<span class="sourceLineNo">621</span>    }<a name="line.621"></a>
-<span class="sourceLineNo">622</span>    this.compactionThroughputController =<a name="line.622"></a>
-<span class="sourceLineNo">623</span>        CompactionThroughputControllerFactory.create(server, newConf);<a name="line.623"></a>
-<span class="sourceLineNo">624</span><a name="line.624"></a>
-<span class="sourceLineNo">625</span>    // We change this atomically here instead of reloading the config in order that upstream<a name="line.625"></a>
-<span class="sourceLineNo">626</span>    // would be the only one with the flexibility to reload the config.<a name="line.626"></a>
-<span class="sourceLineNo">627</span>    this.conf.reloadConfiguration();<a name="line.627"></a>
-<span class="sourceLineNo">628</span>  }<a name="line.628"></a>
-<span class="sourceLineNo">629</span><a name="line.629"></a>
-<span class="sourceLineNo">630</span>  protected int getSmallCompactionThreadNum() {<a name="line.630"></a>
-<span class="sourceLineNo">631</span>    return this.shortCompactions.getCorePoolSize();<a name="line.631"></a>
-<span class="sourceLineNo">632</span>  }<a name="line.632"></a>
-<span class="sourceLineNo">633</span><a name="line.633"></a>
-<span class="sourceLineNo">634</span>  protected int getLargeCompactionThreadNum() {<a name="line.634"></a>
-<span class="sourceLineNo">635</span>    return this.longCompactions.getCorePoolSize();<a name="line.635"></a>
-<span class="sourceLineNo">636</span>  }<a name="line.636"></a>
-<span class="sourceLineNo">637</span><a name="line.637"></a>
-<span class="sourceLineNo">638</span>  protected int getSplitThreadNum() {<a name="line.638"></a>
-<span class="sourceLineNo">639</span>    return this.splits.getCorePoolSize();<a name="line.639"></a>
-<span class="sourceLineNo">640</span>  }<a name="line.640"></a>
-<span class="sourceLineNo">641</span><a name="line.641"></a>
-<span class="sourceLineNo">642</span>  /**<a name="line.642"></a>
-<span class="sourceLineNo">643</span>   * {@inheritDoc}<a name="line.643"></a>
-<span class="sourceLineNo">644</span>   */<a name="line.644"></a>
-<span class="sourceLineNo">645</span>  @Override<a name="line.645"></a>
-<span class="sourceLineNo">646</span>  public void registerChildren(ConfigurationManager manager) {<a name="line.646"></a>
-<span class="sourceLineNo">647</span>    // No children to register.<a name="line.647"></a>
-<span class="sourceLineNo">648</span>  }<a name="line.648"></a>
-<span class="sourceLineNo">649</span><a name="line.649"></a>
-<span class="sourceLineNo">650</span>  /**<a name="line.650"></a>
-<span class="sourceLineNo">651</span>   * {@inheritDoc}<a name="line.651"></a>
-<span class="sourceLineNo">652</span>   */<a name="line.652"></a>
-<span class="sourceLineNo">653</span>  @Override<a name="line.653"></a>
-<span class="sourceLineNo">654</span>  public void deregisterChildren(ConfigurationManager manager) {<a name="line.654"></a>
-<span class="sourceLineNo">655</span>    // No children to register<a name="line.655"></a>
-<span class="sourceLineNo">656</span>  }<a name="line.656"></a>
-<span class="sourceLineNo">657</span><a name="line.657"></a>
-<span class="sourceLineNo">658</span>  @VisibleForTesting<a name="line.658"></a>
-<span class="sourceLineNo">659</span>  public ThroughputController getCompactionThroughputController() {<a name="line.659"></a>
-<span class="sourceLineNo">660</span>    return compactionThroughputController;<a name="line.660"></a>
-<span class="sourceLineNo">661</span>  }<a name="line.661"></a>
-<span class="sourceLineNo">662</span><a name="line.662"></a>
-<span class="sourceLineNo">663</span>  @VisibleForTesting<a name="line.663"></a>
-<span class="sourceLineNo">664</span>  /**<a name="line.664"></a>
-<span class="sourceLineNo">665</span>   * Shutdown the long compaction thread pool.<a name="line.665"></a>
-<span class="sourceLineNo">666</span>   * Should only be used in unit test to prevent long compaction thread pool from stealing job<a name="line.666"></a>
-<span class="sourceLineNo">667</span>   * from short compaction queue<a name="line.667"></a>
-<span class="sourceLineNo">668</span>   */<a name="line.668"></a>
-<span class="sourceLineNo">669</span>  void shutdownLongCompactions(){<a name="line.669"></a>
-<span class="sourceLineNo">670</span>    this.longCompactions.shutdown();<a name="line.670"></a>
-<span class="sourceLineNo">671</span>  }<a name="line.671"></a>
-<span class="sourceLineNo">672</span>}<a name="line.672"></a>
+<span class="sourceLineNo">423</span>    private long time;<a name="line.423"></a>
+<span class="sourceLineNo">424</span><a name="line.424"></a>
+<span class="sourceLineNo">425</span>    public CompactionRunner(Store store, Region region,<a name="line.425"></a>
+<span class="sourceLineNo">426</span>        CompactionContext compaction, ThreadPoolExecutor parent, User user) {<a name="line.426"></a>
+<span class="sourceLineNo">427</span>      super();<a name="line.427"></a>
+<span class="sourceLineNo">428</span>      this.store = store;<a name="line.428"></a>
+<span class="sourceLineNo">429</span>      this.region = (HRegion)region;<a name="line.429"></a>
+<span class="sourceLineNo">430</span>      this.compaction = compaction;<a name="line.430"></a>
+<span class="sourceLineNo">431</span>      this.queuedPriority = (this.compaction == null)<a name="line.431"></a>
+<span class="sourceLineNo">432</span>          ? store.getCompactPriority() : compaction.getRequest().getPriority();<a name="line.432"></a>
+<span class="sourceLineNo">433</span>      this.parent = parent;<a name="line.433"></a>
+<span class="sourceLineNo">434</span>      this.user = user;<a name="line.434"></a>
+<span class="sourceLineNo">435</span>      this.time =  System.currentTimeMillis();<a name="line.435"></a>
+<span class="sourceLineNo">436</span>    }<a name="line.436"></a>
+<span class="sourceLineNo">437</span><a name="line.437"></a>
+<span class="sourceLineNo">438</span>    @Override<a name="line.438"></a>
+<span class="sourceLineNo">439</span>    public String toString() {<a name="line.439"></a>
+<span class="sourceLineNo">440</span>      return (this.compaction != null) ? ("Request = " + compaction.getRequest())<a name="line.440"></a>
+<span class="sourceLineNo">441</span>          : ("regionName = " + region.toString() + ", storeName = " + store.toString() +<a name="line.441"></a>
+<span class="sourceLineNo">442</span>             ", priority = " + queuedPriority + ", time = " + time);<a name="line.442"></a>
+<span class="sourceLineNo">443</span>    }<a name="line.443"></a>
+<span class="sourceLineNo">444</span><a name="line.444"></a>
+<span class="sourceLineNo">445</span>    private void doCompaction(User user) {<a name="line.445"></a>
+<span class="sourceLineNo">446</span>      // Common case - system compaction without a file selection. Select now.<a name="line.446"></a>
+<span class="sourceLineNo">447</span>      if (this.compaction == null) {<a name="line.447"></a>
+<span class="sourceLineNo">448</span>        int oldPriority = this.queuedPriority;<a name="line.448"></a>
+<span class="sourceLineNo">449</span>        this.queuedPriority = this.store.getCompactPriority();<a name="line.449"></a>
+<span class="sourceLineNo">450</span>        if (this.queuedPriority &gt; oldPriority) {<a name="line.450"></a>
+<span class="sourceLineNo">451</span>          // Store priority decreased while we were in queue (due to some other compaction?),<a name="line.451"></a>
+<span class="sourceLineNo">452</span>          // requeue with new priority to avoid blocking potential higher priorities.<a name="line.452"></a>
+<span class="sourceLineNo">453</span>          this.parent.execute(this);<a name="line.453"></a>
+<span class="sourceLineNo">454</span>          return;<a name="line.454"></a>
+<span class="sourceLineNo">455</span>        }<a name="line.455"></a>
+<span class="sourceLineNo">456</span>        try {<a name="line.456"></a>
+<span class="sourceLineNo">457</span>          this.compaction = selectCompaction(this.region, this.store, queuedPriority, null, user);<a name="line.457"></a>
+<span class="sourceLineNo">458</span>        } catch (IOException ex) {<a name="line.458"></a>
+<span class="sourceLineNo">459</span>          LOG.error("Compaction selection failed " + this, ex);<a name="line.459"></a>
+<span class="sourceLineNo">460</span>          server.checkFileSystem();<a name="line.460"></a>
+<span class="sourceLineNo">461</span>          return;<a name="line.461"></a>
+<span class="sourceLineNo">462</span>        }<a name="line.462"></a>
+<span class="sourceLineNo">463</span>        if (this.compaction == null) return; // nothing to do<a name="line.463"></a>
+<span class="sourceLineNo">464</span>        // Now see if we are in correct pool for the size; if not, go to the correct one.<a name="line.464"></a>
+<span class="sourceLineNo">465</span>        // We might end up waiting for a while, so cancel the selection.<a name="line.465"></a>
+<span class="sourceLineNo">466</span>        assert this.compaction.hasSelection();<a name="line.466"></a>
+<span class="sourceLineNo">467</span>        ThreadPoolExecutor pool = store.throttleCompaction(<a name="line.467"></a>
+<span class="sourceLineNo">468</span>            compaction.getRequest().getSize()) ? longCompactions : shortCompactions;<a name="line.468"></a>
+<span class="sourceLineNo">469</span><a name="line.469"></a>
+<span class="sourceLineNo">470</span>        // Long compaction pool can process small job<a name="line.470"></a>
+<span class="sourceLineNo">471</span>        // Short compaction pool should not process large job<a name="line.471"></a>
+<span class="sourceLineNo">472</span>        if (this.parent == shortCompactions &amp;&amp; pool == longCompactions) {<a name="line.472"></a>
+<span class="sourceLineNo">473</span>          this.store.cancelRequestedCompaction(this.compaction);<a name="line.473"></a>
+<span class="sourceLineNo">474</span>          this.compaction = null;<a name="line.474"></a>
+<span class="sourceLineNo">475</span>          this.parent = pool;<a name="line.475"></a>
+<span class="sourceLineNo">476</span>          this.parent.execute(this);<a name="line.476"></a>
+<span class="sourceLineNo">477</span>          return;<a name="line.477"></a>
+<span class="sourceLineNo">478</span>        }<a name="line.478"></a>
+<span class="sourceLineNo">479</span>      }<a name="line.479"></a>
+<span class="sourceLineNo">480</span>      // Finally we can compact something.<a name="line.480"></a>
+<span class="sourceLineNo">481</span>      assert this.compaction != null;<a name="line.481"></a>
+<span class="sourceLineNo">482</span><a name="line.482"></a>
+<span class="sourceLineNo">483</span>      this.compaction.getRequest().beforeExecute();<a name="line.483"></a>
+<span class="sourceLineNo">484</span>      try {<a name="line.484"></a>
+<span class="sourceLineNo">485</span>        // Note: please don't put single-compaction logic here;<a name="line.485"></a>
+<span class="sourceLineNo">486</span>        //       put it into region/store/etc. This is CST logic.<a name="line.486"></a>
+<span class="sourceLineNo">487</span>        long start = EnvironmentEdgeManager.currentTime();<a name="line.487"></a>
+<span class="sourceLineNo">488</span>        boolean completed =<a name="line.488"></a>
+<span class="sourceLineNo">489</span>            region.compact(compaction, store, compactionThroughputController, user);<a name="line.489"></a>
+<span class="sourceLineNo">490</span>        long now = EnvironmentEdgeManager.currentTime();<a name="line.490"></a>
+<span class="sourceLineNo">491</span>        LOG.info(((completed) ? "Completed" : "Aborted") + " compaction: " +<a name="line.491"></a>
+<span class="sourceLineNo">492</span>              this + "; duration=" + StringUtils.formatTimeDiff(now, start));<a name="line.492"></a>
+<span class="sourceLineNo">493</span>        if (completed) {<a name="line.493"></a>
+<span class="sourceLineNo">494</span>          // degenerate case: blocked regions require recursive enqueues<a name="line.494"></a>
+<span class="sourceLineNo">495</span>          if (store.getCompactPriority() &lt;= 0) {<a name="line.495"></a>
+<span class="sourceLineNo">496</span>            requestSystemCompaction(region, store, "Recursive enqueue");<a name="line.496"></a>
+<span class="sourceLineNo">497</span>          } else {<a name="line.497"></a>
+<span class="sourceLineNo">498</span>            // see if the compaction has caused us to exceed max region size<a name="line.498"></a>
+<span class="sourceLineNo">499</span>            requestSplit(region);<a name="line.499"></a>
+<span class="sourceLineNo">500</span>          }<a name="line.500"></a>
+<span class="sourceLineNo">501</span>        }<a name="line.501"></a>
+<span class="sourceLineNo">502</span>      } catch (IOException ex) {<a name="line.502"></a>
+<span class="sourceLineNo">503</span>        IOException remoteEx =<a name="line.503"></a>
+<span class="sourceLineNo">504</span>            ex instanceof RemoteException ? ((RemoteException) ex).unwrapRemoteException() : ex;<a name="line.504"></a>
+<span class="sourceLineNo">505</span>        LOG.error("Compaction failed " + this, remoteEx);<a name="line.505"></a>
+<span class="sourceLineNo">506</span>        if (remoteEx != ex) {<a name="line.506"></a>
+<span class="sourceLineNo">507</span>          LOG.info("Compaction failed at original callstack: " + formatStackTrace(ex));<a name="line.507"></a>
+<span class="sourceLineNo">508</span>        }<a name="line.508"></a>
+<span class="sourceLineNo">509</span>        region.reportCompactionRequestFailure();<a name="line.509"></a>
+<span class="sourceLineNo">510</span>        server.checkFileSystem();<a name="line.510"></a>
+<span class="sourceLineNo">511</span>      } catch (Exception ex) {<a name="line.511"></a>
+<span class="sourceLineNo">512</span>        LOG.error("Compaction failed " + this, ex);<a name="line.512"></a>
+<span class="sourceLineNo">513</span>        region.reportCompactionRequestFailure();<a name="line.513"></a>
+<span class="sourceLineNo">514</span>        server.checkFileSystem();<a name="line.514"></a>
+<span class="sourceLineNo">515</span>      } finally {<a name="line.515"></a>
+<span class="sourceLineNo">516</span>        LOG.debug("CompactSplitThread Status: " + CompactSplitThread.this);<a name="line.516"></a>
+<span class="sourceLineNo">517</span>      }<a name="line.517"></a>
+<span class="sourceLineNo">518</span>      this.compaction.getRequest().afterExecute();<a name="line.518"></a>
+<span class="sourceLineNo">519</span>    }<a name="line.519"></a>
+<span class="sourceLineNo">520</span><a name="line.520"></a>
+<span class="sourceLineNo">521</span>    @Override<a name="line.521"></a>
+<span class="sourceLineNo">522</span>    public void run() {<a name="line.522"></a>
+<span class="sourceLineNo">523</span>      Preconditions.checkNotNull(server);<a name="line.523"></a>
+<span class="sourceLineNo">524</span>      if (server.isStopped()<a name="line.524"></a>
+<span class="sourceLineNo">525</span>          || (region.getTableDesc() != null &amp;&amp; !region.getTableDesc().isCompactionEnabled())) {<a name="line.525"></a>
+<span class="sourceLineNo">526</span>        return;<a name="line.526"></a>
+<span class="sourceLineNo">527</span>      }<a name="line.527"></a>
+<span class="sourceLineNo">528</span>      doCompaction(user);<a name="line.528"></a>
+<span class="sourceLineNo">529</span>    }<a name="line.529"></a>
+<span class="sourceLineNo">530</span><a name="line.530"></a>
+<span class="sourceLineNo">531</span>    private String formatStackTrace(Exception ex) {<a name="line.531"></a>
+<span class="sourceLineNo">532</span>      StringWriter sw = new StringWriter();<a name="line.532"></a>
+<span class="sourceLineNo">533</span>      PrintWriter pw = new PrintWriter(sw);<a name="line.533"></a>
+<span class="sourceLineNo">534</span>      ex.printStackTrace(pw);<a name="line.534"></a>
+<span class="sourceLineNo">535</span>      pw.flush();<a name="line.535"></a>
+<span class="sourceLineNo">536</span>      return sw.toString();<a name="line.536"></a>
+<span class="sourceLineNo">537</span>    }<a name="line.537"></a>
+<span class="sourceLineNo">538</span><a name="line.538"></a>
+<span class="sourceLineNo">539</span>    @Override<a name="line.539"></a>
+<span class="sourceLineNo">540</span>    public int compareTo(CompactionRunner o) {<a name="line.540"></a>
+<span class="sourceLineNo">541</span>      // Only compare the underlying request (if any), for queue sorting purposes.<a name="line.541"></a>
+<span class="sourceLineNo">542</span>      int compareVal = queuedPriority - o.queuedPriority; // compare priority<a name="line.542"></a>
+<span class="sourceLineNo">543</span>      if (compareVal != 0) return compareVal;<a name="line.543"></a>
+<span class="sourceLineNo">544</span>      CompactionContext tc = this.compaction, oc = o.compaction;<a name="line.544"></a>
+<span class="sourceLineNo">545</span>      // Sort pre-selected (user?) compactions before system ones with equal priority.<a name="line.545"></a>
+<span class="sourceLineNo">546</span>      return (tc == null) ? ((oc == null) ? 0 : 1)<a name="line.546"></a>
+<span class="sourceLineNo">547</span>          : ((oc == null) ? -1 : tc.getRequest().compareTo(oc.getRequest()));<a name="line.547"></a>
+<span class="sourceLineNo">548</span>    }<a name="line.548"></a>
+<span class="sourceLineNo">549</span>  }<a name="line.549"></a>
+<span class="sourceLineNo">550</span><a name="line.550"></a>
+<span class="sourceLineNo">551</span>  /**<a name="line.551"></a>
+<span class="sourceLineNo">552</span>   * Cleanup class to use when rejecting a compaction request from the queue.<a name="line.552"></a>
+<span class="sourceLineNo">553</span>   */<a name="line.553"></a>
+<span class="sourceLineNo">554</span>  private static class Rejection implements RejectedExecutionHandler {<a name="line.554"></a>
+<span class="sourceLineNo">555</span>    @Override<a name="line.555"></a>
+<span class="sourceLineNo">556</span>    public void rejectedExecution(Runnable runnable, ThreadPoolExecutor pool) {<a name="line.556"></a>
+<span class="sourceLineNo">557</span>      if (runnable instanceof CompactionRunner) {<a name="line.557"></a>
+<span class="sourceLineNo">558</span>        CompactionRunner runner = (CompactionRunner)runnable;<a name="line.558"></a>
+<span class="sourceLineNo">559</span>        LOG.debug("Compaction Rejected: " + runner);<a name="line.559"></a>
+<span class="sourceLineNo">560</span>        runner.store.cancelRequestedCompaction(runner.compaction);<a name="line.560"></a>
+<span class="sourceLineNo">561</span>      }<a name="line.561"></a>
+<span class="sourceLineNo">562</span>    }<a name="line.562"></a>
+<span class="sourceLineNo">563</span>  }<a name="line.563"></a>
+<span class="sourceLineNo">564</span><a name="line.564"></a>
+<span class="sourceLineNo">565</span>  /**<a name="line.565"></a>
+<span class="sourceLineNo">566</span>   * {@inheritDoc}<a name="line.566"></a>
+<span class="sourceLineNo">567</span>   */<a name="line.567"></a>
+<span class="sourceLineNo">568</span>  @Override<a name="line.568"></a>
+<span class="sourceLineNo">569</span>  public void onConfigurationChange(Configuration newConf) {<a name="line.569"></a>
+<span class="sourceLineNo">570</span>    // Check if number of large / small compaction threads has changed, and then<a name="line.570"></a>
+<span class="sourceLineNo">571</span>    // adjust the core pool size of the thread pools, by using the<a name="line.571"></a>
+<span class="sourceLineNo">572</span>    // setCorePoolSize() method. According to the javadocs, it is safe to<a name="line.572"></a>
+<span class="sourceLineNo">573</span>    // change the core pool size on-the-fly. We need to reset the maximum<a name="line.573"></a>
+<span class="sourceLineNo">574</span>    // pool size, as well.<a name="line.574"></a>
+<span class="sourceLineNo">575</span>    int largeThreads = Math.max(1, newConf.getInt(<a name="line.575"></a>
+<span class="sourceLineNo">576</span>            LARGE_COMPACTION_THREADS,<a name="line.576"></a>
+<span class="sourceLineNo">577</span>            LARGE_COMPACTION_THREADS_DEFAULT));<a name="line.577"></a>
+<span class="sourceLineNo">578</span>    if (this.longCompactions.getCorePoolSize() != largeThreads) {<a name="line.578"></a>
+<span class="sourceLineNo">579</span>      LOG.info("Changing the value of " + LARGE_COMPACTION_THREADS +<a name="line.579"></a>
+<span class="sourceLineNo">580</span>              " from " + this.longCompactions.getCorePoolSize() + " to " +<a name="line.580"></a>
+<span class="sourceLineNo">581</span>              largeThreads);<a name="line.581"></a>
+<span class="sourceLineNo">582</span>      if(this.longCompactions.getCorePoolSize() &lt; largeThreads) {<a name="line.582"></a>
+<span class="sourceLineNo">583</span>        this.longCompactions.setMaximumPoolSize(largeThreads);<a name="line.583"></a>
+<span class="sourceLineNo">584</span>        this.longCompactions.setCorePoolSize(largeThreads);<a name="line.584"></a>
+<span class="sourceLineNo">585</span>      } else {<a name="line.585"></a>
+<span class="sourceLineNo">586</span>        this.longCompactions.setCorePoolSize(largeThreads);<a name="line.586"></a>
+<span class="sourceLineNo">587</span>        this.longCompactions.setMaximumPoolSize(largeThreads);<a name="line.587"></a>
+<span class="sourceLineNo">588</span>      }<a name="line.588"></a>
+<span class="sourceLineNo">589</span>    }<a name="line.589"></a>
+<span class="sourceLineNo">590</span><a name="line.590"></a>
+<span class="sourceLineNo">591</span>    int smallThreads = newConf.getInt(SMALL_COMPACTION_THREADS,<a name="line.591"></a>
+<span class="sourceLineNo">592</span>            SMALL_COMPACTION_THREADS_DEFAULT);<a name="line.592"></a>
+<span class="sourceLineNo">593</span>    if (this.shortCompactions.getCorePoolSize() != smallThreads) {<a name="line.593"></a>
+<span class="sourceLineNo">594</span>      LOG.info("Changing the value of " + SMALL_COMPACTION_THREADS +<a name="line.594"></a>
+<span class="sourceLineNo">595</span>                " from " + this.shortCompactions.getCorePoolSize() + " to " +<a name="line.595"></a>
+<span class="sourceLineNo">596</span>                smallThreads);<a name="line.596"></a>
+<span class="sourceLineNo">597</span>      if(this.shortCompactions.getCorePoolSize() &lt; smallThreads) {<a name="line.597"></a>
+<span class="sourceLineNo">598</span>        this.shortCompactions.setMaximumPoolSize(smallThreads);<a name="line.598"></a>
+<span class="sourceLineNo">599</span>        this.shortCompactions.setCorePoolSize(smallThreads);<a name="line.599"></a>
+<span class="sourceLineNo">600</span>      } else {<a name="line.600"></a>
+<span class="sourceLineNo">601</span>        this.shortCompactions.setCorePoolSize(smallThreads);<a name="line.601"></a>
+<span class="sourceLineNo">602</span>        this.shortCompactions.setMaximumPoolSize(smallThreads);<a name="line.602"></a>
+<span class="sourceLineNo">603</span>      }<a name="line.603"></a>
+<span class="sourceLineNo">604</span>    }<a name="line.604"></a>
+<span class="sourceLineNo">605</span><a name="line.605"></a>
+<span class="sourceLineNo">606</span>    int splitThreads = newConf.getInt(SPLIT_THREADS,<a name="line.606"></a>
+<span class="sourceLineNo">607</span>            SPLIT_THREADS_DEFAULT);<a name="line.607"></a>
+<span class="sourceLineNo">608</span>    if (this.splits.getCorePoolSize() != splitThreads) {<a name="line.608"></a>
+<span class="sourceLineNo">609</span>      LOG.info("Changing the value of " + SPLIT_THREADS +<a name="line.609"></a>
+<span class="sourceLineNo">610</span>                " from " + this.splits.getCorePoolSize() + " to " +<a name="line.610"></a>
+<span class="sourceLineNo">611</span>                splitThreads);<a name="line.611"></a>
+<span class="sourceLineNo">612</span>      if(this.splits.getCorePoolSize() &lt; splitThreads) {<a name="line.612"></a>
+<span class="sourceLineNo">613</span>        this.splits.setMaximumPoolSize(splitThreads);<a name="line.613"></a>
+<span class="sourceLineNo">614</span>        this.splits.setCorePoolSize(splitThreads);<a name="line.614"></a>
+<span class="sourceLineNo">615</span>      } else {<a name="line.615"></a>
+<span class="sourceLineNo">616</span>        this.splits.setCorePoolSize(splitThreads);<a name="line.616"></a>
+<span class="sourceLineNo">617</span>        this.splits.setMaximumPoolSize(splitThreads);<a name="line.617"></a>
+<span class="sourceLineNo">618</span>      }<a name="line.618"></a>
+<span class="sourceLineNo">619</span>    }<a name="line.619"></a>
+<span class="sourceLineNo">620</span><a name="line.620"></a>
+<span class="sourceLineNo">621</span>    ThroughputController old = this.compactionThroughputController;<a name="line.621"></a>
+<span class="sourceLineNo">622</span>    if (old != null) {<a name="line.622"></a>
+<span class="sourceLineNo">623</span>      old.stop("configuration change");<a name="line.623"></a>
+<span class="sourceLineNo">624</span>    }<a name="line.624"></a>
+<span class="sourceLineNo">625</span>    this.compactionThroughputController =<a name="line.625"></a>
+<span class="sourceLineNo">626</span>        CompactionThroughputControllerFactory.create(server, newConf);<a name="line.626"></a>
+<span class="sourceLineNo">627</span><a name="line.627"></a>
+<span class="sourceLineNo">628</span>    // We change this atomically here instead of reloading the config in order that upstream<a name="line.628"></a>
+<span class="sourceLineNo">629</span>    // would be the only one with the flexibility to reload the config.<a name="line.629"></a>
+<span class="sourceLineNo">630</span>    this.conf.reloadConfiguration();<a name="line.630"></a>
+<span class="sourceLineNo">631</span>  }<a name="line.631"></a>
+<span class="sourceLineNo">632</span><a name="line.632"></a>
+<span class="sourceLineNo">633</span>  protected int getSmallCompactionThreadNum() {<a name="line.633"></a>
+<span class="sourceLineNo">634</span>    return this.shortCompactions.getCorePoolSize();<a name="line.634"></a>
+<span class="sourceLineNo">635</span>  }<a name="line.635"></a>
+<span class="sourceLineNo">636</span><a name="line.636"></a>
+<span class="sourceLineNo">637</span>  protected int getLargeCompactionThreadNum() {<a name="line.637"></a>
+<span class="sourceLineNo">638</span>    return this.longCompactions.getCorePoolSize();<a name="line.638"></a>
+<span class="sourceLineNo">639</span>  }<a name="line.639"></a>
+<span class="sourceLineNo">640</span><a name="line.640"></a>
+<span class="sourceLineNo">641</span>  protected int getSplitThreadNum() {<a name="line.641"></a>
+<span class="sourceLineNo">642</span>    return this.splits.getCorePoolSize();<a name="line.642"></a>
+<span class="sourceLineNo">643</span>  }<a name="line.643"></a>
+<span class="sourceLineNo">644</span><a name="line.644"></a>
+<span class="sourceLineNo">645</span>  /**<a name="line.645"></a>
+<span class="sourceLineNo">646</span>   * {@inheritDoc}<a name="line.646"></a>
+<span class="sourceLineNo">647</span>   */<a name="line.647"></a>
+<span class="sourceLineNo">648</span>  @Override<a name="line.648"></a>
+<span class="sourceLineNo">649</span>  public void registerChildren(ConfigurationManager manager) {<a name="line.649"></a>
+<span class="sourceLineNo">650</span>    // No children to register.<a name="line.650"></a>
+<span class="sourceLineNo">651</span>  }<a name="line.651"></a>
+<span class="sourceLineNo">652</span><a name="line.652"></a>
+<span class="sourceLineNo">653</span>  /**<a name="line.653"></a>
+<span class="sourceLineNo">654</span>   * {@inheritDoc}<a name="line.654"></a>
+<span class="sourceLineNo">655</span>   */<a name="line.655"></a>
+<span class="sourceLineNo">656</span>  @Override<a name="line.656"></a>
+<span class="sourceLineNo">657</span>  public void deregisterChildren(ConfigurationManager manager) {<a name="line.657"></a>
+<span class="sourceLineNo">658</span>    // No children to register<a name="line.658"></a>
+<span class="sourceLineNo">659</span>  }<a name="line.659"></a>
+<span class="sourceLineNo">660</span><a name="line.660"></a>
+<span class="sourceLineNo">661</span>  @VisibleForTesting<a name="line.661"></a>
+<span class="sourceLineNo">662</span>  public ThroughputController getCompactionThroughputController() {<a name="line.662"></a>
+<span class="sourceLineNo">663</span>    return compactionThroughputController;<a name="line.663"></a>
+<span class="sourceLineNo">664</span>  }<a name="line.664"></a>
+<span class="sourceLineNo">665</span><a name="line.665"></a>
+<span class="sourceLineNo">666</span>  @VisibleForTesting<a name="line.666"></a>
+<span class="sourceLineNo">667</span>  /**<a name="line.667"></a>
+<span class="sourceLineNo">668</span>   * Shutdown the long compaction thread pool.<a name="line.668"></a>
+<span class="sourceLineNo">669</span>   * Should only be used in unit test to prevent long compaction thread pool from stealing job<a name="line.669"></a>
+<span class="sourceLineNo">670</span>   * from short compaction queue<a name="line.670"></a>
+<span class="sourceLineNo">671</span>   */<a name="line.671"></a>
+<span class="sourceLineNo">672</span>  void shutdownLongCompactions(){<a name="line.672"></a>
+<span class="sourceLineNo">673</span>    this.longCompactions.shutdown();<a name="line.673"></a>
+<span class="sourceLineNo">674</span>  }<a name="line.674"></a>
+<span class="sourceLineNo">675</span>}<a name="line.675"></a>
 
 
 


Mime
View raw message