hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [33/51] [partial] hbase-site git commit: Published site at .
Date Fri, 12 Jan 2018 15:32:02 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/0b638133/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/HRegionServer.PeriodicMemStoreFlusher.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/HRegionServer.PeriodicMemStoreFlusher.html b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/HRegionServer.PeriodicMemStoreFlusher.html
index 163ade0..802fc2f 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/HRegionServer.PeriodicMemStoreFlusher.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/HRegionServer.PeriodicMemStoreFlusher.html
@@ -254,3512 +254,3505 @@
 <span class="sourceLineNo">246</span>  protected MemStoreFlusher cacheFlusher;<a name="line.246"></a>
 <span class="sourceLineNo">247</span><a name="line.247"></a>
 <span class="sourceLineNo">248</span>  protected HeapMemoryManager hMemManager;<a name="line.248"></a>
-<span class="sourceLineNo">249</span>  protected CountDownLatch initLatch = null;<a name="line.249"></a>
-<span class="sourceLineNo">250</span><a name="line.250"></a>
-<span class="sourceLineNo">251</span>  /**<a name="line.251"></a>
-<span class="sourceLineNo">252</span>   * Cluster connection to be shared by services.<a name="line.252"></a>
-<span class="sourceLineNo">253</span>   * Initialized at server startup and closed when server shuts down.<a name="line.253"></a>
-<span class="sourceLineNo">254</span>   * Clients must never close it explicitly.<a name="line.254"></a>
-<span class="sourceLineNo">255</span>   */<a name="line.255"></a>
-<span class="sourceLineNo">256</span>  protected ClusterConnection clusterConnection;<a name="line.256"></a>
-<span class="sourceLineNo">257</span><a name="line.257"></a>
-<span class="sourceLineNo">258</span>  /*<a name="line.258"></a>
-<span class="sourceLineNo">259</span>   * Long-living meta table locator, which is created when the server is started and stopped<a name="line.259"></a>
-<span class="sourceLineNo">260</span>   * when server shuts down. References to this locator shall be used to perform according<a name="line.260"></a>
-<span class="sourceLineNo">261</span>   * operations in EventHandlers. Primary reason for this decision is to make it mockable<a name="line.261"></a>
-<span class="sourceLineNo">262</span>   * for tests.<a name="line.262"></a>
-<span class="sourceLineNo">263</span>   */<a name="line.263"></a>
-<span class="sourceLineNo">264</span>  protected MetaTableLocator metaTableLocator;<a name="line.264"></a>
-<span class="sourceLineNo">265</span><a name="line.265"></a>
-<span class="sourceLineNo">266</span>  /**<a name="line.266"></a>
-<span class="sourceLineNo">267</span>   * Go here to get table descriptors.<a name="line.267"></a>
-<span class="sourceLineNo">268</span>   */<a name="line.268"></a>
-<span class="sourceLineNo">269</span>  protected TableDescriptors tableDescriptors;<a name="line.269"></a>
-<span class="sourceLineNo">270</span><a name="line.270"></a>
-<span class="sourceLineNo">271</span>  // Replication services. If no replication, this handler will be null.<a name="line.271"></a>
-<span class="sourceLineNo">272</span>  protected ReplicationSourceService replicationSourceHandler;<a name="line.272"></a>
-<span class="sourceLineNo">273</span>  protected ReplicationSinkService replicationSinkHandler;<a name="line.273"></a>
-<span class="sourceLineNo">274</span><a name="line.274"></a>
-<span class="sourceLineNo">275</span>  // Compactions<a name="line.275"></a>
-<span class="sourceLineNo">276</span>  public CompactSplit compactSplitThread;<a name="line.276"></a>
-<span class="sourceLineNo">277</span><a name="line.277"></a>
-<span class="sourceLineNo">278</span>  /**<a name="line.278"></a>
-<span class="sourceLineNo">279</span>   * Map of regions currently being served by this region server. Key is the<a name="line.279"></a>
-<span class="sourceLineNo">280</span>   * encoded region name.  All access should be synchronized.<a name="line.280"></a>
-<span class="sourceLineNo">281</span>   */<a name="line.281"></a>
-<span class="sourceLineNo">282</span>  protected final Map&lt;String, HRegion&gt; onlineRegions = new ConcurrentHashMap&lt;&gt;();<a name="line.282"></a>
-<span class="sourceLineNo">283</span><a name="line.283"></a>
-<span class="sourceLineNo">284</span>  /**<a name="line.284"></a>
-<span class="sourceLineNo">285</span>   * Map of encoded region names to the DataNode locations they should be hosted on<a name="line.285"></a>
-<span class="sourceLineNo">286</span>   * We store the value as InetSocketAddress since this is used only in HDFS<a name="line.286"></a>
-<span class="sourceLineNo">287</span>   * API (create() that takes favored nodes as hints for placing file blocks).<a name="line.287"></a>
-<span class="sourceLineNo">288</span>   * We could have used ServerName here as the value class, but we'd need to<a name="line.288"></a>
-<span class="sourceLineNo">289</span>   * convert it to InetSocketAddress at some point before the HDFS API call, and<a name="line.289"></a>
-<span class="sourceLineNo">290</span>   * it seems a bit weird to store ServerName since ServerName refers to RegionServers<a name="line.290"></a>
-<span class="sourceLineNo">291</span>   * and here we really mean DataNode locations.<a name="line.291"></a>
-<span class="sourceLineNo">292</span>   */<a name="line.292"></a>
-<span class="sourceLineNo">293</span>  protected final Map&lt;String, InetSocketAddress[]&gt; regionFavoredNodesMap =<a name="line.293"></a>
-<span class="sourceLineNo">294</span>      new ConcurrentHashMap&lt;&gt;();<a name="line.294"></a>
-<span class="sourceLineNo">295</span><a name="line.295"></a>
-<span class="sourceLineNo">296</span>  // Leases<a name="line.296"></a>
-<span class="sourceLineNo">297</span>  protected Leases leases;<a name="line.297"></a>
-<span class="sourceLineNo">298</span><a name="line.298"></a>
-<span class="sourceLineNo">299</span>  // Instance of the hbase executor executorService.<a name="line.299"></a>
-<span class="sourceLineNo">300</span>  protected ExecutorService executorService;<a name="line.300"></a>
-<span class="sourceLineNo">301</span><a name="line.301"></a>
-<span class="sourceLineNo">302</span>  // If false, the file system has become unavailable<a name="line.302"></a>
-<span class="sourceLineNo">303</span>  protected volatile boolean fsOk;<a name="line.303"></a>
-<span class="sourceLineNo">304</span>  protected HFileSystem fs;<a name="line.304"></a>
-<span class="sourceLineNo">305</span>  protected HFileSystem walFs;<a name="line.305"></a>
-<span class="sourceLineNo">306</span><a name="line.306"></a>
-<span class="sourceLineNo">307</span>  // Set when a report to the master comes back with a message asking us to<a name="line.307"></a>
-<span class="sourceLineNo">308</span>  // shutdown. Also set by call to stop when debugging or running unit tests<a name="line.308"></a>
-<span class="sourceLineNo">309</span>  // of HRegionServer in isolation.<a name="line.309"></a>
-<span class="sourceLineNo">310</span>  private volatile boolean stopped = false;<a name="line.310"></a>
-<span class="sourceLineNo">311</span><a name="line.311"></a>
-<span class="sourceLineNo">312</span>  // Go down hard. Used if file system becomes unavailable and also in<a name="line.312"></a>
-<span class="sourceLineNo">313</span>  // debugging and unit tests.<a name="line.313"></a>
-<span class="sourceLineNo">314</span>  private volatile boolean abortRequested;<a name="line.314"></a>
-<span class="sourceLineNo">315</span><a name="line.315"></a>
-<span class="sourceLineNo">316</span>  ConcurrentMap&lt;String, Integer&gt; rowlocks = new ConcurrentHashMap&lt;&gt;();<a name="line.316"></a>
-<span class="sourceLineNo">317</span><a name="line.317"></a>
-<span class="sourceLineNo">318</span>  // A state before we go into stopped state.  At this stage we're closing user<a name="line.318"></a>
-<span class="sourceLineNo">319</span>  // space regions.<a name="line.319"></a>
-<span class="sourceLineNo">320</span>  private boolean stopping = false;<a name="line.320"></a>
-<span class="sourceLineNo">321</span><a name="line.321"></a>
-<span class="sourceLineNo">322</span>  volatile boolean killed = false;<a name="line.322"></a>
-<span class="sourceLineNo">323</span><a name="line.323"></a>
-<span class="sourceLineNo">324</span>  protected final Configuration conf;<a name="line.324"></a>
-<span class="sourceLineNo">325</span><a name="line.325"></a>
-<span class="sourceLineNo">326</span>  private Path rootDir;<a name="line.326"></a>
-<span class="sourceLineNo">327</span>  private Path walRootDir;<a name="line.327"></a>
-<span class="sourceLineNo">328</span><a name="line.328"></a>
-<span class="sourceLineNo">329</span>  protected final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();<a name="line.329"></a>
-<span class="sourceLineNo">330</span><a name="line.330"></a>
-<span class="sourceLineNo">331</span>  final int numRetries;<a name="line.331"></a>
-<span class="sourceLineNo">332</span>  protected final int threadWakeFrequency;<a name="line.332"></a>
-<span class="sourceLineNo">333</span>  protected final int msgInterval;<a name="line.333"></a>
-<span class="sourceLineNo">334</span><a name="line.334"></a>
-<span class="sourceLineNo">335</span>  protected final int numRegionsToReport;<a name="line.335"></a>
-<span class="sourceLineNo">336</span><a name="line.336"></a>
-<span class="sourceLineNo">337</span>  // Stub to do region server status calls against the master.<a name="line.337"></a>
-<span class="sourceLineNo">338</span>  private volatile RegionServerStatusService.BlockingInterface rssStub;<a name="line.338"></a>
-<span class="sourceLineNo">339</span>  private volatile LockService.BlockingInterface lockStub;<a name="line.339"></a>
-<span class="sourceLineNo">340</span>  // RPC client. Used to make the stub above that does region server status checking.<a name="line.340"></a>
-<span class="sourceLineNo">341</span>  RpcClient rpcClient;<a name="line.341"></a>
-<span class="sourceLineNo">342</span><a name="line.342"></a>
-<span class="sourceLineNo">343</span>  private RpcRetryingCallerFactory rpcRetryingCallerFactory;<a name="line.343"></a>
-<span class="sourceLineNo">344</span>  private RpcControllerFactory rpcControllerFactory;<a name="line.344"></a>
-<span class="sourceLineNo">345</span><a name="line.345"></a>
-<span class="sourceLineNo">346</span>  private UncaughtExceptionHandler uncaughtExceptionHandler;<a name="line.346"></a>
-<span class="sourceLineNo">347</span><a name="line.347"></a>
-<span class="sourceLineNo">348</span>  // Info server. Default access so can be used by unit tests. REGIONSERVER<a name="line.348"></a>
-<span class="sourceLineNo">349</span>  // is name of the webapp and the attribute name used stuffing this instance<a name="line.349"></a>
-<span class="sourceLineNo">350</span>  // into web context.<a name="line.350"></a>
-<span class="sourceLineNo">351</span>  protected InfoServer infoServer;<a name="line.351"></a>
-<span class="sourceLineNo">352</span>  private JvmPauseMonitor pauseMonitor;<a name="line.352"></a>
-<span class="sourceLineNo">353</span><a name="line.353"></a>
-<span class="sourceLineNo">354</span>  /** region server process name */<a name="line.354"></a>
-<span class="sourceLineNo">355</span>  public static final String REGIONSERVER = "regionserver";<a name="line.355"></a>
-<span class="sourceLineNo">356</span><a name="line.356"></a>
-<span class="sourceLineNo">357</span>  MetricsRegionServer metricsRegionServer;<a name="line.357"></a>
-<span class="sourceLineNo">358</span>  MetricsTable metricsTable;<a name="line.358"></a>
-<span class="sourceLineNo">359</span>  private SpanReceiverHost spanReceiverHost;<a name="line.359"></a>
-<span class="sourceLineNo">360</span><a name="line.360"></a>
-<span class="sourceLineNo">361</span>  /**<a name="line.361"></a>
-<span class="sourceLineNo">362</span>   * ChoreService used to schedule tasks that we want to run periodically<a name="line.362"></a>
-<span class="sourceLineNo">363</span>   */<a name="line.363"></a>
-<span class="sourceLineNo">364</span>  private ChoreService choreService;<a name="line.364"></a>
-<span class="sourceLineNo">365</span><a name="line.365"></a>
-<span class="sourceLineNo">366</span>  /*<a name="line.366"></a>
-<span class="sourceLineNo">367</span>   * Check for compactions requests.<a name="line.367"></a>
-<span class="sourceLineNo">368</span>   */<a name="line.368"></a>
-<span class="sourceLineNo">369</span>  ScheduledChore compactionChecker;<a name="line.369"></a>
-<span class="sourceLineNo">370</span><a name="line.370"></a>
-<span class="sourceLineNo">371</span>  /*<a name="line.371"></a>
-<span class="sourceLineNo">372</span>   * Check for flushes<a name="line.372"></a>
-<span class="sourceLineNo">373</span>   */<a name="line.373"></a>
-<span class="sourceLineNo">374</span>  ScheduledChore periodicFlusher;<a name="line.374"></a>
-<span class="sourceLineNo">375</span><a name="line.375"></a>
-<span class="sourceLineNo">376</span>  protected volatile WALFactory walFactory;<a name="line.376"></a>
-<span class="sourceLineNo">377</span><a name="line.377"></a>
-<span class="sourceLineNo">378</span>  // WAL roller. log is protected rather than private to avoid<a name="line.378"></a>
-<span class="sourceLineNo">379</span>  // eclipse warning when accessed by inner classes<a name="line.379"></a>
-<span class="sourceLineNo">380</span>  protected LogRoller walRoller;<a name="line.380"></a>
-<span class="sourceLineNo">381</span><a name="line.381"></a>
-<span class="sourceLineNo">382</span>  // A thread which calls reportProcedureDone<a name="line.382"></a>
-<span class="sourceLineNo">383</span>  private RemoteProcedureResultReporter procedureResultReporter;<a name="line.383"></a>
-<span class="sourceLineNo">384</span><a name="line.384"></a>
-<span class="sourceLineNo">385</span>  // flag set after we're done setting up server threads<a name="line.385"></a>
-<span class="sourceLineNo">386</span>  final AtomicBoolean online = new AtomicBoolean(false);<a name="line.386"></a>
-<span class="sourceLineNo">387</span><a name="line.387"></a>
-<span class="sourceLineNo">388</span>  // zookeeper connection and watcher<a name="line.388"></a>
-<span class="sourceLineNo">389</span>  protected ZKWatcher zooKeeper;<a name="line.389"></a>
-<span class="sourceLineNo">390</span><a name="line.390"></a>
-<span class="sourceLineNo">391</span>  // master address tracker<a name="line.391"></a>
-<span class="sourceLineNo">392</span>  private MasterAddressTracker masterAddressTracker;<a name="line.392"></a>
-<span class="sourceLineNo">393</span><a name="line.393"></a>
-<span class="sourceLineNo">394</span>  // Cluster Status Tracker<a name="line.394"></a>
-<span class="sourceLineNo">395</span>  protected ClusterStatusTracker clusterStatusTracker;<a name="line.395"></a>
-<span class="sourceLineNo">396</span><a name="line.396"></a>
-<span class="sourceLineNo">397</span>  // Log Splitting Worker<a name="line.397"></a>
-<span class="sourceLineNo">398</span>  private SplitLogWorker splitLogWorker;<a name="line.398"></a>
-<span class="sourceLineNo">399</span><a name="line.399"></a>
-<span class="sourceLineNo">400</span>  // A sleeper that sleeps for msgInterval.<a name="line.400"></a>
-<span class="sourceLineNo">401</span>  protected final Sleeper sleeper;<a name="line.401"></a>
-<span class="sourceLineNo">402</span><a name="line.402"></a>
-<span class="sourceLineNo">403</span>  private final int operationTimeout;<a name="line.403"></a>
-<span class="sourceLineNo">404</span>  private final int shortOperationTimeout;<a name="line.404"></a>
-<span class="sourceLineNo">405</span><a name="line.405"></a>
-<span class="sourceLineNo">406</span>  private final RegionServerAccounting regionServerAccounting;<a name="line.406"></a>
-<span class="sourceLineNo">407</span><a name="line.407"></a>
-<span class="sourceLineNo">408</span>  // Cache configuration and block cache reference<a name="line.408"></a>
-<span class="sourceLineNo">409</span>  protected CacheConfig cacheConfig;<a name="line.409"></a>
-<span class="sourceLineNo">410</span>  // Cache configuration for mob<a name="line.410"></a>
-<span class="sourceLineNo">411</span>  final MobCacheConfig mobCacheConfig;<a name="line.411"></a>
-<span class="sourceLineNo">412</span><a name="line.412"></a>
-<span class="sourceLineNo">413</span>  /** The health check chore. */<a name="line.413"></a>
-<span class="sourceLineNo">414</span>  private HealthCheckChore healthCheckChore;<a name="line.414"></a>
-<span class="sourceLineNo">415</span><a name="line.415"></a>
-<span class="sourceLineNo">416</span>  /** The nonce manager chore. */<a name="line.416"></a>
-<span class="sourceLineNo">417</span>  private ScheduledChore nonceManagerChore;<a name="line.417"></a>
-<span class="sourceLineNo">418</span><a name="line.418"></a>
-<span class="sourceLineNo">419</span>  private Map&lt;String, com.google.protobuf.Service&gt; coprocessorServiceHandlers = Maps.newHashMap();<a name="line.419"></a>
-<span class="sourceLineNo">420</span><a name="line.420"></a>
-<span class="sourceLineNo">421</span>  /**<a name="line.421"></a>
-<span class="sourceLineNo">422</span>   * The server name the Master sees us as.  Its made from the hostname the<a name="line.422"></a>
-<span class="sourceLineNo">423</span>   * master passes us, port, and server startcode. Gets set after registration<a name="line.423"></a>
-<span class="sourceLineNo">424</span>   * against  Master.<a name="line.424"></a>
-<span class="sourceLineNo">425</span>   */<a name="line.425"></a>
-<span class="sourceLineNo">426</span>  protected ServerName serverName;<a name="line.426"></a>
-<span class="sourceLineNo">427</span><a name="line.427"></a>
-<span class="sourceLineNo">428</span>  /*<a name="line.428"></a>
-<span class="sourceLineNo">429</span>   * hostname specified by hostname config<a name="line.429"></a>
-<span class="sourceLineNo">430</span>   */<a name="line.430"></a>
-<span class="sourceLineNo">431</span>  protected String useThisHostnameInstead;<a name="line.431"></a>
-<span class="sourceLineNo">432</span><a name="line.432"></a>
-<span class="sourceLineNo">433</span>  // key to the config parameter of server hostname<a name="line.433"></a>
-<span class="sourceLineNo">434</span>  // the specification of server hostname is optional. The hostname should be resolvable from<a name="line.434"></a>
-<span class="sourceLineNo">435</span>  // both master and region server<a name="line.435"></a>
-<span class="sourceLineNo">436</span>  @InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.CONFIG)<a name="line.436"></a>
-<span class="sourceLineNo">437</span>  final static String RS_HOSTNAME_KEY = "hbase.regionserver.hostname";<a name="line.437"></a>
-<span class="sourceLineNo">438</span>  @InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.CONFIG)<a name="line.438"></a>
-<span class="sourceLineNo">439</span>  protected final static String MASTER_HOSTNAME_KEY = "hbase.master.hostname";<a name="line.439"></a>
-<span class="sourceLineNo">440</span><a name="line.440"></a>
-<span class="sourceLineNo">441</span>  // HBASE-18226: This config and hbase.regionserver.hostname are mutually exclusive.<a name="line.441"></a>
-<span class="sourceLineNo">442</span>  // Exception will be thrown if both are used.<a name="line.442"></a>
-<span class="sourceLineNo">443</span>  final static String RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY =<a name="line.443"></a>
-<span class="sourceLineNo">444</span>    "hbase.regionserver.hostname.disable.master.reversedns";<a name="line.444"></a>
-<span class="sourceLineNo">445</span><a name="line.445"></a>
-<span class="sourceLineNo">446</span>  /**<a name="line.446"></a>
-<span class="sourceLineNo">447</span>   * This servers startcode.<a name="line.447"></a>
-<span class="sourceLineNo">448</span>   */<a name="line.448"></a>
-<span class="sourceLineNo">449</span>  protected final long startcode;<a name="line.449"></a>
-<span class="sourceLineNo">450</span><a name="line.450"></a>
-<span class="sourceLineNo">451</span>  /**<a name="line.451"></a>
-<span class="sourceLineNo">452</span>   * Unique identifier for the cluster we are a part of.<a name="line.452"></a>
-<span class="sourceLineNo">453</span>   */<a name="line.453"></a>
-<span class="sourceLineNo">454</span>  private String clusterId;<a name="line.454"></a>
-<span class="sourceLineNo">455</span><a name="line.455"></a>
-<span class="sourceLineNo">456</span>  /**<a name="line.456"></a>
-<span class="sourceLineNo">457</span>   * MX Bean for RegionServerInfo<a name="line.457"></a>
-<span class="sourceLineNo">458</span>   */<a name="line.458"></a>
-<span class="sourceLineNo">459</span>  private ObjectName mxBean = null;<a name="line.459"></a>
-<span class="sourceLineNo">460</span><a name="line.460"></a>
-<span class="sourceLineNo">461</span>  /**<a name="line.461"></a>
-<span class="sourceLineNo">462</span>   * Chore to clean periodically the moved region list<a name="line.462"></a>
-<span class="sourceLineNo">463</span>   */<a name="line.463"></a>
-<span class="sourceLineNo">464</span>  private MovedRegionsCleaner movedRegionsCleaner;<a name="line.464"></a>
-<span class="sourceLineNo">465</span><a name="line.465"></a>
-<span class="sourceLineNo">466</span>  // chore for refreshing store files for secondary regions<a name="line.466"></a>
-<span class="sourceLineNo">467</span>  private StorefileRefresherChore storefileRefresher;<a name="line.467"></a>
-<span class="sourceLineNo">468</span><a name="line.468"></a>
-<span class="sourceLineNo">469</span>  private RegionServerCoprocessorHost rsHost;<a name="line.469"></a>
-<span class="sourceLineNo">470</span><a name="line.470"></a>
-<span class="sourceLineNo">471</span>  private RegionServerProcedureManagerHost rspmHost;<a name="line.471"></a>
-<span class="sourceLineNo">472</span><a name="line.472"></a>
-<span class="sourceLineNo">473</span>  private RegionServerRpcQuotaManager rsQuotaManager;<a name="line.473"></a>
-<span class="sourceLineNo">474</span>  private RegionServerSpaceQuotaManager rsSpaceQuotaManager;<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>   * Nonce manager. Nonces are used to make operations like increment and append idempotent<a name="line.477"></a>
-<span class="sourceLineNo">478</span>   * in the case where client doesn't receive the response from a successful operation and<a name="line.478"></a>
-<span class="sourceLineNo">479</span>   * retries. We track the successful ops for some time via a nonce sent by client and handle<a name="line.479"></a>
-<span class="sourceLineNo">480</span>   * duplicate operations (currently, by failing them; in future we might use MVCC to return<a name="line.480"></a>
-<span class="sourceLineNo">481</span>   * result). Nonces are also recovered from WAL during, recovery; however, the caveats (from<a name="line.481"></a>
-<span class="sourceLineNo">482</span>   * HBASE-3787) are:<a name="line.482"></a>
-<span class="sourceLineNo">483</span>   * - WAL recovery is optimized, and under high load we won't read nearly nonce-timeout worth<a name="line.483"></a>
-<span class="sourceLineNo">484</span>   *   of past records. If we don't read the records, we don't read and recover the nonces.<a name="line.484"></a>
-<span class="sourceLineNo">485</span>   *   Some WALs within nonce-timeout at recovery may not even be present due to rolling/cleanup.<a name="line.485"></a>
-<span class="sourceLineNo">486</span>   * - There's no WAL recovery during normal region move, so nonces will not be transfered.<a name="line.486"></a>
-<span class="sourceLineNo">487</span>   * We can have separate additional "Nonce WAL". It will just contain bunch of numbers and<a name="line.487"></a>
-<span class="sourceLineNo">488</span>   * won't be flushed on main path - because WAL itself also contains nonces, if we only flush<a name="line.488"></a>
-<span class="sourceLineNo">489</span>   * it before memstore flush, for a given nonce we will either see it in the WAL (if it was<a name="line.489"></a>
-<span class="sourceLineNo">490</span>   * never flushed to disk, it will be part of recovery), or we'll see it as part of the nonce<a name="line.490"></a>
-<span class="sourceLineNo">491</span>   * log (or both occasionally, which doesn't matter). Nonce log file can be deleted after the<a name="line.491"></a>
-<span class="sourceLineNo">492</span>   * latest nonce in it expired. It can also be recovered during move.<a name="line.492"></a>
-<span class="sourceLineNo">493</span>   */<a name="line.493"></a>
-<span class="sourceLineNo">494</span>  final ServerNonceManager nonceManager;<a name="line.494"></a>
-<span class="sourceLineNo">495</span><a name="line.495"></a>
-<span class="sourceLineNo">496</span>  private UserProvider userProvider;<a name="line.496"></a>
-<span class="sourceLineNo">497</span><a name="line.497"></a>
-<span class="sourceLineNo">498</span>  protected final RSRpcServices rpcServices;<a name="line.498"></a>
-<span class="sourceLineNo">499</span><a name="line.499"></a>
-<span class="sourceLineNo">500</span>  protected CoordinatedStateManager csm;<a name="line.500"></a>
-<span class="sourceLineNo">501</span><a name="line.501"></a>
-<span class="sourceLineNo">502</span>  /**<a name="line.502"></a>
-<span class="sourceLineNo">503</span>   * Configuration manager is used to register/deregister and notify the configuration observers<a name="line.503"></a>
-<span class="sourceLineNo">504</span>   * when the regionserver is notified that there was a change in the on disk configs.<a name="line.504"></a>
-<span class="sourceLineNo">505</span>   */<a name="line.505"></a>
-<span class="sourceLineNo">506</span>  protected final ConfigurationManager configurationManager;<a name="line.506"></a>
-<span class="sourceLineNo">507</span><a name="line.507"></a>
-<span class="sourceLineNo">508</span>  @VisibleForTesting<a name="line.508"></a>
-<span class="sourceLineNo">509</span>  CompactedHFilesDischarger compactedFileDischarger;<a name="line.509"></a>
-<span class="sourceLineNo">510</span><a name="line.510"></a>
-<span class="sourceLineNo">511</span>  private volatile ThroughputController flushThroughputController;<a name="line.511"></a>
-<span class="sourceLineNo">512</span><a name="line.512"></a>
-<span class="sourceLineNo">513</span>  protected SecureBulkLoadManager secureBulkLoadManager;<a name="line.513"></a>
-<span class="sourceLineNo">514</span><a name="line.514"></a>
-<span class="sourceLineNo">515</span>  protected FileSystemUtilizationChore fsUtilizationChore;<a name="line.515"></a>
-<span class="sourceLineNo">516</span><a name="line.516"></a>
-<span class="sourceLineNo">517</span>  private final NettyEventLoopGroupConfig eventLoopGroupConfig;<a name="line.517"></a>
-<span class="sourceLineNo">518</span><a name="line.518"></a>
-<span class="sourceLineNo">519</span>  /**<a name="line.519"></a>
-<span class="sourceLineNo">520</span>   * True if this RegionServer is coming up in a cluster where there is no Master;<a name="line.520"></a>
-<span class="sourceLineNo">521</span>   * means it needs to just come up and make do without a Master to talk to: e.g. in test or<a name="line.521"></a>
-<span class="sourceLineNo">522</span>   * HRegionServer is doing other than its usual duties: e.g. as an hollowed-out host whose only<a name="line.522"></a>
-<span class="sourceLineNo">523</span>   * purpose is as a Replication-stream sink; see HBASE-18846 for more.<a name="line.523"></a>
-<span class="sourceLineNo">524</span>   */<a name="line.524"></a>
-<span class="sourceLineNo">525</span>  private final boolean masterless;<a name="line.525"></a>
-<span class="sourceLineNo">526</span>  static final String MASTERLESS_CONFIG_NAME = "hbase.masterless";<a name="line.526"></a>
+<span class="sourceLineNo">249</span><a name="line.249"></a>
+<span class="sourceLineNo">250</span>  /**<a name="line.250"></a>
+<span class="sourceLineNo">251</span>   * Cluster connection to be shared by services.<a name="line.251"></a>
+<span class="sourceLineNo">252</span>   * Initialized at server startup and closed when server shuts down.<a name="line.252"></a>
+<span class="sourceLineNo">253</span>   * Clients must never close it explicitly.<a name="line.253"></a>
+<span class="sourceLineNo">254</span>   */<a name="line.254"></a>
+<span class="sourceLineNo">255</span>  protected ClusterConnection clusterConnection;<a name="line.255"></a>
+<span class="sourceLineNo">256</span><a name="line.256"></a>
+<span class="sourceLineNo">257</span>  /*<a name="line.257"></a>
+<span class="sourceLineNo">258</span>   * Long-living meta table locator, which is created when the server is started and stopped<a name="line.258"></a>
+<span class="sourceLineNo">259</span>   * when server shuts down. References to this locator shall be used to perform according<a name="line.259"></a>
+<span class="sourceLineNo">260</span>   * operations in EventHandlers. Primary reason for this decision is to make it mockable<a name="line.260"></a>
+<span class="sourceLineNo">261</span>   * for tests.<a name="line.261"></a>
+<span class="sourceLineNo">262</span>   */<a name="line.262"></a>
+<span class="sourceLineNo">263</span>  protected MetaTableLocator metaTableLocator;<a name="line.263"></a>
+<span class="sourceLineNo">264</span><a name="line.264"></a>
+<span class="sourceLineNo">265</span>  /**<a name="line.265"></a>
+<span class="sourceLineNo">266</span>   * Go here to get table descriptors.<a name="line.266"></a>
+<span class="sourceLineNo">267</span>   */<a name="line.267"></a>
+<span class="sourceLineNo">268</span>  protected TableDescriptors tableDescriptors;<a name="line.268"></a>
+<span class="sourceLineNo">269</span><a name="line.269"></a>
+<span class="sourceLineNo">270</span>  // Replication services. If no replication, this handler will be null.<a name="line.270"></a>
+<span class="sourceLineNo">271</span>  protected ReplicationSourceService replicationSourceHandler;<a name="line.271"></a>
+<span class="sourceLineNo">272</span>  protected ReplicationSinkService replicationSinkHandler;<a name="line.272"></a>
+<span class="sourceLineNo">273</span><a name="line.273"></a>
+<span class="sourceLineNo">274</span>  // Compactions<a name="line.274"></a>
+<span class="sourceLineNo">275</span>  public CompactSplit compactSplitThread;<a name="line.275"></a>
+<span class="sourceLineNo">276</span><a name="line.276"></a>
+<span class="sourceLineNo">277</span>  /**<a name="line.277"></a>
+<span class="sourceLineNo">278</span>   * Map of regions currently being served by this region server. Key is the<a name="line.278"></a>
+<span class="sourceLineNo">279</span>   * encoded region name.  All access should be synchronized.<a name="line.279"></a>
+<span class="sourceLineNo">280</span>   */<a name="line.280"></a>
+<span class="sourceLineNo">281</span>  protected final Map&lt;String, HRegion&gt; onlineRegions = new ConcurrentHashMap&lt;&gt;();<a name="line.281"></a>
+<span class="sourceLineNo">282</span><a name="line.282"></a>
+<span class="sourceLineNo">283</span>  /**<a name="line.283"></a>
+<span class="sourceLineNo">284</span>   * Map of encoded region names to the DataNode locations they should be hosted on<a name="line.284"></a>
+<span class="sourceLineNo">285</span>   * We store the value as InetSocketAddress since this is used only in HDFS<a name="line.285"></a>
+<span class="sourceLineNo">286</span>   * API (create() that takes favored nodes as hints for placing file blocks).<a name="line.286"></a>
+<span class="sourceLineNo">287</span>   * We could have used ServerName here as the value class, but we'd need to<a name="line.287"></a>
+<span class="sourceLineNo">288</span>   * convert it to InetSocketAddress at some point before the HDFS API call, and<a name="line.288"></a>
+<span class="sourceLineNo">289</span>   * it seems a bit weird to store ServerName since ServerName refers to RegionServers<a name="line.289"></a>
+<span class="sourceLineNo">290</span>   * and here we really mean DataNode locations.<a name="line.290"></a>
+<span class="sourceLineNo">291</span>   */<a name="line.291"></a>
+<span class="sourceLineNo">292</span>  protected final Map&lt;String, InetSocketAddress[]&gt; regionFavoredNodesMap =<a name="line.292"></a>
+<span class="sourceLineNo">293</span>      new ConcurrentHashMap&lt;&gt;();<a name="line.293"></a>
+<span class="sourceLineNo">294</span><a name="line.294"></a>
+<span class="sourceLineNo">295</span>  // Leases<a name="line.295"></a>
+<span class="sourceLineNo">296</span>  protected Leases leases;<a name="line.296"></a>
+<span class="sourceLineNo">297</span><a name="line.297"></a>
+<span class="sourceLineNo">298</span>  // Instance of the hbase executor executorService.<a name="line.298"></a>
+<span class="sourceLineNo">299</span>  protected ExecutorService executorService;<a name="line.299"></a>
+<span class="sourceLineNo">300</span><a name="line.300"></a>
+<span class="sourceLineNo">301</span>  // If false, the file system has become unavailable<a name="line.301"></a>
+<span class="sourceLineNo">302</span>  protected volatile boolean fsOk;<a name="line.302"></a>
+<span class="sourceLineNo">303</span>  protected HFileSystem fs;<a name="line.303"></a>
+<span class="sourceLineNo">304</span>  protected HFileSystem walFs;<a name="line.304"></a>
+<span class="sourceLineNo">305</span><a name="line.305"></a>
+<span class="sourceLineNo">306</span>  // Set when a report to the master comes back with a message asking us to<a name="line.306"></a>
+<span class="sourceLineNo">307</span>  // shutdown. Also set by call to stop when debugging or running unit tests<a name="line.307"></a>
+<span class="sourceLineNo">308</span>  // of HRegionServer in isolation.<a name="line.308"></a>
+<span class="sourceLineNo">309</span>  private volatile boolean stopped = false;<a name="line.309"></a>
+<span class="sourceLineNo">310</span><a name="line.310"></a>
+<span class="sourceLineNo">311</span>  // Go down hard. Used if file system becomes unavailable and also in<a name="line.311"></a>
+<span class="sourceLineNo">312</span>  // debugging and unit tests.<a name="line.312"></a>
+<span class="sourceLineNo">313</span>  private volatile boolean abortRequested;<a name="line.313"></a>
+<span class="sourceLineNo">314</span><a name="line.314"></a>
+<span class="sourceLineNo">315</span>  ConcurrentMap&lt;String, Integer&gt; rowlocks = new ConcurrentHashMap&lt;&gt;();<a name="line.315"></a>
+<span class="sourceLineNo">316</span><a name="line.316"></a>
+<span class="sourceLineNo">317</span>  // A state before we go into stopped state.  At this stage we're closing user<a name="line.317"></a>
+<span class="sourceLineNo">318</span>  // space regions.<a name="line.318"></a>
+<span class="sourceLineNo">319</span>  private boolean stopping = false;<a name="line.319"></a>
+<span class="sourceLineNo">320</span><a name="line.320"></a>
+<span class="sourceLineNo">321</span>  volatile boolean killed = false;<a name="line.321"></a>
+<span class="sourceLineNo">322</span><a name="line.322"></a>
+<span class="sourceLineNo">323</span>  protected final Configuration conf;<a name="line.323"></a>
+<span class="sourceLineNo">324</span><a name="line.324"></a>
+<span class="sourceLineNo">325</span>  private Path rootDir;<a name="line.325"></a>
+<span class="sourceLineNo">326</span>  private Path walRootDir;<a name="line.326"></a>
+<span class="sourceLineNo">327</span><a name="line.327"></a>
+<span class="sourceLineNo">328</span>  protected final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();<a name="line.328"></a>
+<span class="sourceLineNo">329</span><a name="line.329"></a>
+<span class="sourceLineNo">330</span>  final int numRetries;<a name="line.330"></a>
+<span class="sourceLineNo">331</span>  protected final int threadWakeFrequency;<a name="line.331"></a>
+<span class="sourceLineNo">332</span>  protected final int msgInterval;<a name="line.332"></a>
+<span class="sourceLineNo">333</span><a name="line.333"></a>
+<span class="sourceLineNo">334</span>  protected final int numRegionsToReport;<a name="line.334"></a>
+<span class="sourceLineNo">335</span><a name="line.335"></a>
+<span class="sourceLineNo">336</span>  // Stub to do region server status calls against the master.<a name="line.336"></a>
+<span class="sourceLineNo">337</span>  private volatile RegionServerStatusService.BlockingInterface rssStub;<a name="line.337"></a>
+<span class="sourceLineNo">338</span>  private volatile LockService.BlockingInterface lockStub;<a name="line.338"></a>
+<span class="sourceLineNo">339</span>  // RPC client. Used to make the stub above that does region server status checking.<a name="line.339"></a>
+<span class="sourceLineNo">340</span>  RpcClient rpcClient;<a name="line.340"></a>
+<span class="sourceLineNo">341</span><a name="line.341"></a>
+<span class="sourceLineNo">342</span>  private RpcRetryingCallerFactory rpcRetryingCallerFactory;<a name="line.342"></a>
+<span class="sourceLineNo">343</span>  private RpcControllerFactory rpcControllerFactory;<a name="line.343"></a>
+<span class="sourceLineNo">344</span><a name="line.344"></a>
+<span class="sourceLineNo">345</span>  private UncaughtExceptionHandler uncaughtExceptionHandler;<a name="line.345"></a>
+<span class="sourceLineNo">346</span><a name="line.346"></a>
+<span class="sourceLineNo">347</span>  // Info server. Default access so can be used by unit tests. REGIONSERVER<a name="line.347"></a>
+<span class="sourceLineNo">348</span>  // is name of the webapp and the attribute name used stuffing this instance<a name="line.348"></a>
+<span class="sourceLineNo">349</span>  // into web context.<a name="line.349"></a>
+<span class="sourceLineNo">350</span>  protected InfoServer infoServer;<a name="line.350"></a>
+<span class="sourceLineNo">351</span>  private JvmPauseMonitor pauseMonitor;<a name="line.351"></a>
+<span class="sourceLineNo">352</span><a name="line.352"></a>
+<span class="sourceLineNo">353</span>  /** region server process name */<a name="line.353"></a>
+<span class="sourceLineNo">354</span>  public static final String REGIONSERVER = "regionserver";<a name="line.354"></a>
+<span class="sourceLineNo">355</span><a name="line.355"></a>
+<span class="sourceLineNo">356</span>  MetricsRegionServer metricsRegionServer;<a name="line.356"></a>
+<span class="sourceLineNo">357</span>  MetricsTable metricsTable;<a name="line.357"></a>
+<span class="sourceLineNo">358</span>  private SpanReceiverHost spanReceiverHost;<a name="line.358"></a>
+<span class="sourceLineNo">359</span><a name="line.359"></a>
+<span class="sourceLineNo">360</span>  /**<a name="line.360"></a>
+<span class="sourceLineNo">361</span>   * ChoreService used to schedule tasks that we want to run periodically<a name="line.361"></a>
+<span class="sourceLineNo">362</span>   */<a name="line.362"></a>
+<span class="sourceLineNo">363</span>  private ChoreService choreService;<a name="line.363"></a>
+<span class="sourceLineNo">364</span><a name="line.364"></a>
+<span class="sourceLineNo">365</span>  /*<a name="line.365"></a>
+<span class="sourceLineNo">366</span>   * Check for compactions requests.<a name="line.366"></a>
+<span class="sourceLineNo">367</span>   */<a name="line.367"></a>
+<span class="sourceLineNo">368</span>  ScheduledChore compactionChecker;<a name="line.368"></a>
+<span class="sourceLineNo">369</span><a name="line.369"></a>
+<span class="sourceLineNo">370</span>  /*<a name="line.370"></a>
+<span class="sourceLineNo">371</span>   * Check for flushes<a name="line.371"></a>
+<span class="sourceLineNo">372</span>   */<a name="line.372"></a>
+<span class="sourceLineNo">373</span>  ScheduledChore periodicFlusher;<a name="line.373"></a>
+<span class="sourceLineNo">374</span><a name="line.374"></a>
+<span class="sourceLineNo">375</span>  protected volatile WALFactory walFactory;<a name="line.375"></a>
+<span class="sourceLineNo">376</span><a name="line.376"></a>
+<span class="sourceLineNo">377</span>  // WAL roller. log is protected rather than private to avoid<a name="line.377"></a>
+<span class="sourceLineNo">378</span>  // eclipse warning when accessed by inner classes<a name="line.378"></a>
+<span class="sourceLineNo">379</span>  protected LogRoller walRoller;<a name="line.379"></a>
+<span class="sourceLineNo">380</span><a name="line.380"></a>
+<span class="sourceLineNo">381</span>  // A thread which calls reportProcedureDone<a name="line.381"></a>
+<span class="sourceLineNo">382</span>  private RemoteProcedureResultReporter procedureResultReporter;<a name="line.382"></a>
+<span class="sourceLineNo">383</span><a name="line.383"></a>
+<span class="sourceLineNo">384</span>  // flag set after we're done setting up server threads<a name="line.384"></a>
+<span class="sourceLineNo">385</span>  final AtomicBoolean online = new AtomicBoolean(false);<a name="line.385"></a>
+<span class="sourceLineNo">386</span><a name="line.386"></a>
+<span class="sourceLineNo">387</span>  // zookeeper connection and watcher<a name="line.387"></a>
+<span class="sourceLineNo">388</span>  protected ZKWatcher zooKeeper;<a name="line.388"></a>
+<span class="sourceLineNo">389</span><a name="line.389"></a>
+<span class="sourceLineNo">390</span>  // master address tracker<a name="line.390"></a>
+<span class="sourceLineNo">391</span>  private MasterAddressTracker masterAddressTracker;<a name="line.391"></a>
+<span class="sourceLineNo">392</span><a name="line.392"></a>
+<span class="sourceLineNo">393</span>  // Cluster Status Tracker<a name="line.393"></a>
+<span class="sourceLineNo">394</span>  protected ClusterStatusTracker clusterStatusTracker;<a name="line.394"></a>
+<span class="sourceLineNo">395</span><a name="line.395"></a>
+<span class="sourceLineNo">396</span>  // Log Splitting Worker<a name="line.396"></a>
+<span class="sourceLineNo">397</span>  private SplitLogWorker splitLogWorker;<a name="line.397"></a>
+<span class="sourceLineNo">398</span><a name="line.398"></a>
+<span class="sourceLineNo">399</span>  // A sleeper that sleeps for msgInterval.<a name="line.399"></a>
+<span class="sourceLineNo">400</span>  protected final Sleeper sleeper;<a name="line.400"></a>
+<span class="sourceLineNo">401</span><a name="line.401"></a>
+<span class="sourceLineNo">402</span>  private final int operationTimeout;<a name="line.402"></a>
+<span class="sourceLineNo">403</span>  private final int shortOperationTimeout;<a name="line.403"></a>
+<span class="sourceLineNo">404</span><a name="line.404"></a>
+<span class="sourceLineNo">405</span>  private final RegionServerAccounting regionServerAccounting;<a name="line.405"></a>
+<span class="sourceLineNo">406</span><a name="line.406"></a>
+<span class="sourceLineNo">407</span>  // Cache configuration and block cache reference<a name="line.407"></a>
+<span class="sourceLineNo">408</span>  protected CacheConfig cacheConfig;<a name="line.408"></a>
+<span class="sourceLineNo">409</span>  // Cache configuration for mob<a name="line.409"></a>
+<span class="sourceLineNo">410</span>  final MobCacheConfig mobCacheConfig;<a name="line.410"></a>
+<span class="sourceLineNo">411</span><a name="line.411"></a>
+<span class="sourceLineNo">412</span>  /** The health check chore. */<a name="line.412"></a>
+<span class="sourceLineNo">413</span>  private HealthCheckChore healthCheckChore;<a name="line.413"></a>
+<span class="sourceLineNo">414</span><a name="line.414"></a>
+<span class="sourceLineNo">415</span>  /** The nonce manager chore. */<a name="line.415"></a>
+<span class="sourceLineNo">416</span>  private ScheduledChore nonceManagerChore;<a name="line.416"></a>
+<span class="sourceLineNo">417</span><a name="line.417"></a>
+<span class="sourceLineNo">418</span>  private Map&lt;String, com.google.protobuf.Service&gt; coprocessorServiceHandlers = Maps.newHashMap();<a name="line.418"></a>
+<span class="sourceLineNo">419</span><a name="line.419"></a>
+<span class="sourceLineNo">420</span>  /**<a name="line.420"></a>
+<span class="sourceLineNo">421</span>   * The server name the Master sees us as.  Its made from the hostname the<a name="line.421"></a>
+<span class="sourceLineNo">422</span>   * master passes us, port, and server startcode. Gets set after registration<a name="line.422"></a>
+<span class="sourceLineNo">423</span>   * against  Master.<a name="line.423"></a>
+<span class="sourceLineNo">424</span>   */<a name="line.424"></a>
+<span class="sourceLineNo">425</span>  protected ServerName serverName;<a name="line.425"></a>
+<span class="sourceLineNo">426</span><a name="line.426"></a>
+<span class="sourceLineNo">427</span>  /*<a name="line.427"></a>
+<span class="sourceLineNo">428</span>   * hostname specified by hostname config<a name="line.428"></a>
+<span class="sourceLineNo">429</span>   */<a name="line.429"></a>
+<span class="sourceLineNo">430</span>  protected String useThisHostnameInstead;<a name="line.430"></a>
+<span class="sourceLineNo">431</span><a name="line.431"></a>
+<span class="sourceLineNo">432</span>  // key to the config parameter of server hostname<a name="line.432"></a>
+<span class="sourceLineNo">433</span>  // the specification of server hostname is optional. The hostname should be resolvable from<a name="line.433"></a>
+<span class="sourceLineNo">434</span>  // both master and region server<a name="line.434"></a>
+<span class="sourceLineNo">435</span>  @InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.CONFIG)<a name="line.435"></a>
+<span class="sourceLineNo">436</span>  final static String RS_HOSTNAME_KEY = "hbase.regionserver.hostname";<a name="line.436"></a>
+<span class="sourceLineNo">437</span>  @InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.CONFIG)<a name="line.437"></a>
+<span class="sourceLineNo">438</span>  protected final static String MASTER_HOSTNAME_KEY = "hbase.master.hostname";<a name="line.438"></a>
+<span class="sourceLineNo">439</span><a name="line.439"></a>
+<span class="sourceLineNo">440</span>  // HBASE-18226: This config and hbase.regionserver.hostname are mutually exclusive.<a name="line.440"></a>
+<span class="sourceLineNo">441</span>  // Exception will be thrown if both are used.<a name="line.441"></a>
+<span class="sourceLineNo">442</span>  final static String RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY =<a name="line.442"></a>
+<span class="sourceLineNo">443</span>    "hbase.regionserver.hostname.disable.master.reversedns";<a name="line.443"></a>
+<span class="sourceLineNo">444</span><a name="line.444"></a>
+<span class="sourceLineNo">445</span>  /**<a name="line.445"></a>
+<span class="sourceLineNo">446</span>   * This servers startcode.<a name="line.446"></a>
+<span class="sourceLineNo">447</span>   */<a name="line.447"></a>
+<span class="sourceLineNo">448</span>  protected final long startcode;<a name="line.448"></a>
+<span class="sourceLineNo">449</span><a name="line.449"></a>
+<span class="sourceLineNo">450</span>  /**<a name="line.450"></a>
+<span class="sourceLineNo">451</span>   * Unique identifier for the cluster we are a part of.<a name="line.451"></a>
+<span class="sourceLineNo">452</span>   */<a name="line.452"></a>
+<span class="sourceLineNo">453</span>  private String clusterId;<a name="line.453"></a>
+<span class="sourceLineNo">454</span><a name="line.454"></a>
+<span class="sourceLineNo">455</span>  /**<a name="line.455"></a>
+<span class="sourceLineNo">456</span>   * MX Bean for RegionServerInfo<a name="line.456"></a>
+<span class="sourceLineNo">457</span>   */<a name="line.457"></a>
+<span class="sourceLineNo">458</span>  private ObjectName mxBean = null;<a name="line.458"></a>
+<span class="sourceLineNo">459</span><a name="line.459"></a>
+<span class="sourceLineNo">460</span>  /**<a name="line.460"></a>
+<span class="sourceLineNo">461</span>   * Chore to clean periodically the moved region list<a name="line.461"></a>
+<span class="sourceLineNo">462</span>   */<a name="line.462"></a>
+<span class="sourceLineNo">463</span>  private MovedRegionsCleaner movedRegionsCleaner;<a name="line.463"></a>
+<span class="sourceLineNo">464</span><a name="line.464"></a>
+<span class="sourceLineNo">465</span>  // chore for refreshing store files for secondary regions<a name="line.465"></a>
+<span class="sourceLineNo">466</span>  private StorefileRefresherChore storefileRefresher;<a name="line.466"></a>
+<span class="sourceLineNo">467</span><a name="line.467"></a>
+<span class="sourceLineNo">468</span>  private RegionServerCoprocessorHost rsHost;<a name="line.468"></a>
+<span class="sourceLineNo">469</span><a name="line.469"></a>
+<span class="sourceLineNo">470</span>  private RegionServerProcedureManagerHost rspmHost;<a name="line.470"></a>
+<span class="sourceLineNo">471</span><a name="line.471"></a>
+<span class="sourceLineNo">472</span>  private RegionServerRpcQuotaManager rsQuotaManager;<a name="line.472"></a>
+<span class="sourceLineNo">473</span>  private RegionServerSpaceQuotaManager rsSpaceQuotaManager;<a name="line.473"></a>
+<span class="sourceLineNo">474</span><a name="line.474"></a>
+<span class="sourceLineNo">475</span>  /**<a name="line.475"></a>
+<span class="sourceLineNo">476</span>   * Nonce manager. Nonces are used to make operations like increment and append idempotent<a name="line.476"></a>
+<span class="sourceLineNo">477</span>   * in the case where client doesn't receive the response from a successful operation and<a name="line.477"></a>
+<span class="sourceLineNo">478</span>   * retries. We track the successful ops for some time via a nonce sent by client and handle<a name="line.478"></a>
+<span class="sourceLineNo">479</span>   * duplicate operations (currently, by failing them; in future we might use MVCC to return<a name="line.479"></a>
+<span class="sourceLineNo">480</span>   * result). Nonces are also recovered from WAL during, recovery; however, the caveats (from<a name="line.480"></a>
+<span class="sourceLineNo">481</span>   * HBASE-3787) are:<a name="line.481"></a>
+<span class="sourceLineNo">482</span>   * - WAL recovery is optimized, and under high load we won't read nearly nonce-timeout worth<a name="line.482"></a>
+<span class="sourceLineNo">483</span>   *   of past records. If we don't read the records, we don't read and recover the nonces.<a name="line.483"></a>
+<span class="sourceLineNo">484</span>   *   Some WALs within nonce-timeout at recovery may not even be present due to rolling/cleanup.<a name="line.484"></a>
+<span class="sourceLineNo">485</span>   * - There's no WAL recovery during normal region move, so nonces will not be transfered.<a name="line.485"></a>
+<span class="sourceLineNo">486</span>   * We can have separate additional "Nonce WAL". It will just contain bunch of numbers and<a name="line.486"></a>
+<span class="sourceLineNo">487</span>   * won't be flushed on main path - because WAL itself also contains nonces, if we only flush<a name="line.487"></a>
+<span class="sourceLineNo">488</span>   * it before memstore flush, for a given nonce we will either see it in the WAL (if it was<a name="line.488"></a>
+<span class="sourceLineNo">489</span>   * never flushed to disk, it will be part of recovery), or we'll see it as part of the nonce<a name="line.489"></a>
+<span class="sourceLineNo">490</span>   * log (or both occasionally, which doesn't matter). Nonce log file can be deleted after the<a name="line.490"></a>
+<span class="sourceLineNo">491</span>   * latest nonce in it expired. It can also be recovered during move.<a name="line.491"></a>
+<span class="sourceLineNo">492</span>   */<a name="line.492"></a>
+<span class="sourceLineNo">493</span>  final ServerNonceManager nonceManager;<a name="line.493"></a>
+<span class="sourceLineNo">494</span><a name="line.494"></a>
+<span class="sourceLineNo">495</span>  private UserProvider userProvider;<a name="line.495"></a>
+<span class="sourceLineNo">496</span><a name="line.496"></a>
+<span class="sourceLineNo">497</span>  protected final RSRpcServices rpcServices;<a name="line.497"></a>
+<span class="sourceLineNo">498</span><a name="line.498"></a>
+<span class="sourceLineNo">499</span>  protected CoordinatedStateManager csm;<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>   * Configuration manager is used to register/deregister and notify the configuration observers<a name="line.502"></a>
+<span class="sourceLineNo">503</span>   * when the regionserver is notified that there was a change in the on disk configs.<a name="line.503"></a>
+<span class="sourceLineNo">504</span>   */<a name="line.504"></a>
+<span class="sourceLineNo">505</span>  protected final ConfigurationManager configurationManager;<a name="line.505"></a>
+<span class="sourceLineNo">506</span><a name="line.506"></a>
+<span class="sourceLineNo">507</span>  @VisibleForTesting<a name="line.507"></a>
+<span class="sourceLineNo">508</span>  CompactedHFilesDischarger compactedFileDischarger;<a name="line.508"></a>
+<span class="sourceLineNo">509</span><a name="line.509"></a>
+<span class="sourceLineNo">510</span>  private volatile ThroughputController flushThroughputController;<a name="line.510"></a>
+<span class="sourceLineNo">511</span><a name="line.511"></a>
+<span class="sourceLineNo">512</span>  protected SecureBulkLoadManager secureBulkLoadManager;<a name="line.512"></a>
+<span class="sourceLineNo">513</span><a name="line.513"></a>
+<span class="sourceLineNo">514</span>  protected FileSystemUtilizationChore fsUtilizationChore;<a name="line.514"></a>
+<span class="sourceLineNo">515</span><a name="line.515"></a>
+<span class="sourceLineNo">516</span>  private final NettyEventLoopGroupConfig eventLoopGroupConfig;<a name="line.516"></a>
+<span class="sourceLineNo">517</span><a name="line.517"></a>
+<span class="sourceLineNo">518</span>  /**<a name="line.518"></a>
+<span class="sourceLineNo">519</span>   * True if this RegionServer is coming up in a cluster where there is no Master;<a name="line.519"></a>
+<span class="sourceLineNo">520</span>   * means it needs to just come up and make do without a Master to talk to: e.g. in test or<a name="line.520"></a>
+<span class="sourceLineNo">521</span>   * HRegionServer is doing other than its usual duties: e.g. as an hollowed-out host whose only<a name="line.521"></a>
+<span class="sourceLineNo">522</span>   * purpose is as a Replication-stream sink; see HBASE-18846 for more.<a name="line.522"></a>
+<span class="sourceLineNo">523</span>   */<a name="line.523"></a>
+<span class="sourceLineNo">524</span>  private final boolean masterless;<a name="line.524"></a>
+<span class="sourceLineNo">525</span>  static final String MASTERLESS_CONFIG_NAME = "hbase.masterless";<a name="line.525"></a>
+<span class="sourceLineNo">526</span><a name="line.526"></a>
 <span class="sourceLineNo">527</span><a name="line.527"></a>
-<span class="sourceLineNo">528</span><a name="line.528"></a>
-<span class="sourceLineNo">529</span>  /**<a name="line.529"></a>
-<span class="sourceLineNo">530</span>   * Starts a HRegionServer at the default location<a name="line.530"></a>
-<span class="sourceLineNo">531</span>   */<a name="line.531"></a>
-<span class="sourceLineNo">532</span>  // Don't start any services or managers in here in the Constructor.<a name="line.532"></a>
-<span class="sourceLineNo">533</span>  // Defer till after we register with the Master as much as possible. See #startServices.<a name="line.533"></a>
-<span class="sourceLineNo">534</span>  public HRegionServer(Configuration conf) throws IOException {<a name="line.534"></a>
-<span class="sourceLineNo">535</span>    super("RegionServer");  // thread name<a name="line.535"></a>
-<span class="sourceLineNo">536</span>    TraceUtil.initTracer(conf);<a name="line.536"></a>
-<span class="sourceLineNo">537</span>    try {<a name="line.537"></a>
-<span class="sourceLineNo">538</span>      this.startcode = System.currentTimeMillis();<a name="line.538"></a>
-<span class="sourceLineNo">539</span>      this.conf = conf;<a name="line.539"></a>
-<span class="sourceLineNo">540</span>      this.fsOk = true;<a name="line.540"></a>
-<span class="sourceLineNo">541</span>      this.masterless = conf.getBoolean(MASTERLESS_CONFIG_NAME, false);<a name="line.541"></a>
-<span class="sourceLineNo">542</span>      this.eventLoopGroupConfig = setupNetty(this.conf);<a name="line.542"></a>
-<span class="sourceLineNo">543</span>      MemorySizeUtil.checkForClusterFreeHeapMemoryLimit(this.conf);<a name="line.543"></a>
-<span class="sourceLineNo">544</span>      HFile.checkHFileVersion(this.conf);<a name="line.544"></a>
-<span class="sourceLineNo">545</span>      checkCodecs(this.conf);<a name="line.545"></a>
-<span class="sourceLineNo">546</span>      this.userProvider = UserProvider.instantiate(conf);<a name="line.546"></a>
-<span class="sourceLineNo">547</span>      FSUtils.setupShortCircuitRead(this.conf);<a name="line.547"></a>
-<span class="sourceLineNo">548</span>      Replication.decorateRegionServerConfiguration(this.conf);<a name="line.548"></a>
-<span class="sourceLineNo">549</span><a name="line.549"></a>
-<span class="sourceLineNo">550</span>      // Disable usage of meta replicas in the regionserver<a name="line.550"></a>
-<span class="sourceLineNo">551</span>      this.conf.setBoolean(HConstants.USE_META_REPLICAS, false);<a name="line.551"></a>
-<span class="sourceLineNo">552</span>      // Config'ed params<a name="line.552"></a>
-<span class="sourceLineNo">553</span>      this.numRetries = this.conf.getInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER,<a name="line.553"></a>
-<span class="sourceLineNo">554</span>          HConstants.DEFAULT_HBASE_CLIENT_RETRIES_NUMBER);<a name="line.554"></a>
-<span class="sourceLineNo">555</span>      this.threadWakeFrequency = conf.getInt(HConstants.THREAD_WAKE_FREQUENCY, 10 * 1000);<a name="line.555"></a>
-<span class="sourceLineNo">556</span>      this.msgInterval = conf.getInt("hbase.regionserver.msginterval", 3 * 1000);<a name="line.556"></a>
-<span class="sourceLineNo">557</span><a name="line.557"></a>
-<span class="sourceLineNo">558</span>      this.sleeper = new Sleeper(this.msgInterval, this);<a name="line.558"></a>
-<span class="sourceLineNo">559</span><a name="line.559"></a>
-<span class="sourceLineNo">560</span>      boolean isNoncesEnabled = conf.getBoolean(HConstants.HBASE_RS_NONCES_ENABLED, true);<a name="line.560"></a>
-<span class="sourceLineNo">561</span>      this.nonceManager = isNoncesEnabled ? new ServerNonceManager(this.conf) : null;<a name="line.561"></a>
-<span class="sourceLineNo">562</span><a name="line.562"></a>
-<span class="sourceLineNo">563</span>      this.numRegionsToReport = conf.getInt("hbase.regionserver.numregionstoreport", 10);<a name="line.563"></a>
-<span class="sourceLineNo">564</span><a name="line.564"></a>
-<span class="sourceLineNo">565</span>      this.operationTimeout = conf.getInt(HConstants.HBASE_CLIENT_OPERATION_TIMEOUT,<a name="line.565"></a>
-<span class="sourceLineNo">566</span>          HConstants.DEFAULT_HBASE_CLIENT_OPERATION_TIMEOUT);<a name="line.566"></a>
-<span class="sourceLineNo">567</span><a name="line.567"></a>
-<span class="sourceLineNo">568</span>      this.shortOperationTimeout = conf.getInt(HConstants.HBASE_RPC_SHORTOPERATION_TIMEOUT_KEY,<a name="line.568"></a>
-<span class="sourceLineNo">569</span>          HConstants.DEFAULT_HBASE_RPC_SHORTOPERATION_TIMEOUT);<a name="line.569"></a>
-<span class="sourceLineNo">570</span><a name="line.570"></a>
-<span class="sourceLineNo">571</span>      this.abortRequested = false;<a name="line.571"></a>
-<span class="sourceLineNo">572</span>      this.stopped = false;<a name="line.572"></a>
-<span class="sourceLineNo">573</span><a name="line.573"></a>
-<span class="sourceLineNo">574</span>      rpcServices = createRpcServices();<a name="line.574"></a>
-<span class="sourceLineNo">575</span>      if (this instanceof HMaster) {<a name="line.575"></a>
-<span class="sourceLineNo">576</span>        useThisHostnameInstead = conf.get(MASTER_HOSTNAME_KEY);<a name="line.576"></a>
-<span class="sourceLineNo">577</span>      } else {<a name="line.577"></a>
-<span class="sourceLineNo">578</span>        useThisHostnameInstead = conf.get(RS_HOSTNAME_KEY);<a name="line.578"></a>
-<span class="sourceLineNo">579</span>        if (conf.getBoolean(RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY, false)) {<a name="line.579"></a>
-<span class="sourceLineNo">580</span>          if (shouldUseThisHostnameInstead()) {<a name="line.580"></a>
-<span class="sourceLineNo">581</span>            String msg = RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY + " and " + RS_HOSTNAME_KEY +<a name="line.581"></a>
-<span class="sourceLineNo">582</span>                " are mutually exclusive. Do not set " + RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY +<a name="line.582"></a>
-<span class="sourceLineNo">583</span>                " to true while " + RS_HOSTNAME_KEY + " is used";<a name="line.583"></a>
-<span class="sourceLineNo">584</span>            throw new IOException(msg);<a name="line.584"></a>
-<span class="sourceLineNo">585</span>          } else {<a name="line.585"></a>
-<span class="sourceLineNo">586</span>            useThisHostnameInstead = rpcServices.isa.getHostName();<a name="line.586"></a>
-<span class="sourceLineNo">587</span>          }<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>      String hostName = shouldUseThisHostnameInstead() ?<a name="line.590"></a>
-<span class="sourceLineNo">591</span>          this.useThisHostnameInstead : this.rpcServices.isa.getHostName();<a name="line.591"></a>
-<span class="sourceLineNo">592</span>      serverName = ServerName.valueOf(hostName, this.rpcServices.isa.getPort(), this.startcode);<a name="line.592"></a>
-<span class="sourceLineNo">593</span><a name="line.593"></a>
-<span class="sourceLineNo">594</span>      rpcControllerFactory = RpcControllerFactory.instantiate(this.conf);<a name="line.594"></a>
-<span class="sourceLineNo">595</span>      rpcRetryingCallerFactory = RpcRetryingCallerFactory.instantiate(this.conf);<a name="line.595"></a>
-<span class="sourceLineNo">596</span><a name="line.596"></a>
-<span class="sourceLineNo">597</span>      // login the zookeeper client principal (if using security)<a name="line.597"></a>
-<span class="sourceLineNo">598</span>      ZKUtil.loginClient(this.conf, HConstants.ZK_CLIENT_KEYTAB_FILE,<a name="line.598"></a>
-<span class="sourceLineNo">599</span>          HConstants.ZK_CLIENT_KERBEROS_PRINCIPAL, hostName);<a name="line.599"></a>
-<span class="sourceLineNo">600</span>      // login the server principal (if using secure Hadoop)<a name="line.600"></a>
-<span class="sourceLineNo">601</span>      login(userProvider, hostName);<a name="line.601"></a>
-<span class="sourceLineNo">602</span>      // init superusers and add the server principal (if using security)<a name="line.602"></a>
-<span class="sourceLineNo">603</span>      // or process owner as default super user.<a name="line.603"></a>
-<span class="sourceLineNo">604</span>      Superusers.initialize(conf);<a name="line.604"></a>
-<span class="sourceLineNo">605</span><a name="line.605"></a>
-<span class="sourceLineNo">606</span>      regionServerAccounting = new RegionServerAccounting(conf);<a name="line.606"></a>
-<span class="sourceLineNo">607</span>      cacheConfig = new CacheConfig(conf);<a name="line.607"></a>
-<span class="sourceLineNo">608</span>      mobCacheConfig = new MobCacheConfig(conf);<a name="line.608"></a>
-<span class="sourceLineNo">609</span>      uncaughtExceptionHandler = new UncaughtExceptionHandler() {<a name="line.609"></a>
-<span class="sourceLineNo">610</span>        @Override<a name="line.610"></a>
-<span class="sourceLineNo">611</span>        public void uncaughtException(Thread t, Throwable e) {<a name="line.611"></a>
-<span class="sourceLineNo">612</span>          abort("Uncaught exception in executorService thread " + t.getName(), e);<a name="line.612"></a>
-<span class="sourceLineNo">613</span>        }<a name="line.613"></a>
-<span class="sourceLineNo">614</span>      };<a name="line.614"></a>
-<span class="sourceLineNo">615</span><a name="line.615"></a>
-<span class="sourceLineNo">616</span>      initializeFileSystem();<a name="line.616"></a>
-<span class="sourceLineNo">617</span>      spanReceiverHost = SpanReceiverHost.getInstance(getConfiguration());<a name="line.617"></a>
-<span class="sourceLineNo">618</span><a name="line.618"></a>
-<span class="sourceLineNo">619</span>      this.configurationManager = new ConfigurationManager();<a name="line.619"></a>
-<span class="sourceLineNo">620</span>      setupWindows(getConfiguration(), getConfigurationManager());<a name="line.620"></a>
-<span class="sourceLineNo">621</span><a name="line.621"></a>
-<span class="sourceLineNo">622</span>      // Some unit tests don't need a cluster, so no zookeeper at all<a name="line.622"></a>
-<span class="sourceLineNo">623</span>      if (!conf.getBoolean("hbase.testing.nocluster", false)) {<a name="line.623"></a>
-<span class="sourceLineNo">624</span>        // Open connection to zookeeper and set primary watcher<a name="line.624"></a>
-<span class="sourceLineNo">625</span>        zooKeeper = new ZKWatcher(conf, getProcessName() + ":" +<a name="line.625"></a>
-<span class="sourceLineNo">626</span>          rpcServices.isa.getPort(), this, canCreateBaseZNode());<a name="line.626"></a>
-<span class="sourceLineNo">627</span><a name="line.627"></a>
-<span class="sourceLineNo">628</span>        // If no master in cluster, skip trying to track one or look for a cluster status.<a name="line.628"></a>
-<span class="sourceLineNo">629</span>        if (!this.masterless) {<a name="line.629"></a>
-<span class="sourceLineNo">630</span>          this.csm = new ZkCoordinatedStateManager(this);<a name="line.630"></a>
-<span class="sourceLineNo">631</span><a name="line.631"></a>
-<span class="sourceLineNo">632</span>          masterAddressTracker = new MasterAddressTracker(getZooKeeper(), this);<a name="line.632"></a>
-<span class="sourceLineNo">633</span>          masterAddressTracker.start();<a name="line.633"></a>
-<span class="sourceLineNo">634</span><a name="line.634"></a>
-<span class="sourceLineNo">635</span>          clusterStatusTracker = new ClusterStatusTracker(zooKeeper, this);<a name="line.635"></a>
-<span class="sourceLineNo">636</span>          clusterStatusTracker.start();<a name="line.636"></a>
-<span class="sourceLineNo">637</span>        }<a name="line.637"></a>
-<span class="sourceLineNo">638</span>      }<a name="line.638"></a>
-<span class="sourceLineNo">639</span>      // This violates 'no starting stuff in Constructor' but Master depends on the below chore<a name="line.639"></a>
-<span class="sourceLineNo">640</span>      // and executor being created and takes a different startup route. Lots of overlap between HRS<a name="line.640"></a>
-<span class="sourceLineNo">641</span>      // and M (An M IS A HRS now). Need to refactor so less duplication between M and its super<a name="line.641"></a>
-<span class="sourceLineNo">642</span>      // Master expects Constructor to put up web servers. Ugh.<a name="line.642"></a>
-<span class="sourceLineNo">643</span>      // class HRS. TODO.<a name="line.643"></a>
-<span class="sourceLineNo">644</span>      this.choreService = new ChoreService(getServerName().toString(), true);<a name="line.644"></a>
-<span class="sourceLineNo">645</span>      this.executorService = new ExecutorService(getServerName().toShortString());<a name="line.645"></a>
-<span class="sourceLineNo">646</span>      this.rpcServices.start();<a name="line.646"></a>
-<span class="sourceLineNo">647</span>      putUpWebUI();<a name="line.647"></a>
-<span class="sourceLineNo">648</span>    } catch (Throwable t) {<a name="line.648"></a>
-<span class="sourceLineNo">649</span>      // Make sure we log the exception. HRegionServer is often started via reflection and the<a name="line.649"></a>
-<span class="sourceLineNo">650</span>      // cause of failed startup is lost.<a name="line.650"></a>
-<span class="sourceLineNo">651</span>      LOG.error("Failed construction RegionServer", t);<a name="line.651"></a>
-<span class="sourceLineNo">652</span>      throw t;<a name="line.652"></a>
-<span class="sourceLineNo">653</span>    }<a name="line.653"></a>
-<span class="sourceLineNo">654</span>  }<a name="line.654"></a>
-<span class="sourceLineNo">655</span><a name="line.655"></a>
-<span class="sourceLineNo">656</span>  /**<a name="line.656"></a>
-<span class="sourceLineNo">657</span>   * If running on Windows, do windows-specific setup.<a name="line.657"></a>
-<span class="sourceLineNo">658</span>   */<a name="line.658"></a>
-<span class="sourceLineNo">659</span>  private static void setupWindows(final Configuration conf, ConfigurationManager cm) {<a name="line.659"></a>
-<span class="sourceLineNo">660</span>    if (!SystemUtils.IS_OS_WINDOWS) {<a name="line.660"></a>
-<span class="sourceLineNo">661</span>      Signal.handle(new Signal("HUP"), new SignalHandler() {<a name="line.661"></a>
-<span class="sourceLineNo">662</span>        @Override<a name="line.662"></a>
-<span class="sourceLineNo">663</span>        public void handle(Signal signal) {<a name="line.663"></a>
-<span class="sourceLineNo">664</span>          conf.reloadConfiguration();<a name="line.664"></a>
-<span class="sourceLineNo">665</span>          cm.notifyAllObservers(conf);<a name="line.665"></a>
-<span class="sourceLineNo">666</span>        }<a name="line.666"></a>
-<span class="sourceLineNo">667</span>      });<a name="line.667"></a>
-<span class="sourceLineNo">668</span>    }<a name="line.668"></a>
-<span class="sourceLineNo">669</span>  }<a name="line.669"></a>
-<span class="sourceLineNo">670</span><a name="line.670"></a>
-<span class="sourceLineNo">671</span>  private static NettyEventLoopGroupConfig setupNetty(Configuration conf) {<a name="line.671"></a>
-<span class="sourceLineNo">672</span>    // Initialize netty event loop group at start as we may use it for rpc server, rpc client &amp; WAL.<a name="line.672"></a>
-<span class="sourceLineNo">673</span>    NettyEventLoopGroupConfig nelgc =<a name="line.673"></a>
-<span class="sourceLineNo">674</span>      new NettyEventLoopGroupConfig(conf, "RS-EventLoopGroup");<a name="line.674"></a>
-<span class="sourceLineNo">675</span>    NettyRpcClientConfigHelper.setEventLoopConfig(conf, nelgc.group(), nelgc.clientChannelClass());<a name="line.675"></a>
-<span class="sourceLineNo">676</span>    NettyAsyncFSWALConfigHelper.setEventLoopConfig(conf, nelgc.group(), nelgc.clientChannelClass());<a name="line.676"></a>
-<span class="sourceLineNo">677</span>    return nelgc;<a name="line.677"></a>
-<span class="sourceLineNo">678</span>  }<a name="line.678"></a>
-<span class="sourceLineNo">679</span><a name="line.679"></a>
-<span class="sourceLineNo">680</span>  private void initializeFileSystem() throws IOException {<a name="line.680"></a>
-<span class="sourceLineNo">681</span>    // Get fs instance used by this RS.  Do we use checksum verification in the hbase? If hbase<a name="line.681"></a>
-<span class="sourceLineNo">682</span>    // checksum verification enabled, then automatically switch off hdfs checksum verification.<a name="line.682"></a>
-<span class="sourceLineNo">683</span>    boolean useHBaseChecksum = conf.getBoolean(HConstants.HBASE_CHECKSUM_VERIFICATION, true);<a name="line.683"></a>
-<span class="sourceLineNo">684</span>    FSUtils.setFsDefault(this.conf, FSUtils.getWALRootDir(this.conf));<a name="line.684"></a>
-<span class="sourceLineNo">685</span>    this.walFs = new HFileSystem(this.conf, useHBaseChecksum);<a name="line.685"></a>
-<span class="sourceLineNo">686</span>    this.walRootDir = FSUtils.getWALRootDir(this.conf);<a name="line.686"></a>
-<span class="sourceLineNo">687</span>    // Set 'fs.defaultFS' to match the filesystem on hbase.rootdir else<a name="line.687"></a>
-<span class="sourceLineNo">688</span>    // underlying hadoop hdfs accessors will be going against wrong filesystem<a name="line.688"></a>
-<span class="sourceLineNo">689</span>    // (unless all is set to defaults).<a name="line.689"></a>
-<span class="sourceLineNo">690</span>    FSUtils.setFsDefault(this.conf, FSUtils.getRootDir(this.conf));<a name="line.690"></a>
-<span class="sourceLineNo">691</span>    this.fs = new HFileSystem(this.conf, useHBaseChecksum);<a name="line.691"></a>
-<span class="sourceLineNo">692</span>    this.rootDir = FSUtils.getRootDir(this.conf);<a name="line.692"></a>
-<span class="sourceLineNo">693</span>    this.tableDescriptors = getFsTableDescriptors();<a name="line.693"></a>
-<span class="sourceLineNo">694</span>  }<a name="line.694"></a>
-<span class="sourceLineNo">695</span><a name="line.695"></a>
-<span class="sourceLineNo">696</span>  protected TableDescriptors getFsTableDescriptors() throws IOException {<a name="line.696"></a>
-<span class="sourceLineNo">697</span>    return new FSTableDescriptors(this.conf,<a name="line.697"></a>
-<span class="sourceLineNo">698</span>      this.fs, this.rootDir, !canUpdateTableDescriptor(), false, getMetaTableObserver());<a name="line.698"></a>
-<span class="sourceLineNo">699</span>  }<a name="line.699"></a>
-<span class="sourceLineNo">700</span><a name="line.700"></a>
-<span class="sourceLineNo">701</span>  protected Function&lt;TableDescriptorBuilder, TableDescriptorBuilder&gt; getMetaTableObserver() {<a name="line.701"></a>
-<span class="sourceLineNo">702</span>    return null;<a name="line.702"></a>
-<span class="sourceLineNo">703</span>  }<a name="line.703"></a>
-<span class="sourceLineNo">704</span><a name="line.704"></a>
-<span class="sourceLineNo">705</span>  protected void setInitLatch(CountDownLatch latch) {<a name="line.705"></a>
-<span class="sourceLineNo">706</span>    this.initLatch = latch;<a name="line.706"></a>
-<span class="sourceLineNo">707</span>  }<a name="line.707"></a>
-<span class="sourceLineNo">708</span><a name="line.708"></a>
-<span class="sourceLineNo">709</span>  /*<a name="line.709"></a>
-<span class="sourceLineNo">710</span>   * Returns true if configured hostname should be used<a name="line.710"></a>
-<span class="sourceLineNo">711</span>   */<a name="line.711"></a>
-<span class="sourceLineNo">712</span>  protected boolean shouldUseThisHostnameInstead() {<a name="line.712"></a>
-<span class="sourceLineNo">713</span>    return useThisHostnameInstead != null &amp;&amp; !useThisHostnameInstead.isEmpty();<a name="line.713"></a>
+<span class="sourceLineNo">528</span>  /**<a name="line.528"></a>
+<span class="sourceLineNo">529</span>   * Starts a HRegionServer at the default location<a name="line.529"></a>
+<span class="sourceLineNo">530</span>   */<a name="line.530"></a>
+<span class="sourceLineNo">531</span>  // Don't start any services or managers in here in the Constructor.<a name="line.531"></a>
+<span class="sourceLineNo">532</span>  // Defer till after we register with the Master as much as possible. See #startServices.<a name="line.532"></a>
+<span class="sourceLineNo">533</span>  public HRegionServer(Configuration conf) throws IOException {<a name="line.533"></a>
+<span class="sourceLineNo">534</span>    super("RegionServer");  // thread name<a name="line.534"></a>
+<span class="sourceLineNo">535</span>    TraceUtil.initTracer(conf);<a name="line.535"></a>
+<span class="sourceLineNo">536</span>    try {<a name="line.536"></a>
+<span class="sourceLineNo">537</span>      this.startcode = System.currentTimeMillis();<a name="line.537"></a>
+<span class="sourceLineNo">538</span>      this.conf = conf;<a name="line.538"></a>
+<span class="sourceLineNo">539</span>      this.fsOk = true;<a name="line.539"></a>
+<span class="sourceLineNo">540</span>      this.masterless = conf.getBoolean(MASTERLESS_CONFIG_NAME, false);<a name="line.540"></a>
+<span class="sourceLineNo">541</span>      this.eventLoopGroupConfig = setupNetty(this.conf);<a name="line.541"></a>
+<span class="sourceLineNo">542</span>      MemorySizeUtil.checkForClusterFreeHeapMemoryLimit(this.conf);<a name="line.542"></a>
+<span class="sourceLineNo">543</span>      HFile.checkHFileVersion(this.conf);<a name="line.543"></a>
+<span class="sourceLineNo">544</span>      checkCodecs(this.conf);<a name="line.544"></a>
+<span class="sourceLineNo">545</span>      this.userProvider = UserProvider.instantiate(conf);<a name="line.545"></a>
+<span class="sourceLineNo">546</span>      FSUtils.setupShortCircuitRead(this.conf);<a name="line.546"></a>
+<span class="sourceLineNo">547</span>      Replication.decorateRegionServerConfiguration(this.conf);<a name="line.547"></a>
+<span class="sourceLineNo">548</span><a name="line.548"></a>
+<span class="sourceLineNo">549</span>      // Disable usage of meta replicas in the regionserver<a name="line.549"></a>
+<span class="sourceLineNo">550</span>      this.conf.setBoolean(HConstants.USE_META_REPLICAS, false);<a name="line.550"></a>
+<span class="sourceLineNo">551</span>      // Config'ed params<a name="line.551"></a>
+<span class="sourceLineNo">552</span>      this.numRetries = this.conf.getInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER,<a name="line.552"></a>
+<span class="sourceLineNo">553</span>          HConstants.DEFAULT_HBASE_CLIENT_RETRIES_NUMBER);<a name="line.553"></a>
+<span class="sourceLineNo">554</span>      this.threadWakeFrequency = conf.getInt(HConstants.THREAD_WAKE_FREQUENCY, 10 * 1000);<a name="line.554"></a>
+<span class="sourceLineNo">555</span>      this.msgInterval = conf.getInt("hbase.regionserver.msginterval", 3 * 1000);<a name="line.555"></a>
+<span class="sourceLineNo">556</span><a name="line.556"></a>
+<span class="sourceLineNo">557</span>      this.sleeper = new Sleeper(this.msgInterval, this);<a name="line.557"></a>
+<span class="sourceLineNo">558</span><a name="line.558"></a>
+<span class="sourceLineNo">559</span>      boolean isNoncesEnabled = conf.getBoolean(HConstants.HBASE_RS_NONCES_ENABLED, true);<a name="line.559"></a>
+<span class="sourceLineNo">560</span>      this.nonceManager = isNoncesEnabled ? new ServerNonceManager(this.conf) : null;<a name="line.560"></a>
+<span class="sourceLineNo">561</span><a name="line.561"></a>
+<span class="sourceLineNo">562</span>      this.numRegionsToReport = conf.getInt("hbase.regionserver.numregionstoreport", 10);<a name="line.562"></a>
+<span class="sourceLineNo">563</span><a name="line.563"></a>
+<span class="sourceLineNo">564</span>      this.operationTimeout = conf.getInt(HConstants.HBASE_CLIENT_OPERATION_TIMEOUT,<a name="line.564"></a>
+<span class="sourceLineNo">565</span>          HConstants.DEFAULT_HBASE_CLIENT_OPERATION_TIMEOUT);<a name="line.565"></a>
+<span class="sourceLineNo">566</span><a name="line.566"></a>
+<span class="sourceLineNo">567</span>      this.shortOperationTimeout = conf.getInt(HConstants.HBASE_RPC_SHORTOPERATION_TIMEOUT_KEY,<a name="line.567"></a>
+<span class="sourceLineNo">568</span>          HConstants.DEFAULT_HBASE_RPC_SHORTOPERATION_TIMEOUT);<a name="line.568"></a>
+<span class="sourceLineNo">569</span><a name="line.569"></a>
+<span class="sourceLineNo">570</span>      this.abortRequested = false;<a name="line.570"></a>
+<span class="sourceLineNo">571</span>      this.stopped = false;<a name="line.571"></a>
+<span class="sourceLineNo">572</span><a name="line.572"></a>
+<span class="sourceLineNo">573</span>      rpcServices = createRpcServices();<a name="line.573"></a>
+<span class="sourceLineNo">574</span>      if (this instanceof HMaster) {<a name="line.574"></a>
+<span class="sourceLineNo">575</span>        useThisHostnameInstead = conf.get(MASTER_HOSTNAME_KEY);<a name="line.575"></a>
+<span class="sourceLineNo">576</span>      } else {<a name="line.576"></a>
+<span class="sourceLineNo">577</span>        useThisHostnameInstead = conf.get(RS_HOSTNAME_KEY);<a name="line.577"></a>
+<span class="sourceLineNo">578</span>        if (conf.getBoolean(RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY, false)) {<a name="line.578"></a>
+<span class="sourceLineNo">579</span>          if (shouldUseThisHostnameInstead()) {<a name="line.579"></a>
+<span class="sourceLineNo">580</span>            String msg = RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY + " and " + RS_HOSTNAME_KEY +<a name="line.580"></a>
+<span class="sourceLineNo">581</span>                " are mutually exclusive. Do not set " + RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY +<a name="line.581"></a>
+<span class="sourceLineNo">582</span>                " to true while " + RS_HOSTNAME_KEY + " is used";<a name="line.582"></a>
+<span class="sourceLineNo">583</span>            throw new IOException(msg);<a name="line.583"></a>
+<span class="sourceLineNo">584</span>          } else {<a name="line.584"></a>
+<span class="sourceLineNo">585</span>            useThisHostnameInstead = rpcServices.isa.getHostName();<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>      }<a name="line.588"></a>
+<span class="sourceLineNo">589</span>      String hostName = shouldUseThisHostnameInstead() ?<a name="line.589"></a>
+<span class="sourceLineNo">590</span>          this.useThisHostnameInstead : this.rpcServices.isa.getHostName();<a name="line.590"></a>
+<span class="sourceLineNo">591</span>      serverName = ServerName.valueOf(hostName, this.rpcServices.isa.getPort(), this.startcode);<a name="line.591"></a>
+<span class="sourceLineNo">592</span><a name="line.592"></a>
+<span class="sourceLineNo">593</span>      rpcControllerFactory = RpcControllerFactory.instantiate(this.conf);<a name="line.593"></a>
+<span class="sourceLineNo">594</span>      rpcRetryingCallerFactory = RpcRetryingCallerFactory.instantiate(this.conf);<a name="line.594"></a>
+<span class="sourceLineNo">595</span><a name="line.595"></a>
+<span class="sourceLineNo">596</span>      // login the zookeeper client principal (if using security)<a name="line.596"></a>
+<span class="sourceLineNo">597</span>      ZKUtil.loginClient(this.conf, HConstants.ZK_CLIENT_KEYTAB_FILE,<a name="line.597"></a>
+<span class="sourceLineNo">598</span>          HConstants.ZK_CLIENT_KERBEROS_PRINCIPAL, hostName);<a name="line.598"></a>
+<span class="sourceLineNo">599</span>      // login the server principal (if using secure Hadoop)<a name="line.599"></a>
+<span class="sourceLineNo">600</span>      login(userProvider, hostName);<a name="line.600"></a>
+<span class="sourceLineNo">601</span>      // init superusers and add the server principal (if using security)<a name="line.601"></a>
+<span class="sourceLineNo">602</span>      // or process owner as default super user.<a name="line.602"></a>
+<span class="sourceLineNo">603</span>      Superusers.initialize(conf);<a name="line.603"></a>
+<span class="sourceLineNo">604</span><a name="line.604"></a>
+<span class="sourceLineNo">605</span>      regionServerAccounting = new RegionServerAccounting(conf);<a name="line.605"></a>
+<span class="sourceLineNo">606</span>      cacheConfig = new CacheConfig(conf);<a name="line.606"></a>
+<span class="sourceLineNo">607</span>      mobCacheConfig = new MobCacheConfig(conf);<a name="line.607"></a>
+<span class="sourceLineNo">608</span>      uncaughtExceptionHandler = new UncaughtExceptionHandler() {<a name="line.608"></a>
+<span class="sourceLineNo">609</span>        @Override<a name="line.609"></a>
+<span class="sourceLineNo">610</span>        public void uncaughtException(Thread t, Throwable e) {<a name="line.610"></a>
+<span class="sourceLineNo">611</span>          abort("Uncaught exception in executorService thread " + t.getName(), e);<a name="line.611"></a>
+<span class="sourceLineNo">612</span>        }<a name="line.612"></a>
+<span class="sourceLineNo">613</span>      };<a name="line.613"></a>
+<span class="sourceLineNo">614</span><a name="line.614"></a>
+<span class="sourceLineNo">615</span>      initializeFileSystem();<a name="line.615"></a>
+<span class="sourceLineNo">616</span>      spanReceiverHost = SpanReceiverHost.getInstance(getConfiguration());<a name="line.616"></a>
+<span class="sourceLineNo">617</span><a name="line.617"></a>
+<span class="sourceLineNo">618</span>      this.configurationManager = new ConfigurationManager();<a name="line.618"></a>
+<span class="sourceLineNo">619</span>      setupWindows(getConfiguration(), getConfigurationManager());<a name="line.619"></a>
+<span class="sourceLineNo">620</span><a name="line.620"></a>
+<span class="sourceLineNo">621</span>      // Some unit tests don't need a cluster, so no zookeeper at all<a name="line.621"></a>
+<span class="sourceLineNo">622</span>      if (!conf.getBoolean("hbase.testing.nocluster", false)) {<a name="line.622"></a>
+<span class="sourceLineNo">623</span>        // Open connection to zookeeper and set primary watcher<a name="line.623"></a>
+<span class="sourceLineNo">624</span>        zooKeeper = new ZKWatcher(conf, getProcessName() + ":" +<a name="line.624"></a>
+<span class="sourceLineNo">625</span>          rpcServices.isa.getPort(), this, canCreateBaseZNode());<a name="line.625"></a>
+<span class="sourceLineNo">626</span><a name="line.626"></a>
+<span class="sourceLineNo">627</span>        // If no master in cluster, skip trying to track one or look for a cluster status.<a name="line.627"></a>
+<span class="sourceLineNo">628</span>        if (!this.masterless) {<a name="line.628"></a>
+<span class="sourceLineNo">629</span>          this.csm = new ZkCoordinatedStateManager(this);<a name="line.629"></a>
+<span class="sourceLineNo">630</span><a name="line.630"></a>
+<span class="sourceLineNo">631</span>          masterAddressTracker = new MasterAddressTracker(getZooKeeper(), this);<a name="line.631"></a>
+<span class="sourceLineNo">632</span>          masterAddressTracker.start();<a name="line.632"></a>
+<span class="sourceLineNo">633</span><a name="line.633"></a>
+<span class="sourceLineNo">634</span>          clusterStatusTracker = new ClusterStatusTracker(zooKeeper, this);<a name="line.634"></a>
+<span class="sourceLineNo">635</span>          clusterStatusTracker.start();<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>      // This violates 'no starting stuff in Constructor' but Master depends on the below chore<a name="line.638"></a>
+<span class="sourceLineNo">639</span>      // and executor being created and takes a different startup route. Lots of overlap between HRS<a name="line.639"></a>
+<span class="sourceLineNo">640</span>      // and M (An M IS A HRS now). Need to refactor so less duplication between M and its super<a name="line.640"></a>
+<span class="sourceLineNo">641</span>      // Master expects Constructor to put up web servers. Ugh.<a name="line.641"></a>
+<span class="sourceLineNo">642</span>      // class HRS. TODO.<a name="line.642"></a>
+<span class="sourceLineNo">643</span>      this.choreService = new ChoreService(getServerName().toString(), true);<a name="line.643"></a>
+<span class="sourceLineNo">644</span>      this.executorService = new ExecutorService(getServerName().toShortString());<a name="line.644"></a>
+<span class="sourceLineNo">645</span>      this.rpcServices.start();<a name="line.645"></a>
+<span class="sourceLineNo">646</span>      putUpWebUI();<a name="line.646"></a>
+<span class="sourceLineNo">647</span>    } catch (Throwable t) {<a name="line.647"></a>
+<span class="sourceLineNo">648</span>      // Make sure we log the exception. HRegionServer is often started via reflection and the<a name="line.648"></a>
+<span class="sourceLineNo">649</span>      // cause of failed startup is lost.<a name="line.649"></a>
+<span class="sourceLineNo">650</span>      LOG.error("Failed construction RegionServer", t);<a name="line.650"></a>
+<span class="sourceLineNo">651</span>      throw t;<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><a name="line.654"></a>
+<span class="sourceLineNo">655</span>  /**<a name="line.655"></a>
+<span class="sourceLineNo">656</span>   * If running on Windows, do windows-specific setup.<a name="line.656"></a>
+<span class="sourceLineNo">657</span>   */<a name="line.657"></a>
+<span class="sourceLineNo">658</span>  private static void setupWindows(final Configuration conf, ConfigurationManager cm) {<a name="line.658"></a>
+<span class="sourceLineNo">659</span>    if (!SystemUtils.IS_OS_WINDOWS) {<a name="line.659"></a>
+<span class="sourceLineNo">660</span>      Signal.handle(new Signal("HUP"), new SignalHandler() {<a name="line.660"></a>
+<span class="sourceLineNo">661</span>        @Override<a name="line.661"></a>
+<span class="sourceLineNo">662</span>        public void handle(Signal signal) {<a name="line.662"></a>
+<span clas

<TRUNCATED>

Mime
View raw message