001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018package org.apache.hadoop.hbase.master;
019
020import java.io.IOException;
021import java.net.InetSocketAddress;
022import java.util.ArrayList;
023import java.util.Collection;
024import java.util.Collections;
025import java.util.HashMap;
026import java.util.List;
027import java.util.Map;
028import java.util.Map.Entry;
029import java.util.Optional;
030import java.util.Random;
031import java.util.TreeMap;
032import java.util.concurrent.ConcurrentSkipListMap;
033import org.apache.hadoop.conf.Configuration;
034import org.apache.hadoop.fs.FileSystem;
035import org.apache.hadoop.hbase.Abortable;
036import org.apache.hadoop.hbase.CellScannable;
037import org.apache.hadoop.hbase.CellUtil;
038import org.apache.hadoop.hbase.ChoreService;
039import org.apache.hadoop.hbase.CoordinatedStateManager;
040import org.apache.hadoop.hbase.ServerName;
041import org.apache.hadoop.hbase.TableDescriptors;
042import org.apache.hadoop.hbase.TableName;
043import org.apache.hadoop.hbase.ZooKeeperConnectionException;
044import org.apache.hadoop.hbase.client.ClusterConnection;
045import org.apache.hadoop.hbase.client.Connection;
046import org.apache.hadoop.hbase.client.RegionInfo;
047import org.apache.hadoop.hbase.client.RegionInfoBuilder;
048import org.apache.hadoop.hbase.client.Result;
049import org.apache.hadoop.hbase.client.Scan;
050import org.apache.hadoop.hbase.client.locking.EntityLock;
051import org.apache.hadoop.hbase.executor.ExecutorService;
052import org.apache.hadoop.hbase.io.hfile.BlockCache;
053import org.apache.hadoop.hbase.ipc.HBaseRpcController;
054import org.apache.hadoop.hbase.ipc.RpcServerInterface;
055import org.apache.hadoop.hbase.mob.MobFileCache;
056import org.apache.hadoop.hbase.quotas.RegionServerRpcQuotaManager;
057import org.apache.hadoop.hbase.quotas.RegionServerSpaceQuotaManager;
058import org.apache.hadoop.hbase.quotas.RegionSizeStore;
059import org.apache.hadoop.hbase.regionserver.FlushRequester;
060import org.apache.hadoop.hbase.regionserver.HRegion;
061import org.apache.hadoop.hbase.regionserver.HeapMemoryManager;
062import org.apache.hadoop.hbase.regionserver.LeaseManager;
063import org.apache.hadoop.hbase.regionserver.MetricsRegionServer;
064import org.apache.hadoop.hbase.regionserver.Region;
065import org.apache.hadoop.hbase.regionserver.RegionServerAccounting;
066import org.apache.hadoop.hbase.regionserver.RegionServerServices;
067import org.apache.hadoop.hbase.regionserver.SecureBulkLoadManager;
068import org.apache.hadoop.hbase.regionserver.ServerNonceManager;
069import org.apache.hadoop.hbase.regionserver.compactions.CompactionRequester;
070import org.apache.hadoop.hbase.regionserver.throttle.ThroughputController;
071import org.apache.hadoop.hbase.security.access.AccessChecker;
072import org.apache.hadoop.hbase.security.access.ZKPermissionWatcher;
073import org.apache.hadoop.hbase.util.Bytes;
074import org.apache.hadoop.hbase.wal.WAL;
075import org.apache.hadoop.hbase.zookeeper.ZKWatcher;
076
077import org.apache.hbase.thirdparty.com.google.protobuf.RpcController;
078import org.apache.hbase.thirdparty.com.google.protobuf.ServiceException;
079
080import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
081import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos;
082import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ClearCompactionQueuesRequest;
083import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ClearCompactionQueuesResponse;
084import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ClearRegionBlockCacheRequest;
085import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ClearRegionBlockCacheResponse;
086import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ClearSlowLogResponseRequest;
087import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ClearSlowLogResponses;
088import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.CloseRegionRequest;
089import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.CloseRegionResponse;
090import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.CompactRegionRequest;
091import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.CompactRegionResponse;
092import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.CompactionSwitchRequest;
093import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.CompactionSwitchResponse;
094import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ExecuteProceduresRequest;
095import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ExecuteProceduresResponse;
096import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.FlushRegionRequest;
097import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.FlushRegionResponse;
098import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetOnlineRegionRequest;
099import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetOnlineRegionResponse;
100import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoRequest;
101import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoResponse;
102import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionLoadRequest;
103import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionLoadResponse;
104import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetServerInfoRequest;
105import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetServerInfoResponse;
106import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetStoreFileRequest;
107import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetStoreFileResponse;
108import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.OpenRegionRequest;
109import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.OpenRegionResponse;
110import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ReplicateWALEntryRequest;
111import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ReplicateWALEntryResponse;
112import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.RollWALWriterRequest;
113import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.RollWALWriterResponse;
114import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.SlowLogResponseRequest;
115import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.SlowLogResponses;
116import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.StopServerRequest;
117import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.StopServerResponse;
118import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.UpdateConfigurationRequest;
119import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.UpdateConfigurationResponse;
120import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.UpdateFavoredNodesRequest;
121import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.UpdateFavoredNodesResponse;
122import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.WarmupRegionRequest;
123import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.WarmupRegionResponse;
124import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos;
125import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.BulkLoadHFileRequest;
126import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.BulkLoadHFileResponse;
127import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CleanupBulkLoadRequest;
128import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CleanupBulkLoadResponse;
129import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CoprocessorServiceRequest;
130import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CoprocessorServiceResponse;
131import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.GetRequest;
132import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.GetResponse;
133import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MultiRequest;
134import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutateRequest;
135import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutateResponse;
136import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.PrepareBulkLoadRequest;
137import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.PrepareBulkLoadResponse;
138import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ScanRequest;
139import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ScanResponse;
140import org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos;
141import org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaSnapshotsRequest;
142import org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaSnapshotsResponse;
143
144/**
145 * A mock RegionServer implementation.
146 * Use this when you can't bend Mockito to your liking (e.g. return null result
147 * when 'scanning' until master timesout and then return a coherent meta row
148 * result thereafter.  Have some facility for faking gets and scans.  See
149 * setGetResult(byte[], byte[], Result) for how to fill the backing data
150 * store that the get pulls from.
151 */
152class MockRegionServer implements AdminProtos.AdminService.BlockingInterface,
153    ClientProtos.ClientService.BlockingInterface, RegionServerServices {
154  private final ServerName sn;
155  private final ZKWatcher zkw;
156  private final Configuration conf;
157  private final Random random = new Random();
158
159  /**
160   * Map of regions to map of rows and {@link Result}. Used as data source when
161   * {@link #get(RpcController, ClientProtos.GetRequest)} is called. Because we have a byte
162   * key, need to use TreeMap and provide a Comparator.  Use
163   * {@link #setGetResult(byte[], byte[], Result)} filling this map.
164   */
165  private final Map<byte [], Map<byte [], Result>> gets = new TreeMap<>(Bytes.BYTES_COMPARATOR);
166
167  /**
168   * Map of regions to results to return when scanning.
169   */
170  private final Map<byte [], Result []> nexts = new TreeMap<>(Bytes.BYTES_COMPARATOR);
171
172  /**
173   * Data structure that holds regionname and index used scanning.
174   */
175  class RegionNameAndIndex {
176    private final byte[] regionName;
177    private int index = 0;
178
179    RegionNameAndIndex(final byte[] regionName) {
180      this.regionName = regionName;
181    }
182
183    byte[] getRegionName() {
184      return this.regionName;
185    }
186
187    int getThenIncrement() {
188      int currentIndex = this.index;
189      this.index++;
190      return currentIndex;
191    }
192  }
193
194  /**
195   * Outstanding scanners and their offset into <code>nexts</code>
196   */
197  private final Map<Long, RegionNameAndIndex> scannersAndOffsets = new HashMap<>();
198
199  /**
200   * @param sn Name of this mock regionserver
201   * @throws IOException
202   * @throws org.apache.hadoop.hbase.ZooKeeperConnectionException
203   */
204  MockRegionServer(final Configuration conf, final ServerName sn)
205  throws ZooKeeperConnectionException, IOException {
206    this.sn = sn;
207    this.conf = conf;
208    this.zkw = new ZKWatcher(conf, sn.toString(), this, true);
209  }
210
211  /**
212   * Use this method filling the backing data source used by
213   * {@link #get(RpcController, ClientProtos.GetRequest)}
214   * @param regionName the region name to assign
215   * @param row the row key
216   * @param r the single row result
217   */
218  void setGetResult(final byte [] regionName, final byte [] row, final Result r) {
219    Map<byte [], Result> value = this.gets.get(regionName);
220    if (value == null) {
221      // If no value already, create one.  Needs to be treemap because we are
222      // using byte array as key.   Not thread safe.
223      value = new TreeMap<>(Bytes.BYTES_COMPARATOR);
224      this.gets.put(regionName, value);
225    }
226    value.put(row, r);
227  }
228
229  /**
230   * Use this method to set what a scanner will reply as we next through
231   * @param regionName
232   * @param rs
233   */
234  void setNextResults(final byte [] regionName, final Result [] rs) {
235    this.nexts.put(regionName, rs);
236  }
237
238  @Override
239  public boolean isStopped() {
240    return false;
241  }
242
243  @Override
244  public void abort(String why, Throwable e) {
245    throw new RuntimeException(this.sn + ": " + why, e);
246  }
247
248  @Override
249  public boolean isAborted() {
250    return false;
251  }
252
253  public long openScanner(byte[] regionName, Scan scan) throws IOException {
254    long scannerId = this.random.nextLong();
255    this.scannersAndOffsets.put(scannerId, new RegionNameAndIndex(regionName));
256    return scannerId;
257  }
258
259  public Result next(long scannerId) throws IOException {
260    RegionNameAndIndex rnai = this.scannersAndOffsets.get(scannerId);
261    int index = rnai.getThenIncrement();
262    Result [] results = this.nexts.get(rnai.getRegionName());
263    if (results == null) return null;
264    return index < results.length? results[index]: null;
265  }
266
267  public Result [] next(long scannerId, int numberOfRows) throws IOException {
268    // Just return one result whatever they ask for.
269    Result r = next(scannerId);
270    return r == null? null: new Result [] {r};
271  }
272
273  public void close(final long scannerId) throws IOException {
274    this.scannersAndOffsets.remove(scannerId);
275  }
276
277  @Override
278  public void stop(String why) {
279    this.zkw.close();
280  }
281
282  @Override
283  public void addRegion(HRegion r) {
284  }
285
286  @Override
287  public boolean removeRegion(HRegion r, ServerName destination) {
288    return false;
289  }
290
291  @Override
292  public HRegion getRegion(String encodedRegionName) {
293    return null;
294  }
295
296  @Override
297  public Configuration getConfiguration() {
298    return this.conf;
299  }
300
301  @Override
302  public ZKWatcher getZooKeeper() {
303    return this.zkw;
304  }
305
306  @Override
307  public CoordinatedStateManager getCoordinatedStateManager() {
308    return null;
309  }
310
311  @Override
312  public ClusterConnection getConnection() {
313    return null;
314  }
315
316  @Override
317  public ServerName getServerName() {
318    return this.sn;
319  }
320
321  @Override
322  public boolean isStopping() {
323    return false;
324  }
325
326  @Override
327  public FlushRequester getFlushRequester() {
328    return null;
329  }
330  @Override
331  public CompactionRequester getCompactionRequestor() {
332    return null;
333  }
334  @Override
335  public RegionServerAccounting getRegionServerAccounting() {
336    return null;
337  }
338
339  @Override
340  public RegionServerRpcQuotaManager getRegionServerRpcQuotaManager() {
341    return null;
342  }
343
344  @Override
345  public void postOpenDeployTasks(PostOpenDeployContext context) throws IOException {
346  }
347
348  @Override
349  public RpcServerInterface getRpcServer() {
350    return null;
351  }
352
353  @Override
354  public ConcurrentSkipListMap<byte[], Boolean> getRegionsInTransitionInRS() {
355    return null;
356  }
357
358  @Override
359  public FileSystem getFileSystem() {
360    return null;
361  }
362
363  @Override
364  public GetResponse get(RpcController controller, GetRequest request)
365  throws ServiceException {
366    byte[] regionName = request.getRegion().getValue().toByteArray();
367    Map<byte [], Result> m = this.gets.get(regionName);
368    GetResponse.Builder builder = GetResponse.newBuilder();
369    if (m != null) {
370      byte[] row = request.getGet().getRow().toByteArray();
371      builder.setResult(ProtobufUtil.toResult(m.get(row)));
372    }
373    return builder.build();
374  }
375
376  @Override
377  public MutateResponse mutate(RpcController controller, MutateRequest request)
378      throws ServiceException {
379    return null;
380  }
381
382  @Override
383  public ScanResponse scan(RpcController controller, ScanRequest request)
384      throws ServiceException {
385    ScanResponse.Builder builder = ScanResponse.newBuilder();
386    try {
387      if (request.hasScan()) {
388        byte[] regionName = request.getRegion().getValue().toByteArray();
389        builder.setScannerId(openScanner(regionName, null));
390        builder.setMoreResults(true);
391      }
392      else {
393        long scannerId = request.getScannerId();
394        Result result = next(scannerId);
395        if (result != null) {
396          builder.addCellsPerResult(result.size());
397          List<CellScannable> results = new ArrayList<>(1);
398          results.add(result);
399          ((HBaseRpcController) controller).setCellScanner(CellUtil
400              .createCellScanner(results));
401          builder.setMoreResults(true);
402        }
403        else {
404          builder.setMoreResults(false);
405          close(scannerId);
406        }
407      }
408    } catch (IOException ie) {
409      throw new ServiceException(ie);
410    }
411    return builder.build();
412  }
413
414  @Override
415  public BulkLoadHFileResponse bulkLoadHFile(RpcController controller,
416      BulkLoadHFileRequest request) throws ServiceException {
417    return null;
418  }
419
420  @Override
421  public ClientProtos.CoprocessorServiceResponse execService(RpcController controller,
422      ClientProtos.CoprocessorServiceRequest request) throws ServiceException {
423    return null;
424  }
425
426  @Override
427  public ClientProtos.MultiResponse multi(
428      RpcController controller, MultiRequest request) throws ServiceException {
429    return null;
430  }
431
432  @Override
433  public GetRegionInfoResponse getRegionInfo(RpcController controller,
434      GetRegionInfoRequest request) throws ServiceException {
435    GetRegionInfoResponse.Builder builder = GetRegionInfoResponse.newBuilder();
436    builder.setRegionInfo(ProtobufUtil.toRegionInfo(RegionInfoBuilder.FIRST_META_REGIONINFO));
437    return builder.build();
438  }
439
440  @Override
441  public GetRegionLoadResponse getRegionLoad(RpcController controller,
442      GetRegionLoadRequest request) throws ServiceException {
443    GetRegionLoadResponse.Builder builder = GetRegionLoadResponse.newBuilder();
444    return builder.build();
445  }
446
447  @Override
448  public ClearCompactionQueuesResponse clearCompactionQueues(RpcController controller,
449    ClearCompactionQueuesRequest request) throws ServiceException {
450    return null;
451  }
452
453  @Override
454  public GetStoreFileResponse getStoreFile(RpcController controller,
455      GetStoreFileRequest request) throws ServiceException {
456    return null;
457  }
458
459  @Override
460  public GetOnlineRegionResponse getOnlineRegion(RpcController controller,
461      GetOnlineRegionRequest request) throws ServiceException {
462    return null;
463  }
464
465  @Override
466  public List<Region> getRegions() {
467    return null;
468  }
469
470  @Override
471  public OpenRegionResponse openRegion(RpcController controller,
472      OpenRegionRequest request) throws ServiceException {
473    return null;
474  }
475
476  @Override
477  public WarmupRegionResponse warmupRegion(RpcController controller,
478      WarmupRegionRequest request) throws ServiceException {
479    return null;
480  }
481  @Override
482  public CloseRegionResponse closeRegion(RpcController controller,
483      CloseRegionRequest request) throws ServiceException {
484    return null;
485  }
486
487  @Override
488  public FlushRegionResponse flushRegion(RpcController controller,
489      FlushRegionRequest request) throws ServiceException {
490    return null;
491  }
492
493  @Override
494  public CompactionSwitchResponse compactionSwitch(RpcController controller,
495      CompactionSwitchRequest request) throws ServiceException {
496    return null;
497  }
498
499  @Override
500  public CompactRegionResponse compactRegion(RpcController controller,
501      CompactRegionRequest request) throws ServiceException {
502    return null;
503  }
504
505  @Override
506  public ReplicateWALEntryResponse replicateWALEntry(RpcController controller,
507      ReplicateWALEntryRequest request) throws ServiceException {
508    return null;
509  }
510
511  @Override
512  public RollWALWriterResponse rollWALWriter(RpcController controller,
513      RollWALWriterRequest request) throws ServiceException {
514    return null;
515  }
516
517  @Override
518  public GetServerInfoResponse getServerInfo(RpcController controller,
519      GetServerInfoRequest request) throws ServiceException {
520    return null;
521  }
522
523  @Override
524  public StopServerResponse stopServer(RpcController controller,
525      StopServerRequest request) throws ServiceException {
526    return null;
527  }
528
529  @Override
530  public List<Region> getRegions(TableName tableName) throws IOException {
531    return null;
532  }
533
534  @Override
535  public LeaseManager getLeaseManager() {
536    return null;
537  }
538
539  @Override
540  public List<WAL> getWALs() throws IOException {
541    return Collections.emptyList();
542  }
543
544  @Override
545  public WAL getWAL(RegionInfo regionInfo) throws IOException {
546    return null;
547  }
548
549  @Override
550  public ExecutorService getExecutorService() {
551    return null;
552  }
553
554  @Override
555  public ChoreService getChoreService() {
556    return null;
557  }
558
559  @Override
560  public void updateRegionFavoredNodesMapping(String encodedRegionName,
561      List<org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ServerName> favoredNodes) {
562  }
563
564  @Override
565  public InetSocketAddress[] getFavoredNodesForRegion(String encodedRegionName) {
566    return null;
567  }
568
569  @Override
570  public ReplicateWALEntryResponse
571      replay(RpcController controller, ReplicateWALEntryRequest request)
572      throws ServiceException {
573    return null;
574  }
575
576  @Override
577  public UpdateFavoredNodesResponse updateFavoredNodes(RpcController controller,
578      UpdateFavoredNodesRequest request) throws ServiceException {
579    return null;
580  }
581
582  @Override
583  public ServerNonceManager getNonceManager() {
584    return null;
585  }
586
587  @Override
588  public boolean reportRegionStateTransition(RegionStateTransitionContext context) {
589    return false;
590  }
591
592  @Override
593  public boolean registerService(com.google.protobuf.Service service) {
594    return false;
595  }
596
597  @Override
598  public CoprocessorServiceResponse execRegionServerService(RpcController controller,
599      CoprocessorServiceRequest request) throws ServiceException {
600    return null;
601  }
602
603  @Override
604  public UpdateConfigurationResponse updateConfiguration(
605      RpcController controller, UpdateConfigurationRequest request)
606      throws ServiceException {
607    return null;
608  }
609
610  @Override
611  public ClearRegionBlockCacheResponse clearRegionBlockCache(RpcController controller,
612                                                             ClearRegionBlockCacheRequest request)
613    throws ServiceException {
614    return null;
615  }
616
617  @Override
618  public HeapMemoryManager getHeapMemoryManager() {
619    return null;
620  }
621
622  @Override
623  public double getCompactionPressure() {
624    return 0;
625  }
626
627  @Override
628  public ClusterConnection getClusterConnection() {
629    return null;
630  }
631
632  @Override
633  public ThroughputController getFlushThroughputController() {
634    return null;
635  }
636
637  @Override
638  public double getFlushPressure() {
639    return 0;
640  }
641
642  @Override
643  public MetricsRegionServer getMetrics() {
644    return null;
645  }
646
647  @Override
648  public EntityLock regionLock(List<RegionInfo> regionInfos, String description, Abortable abort)
649      throws IOException {
650    return null;
651  }
652
653  @Override
654  public PrepareBulkLoadResponse prepareBulkLoad(RpcController controller,
655      PrepareBulkLoadRequest request) throws ServiceException {
656    return null;
657  }
658
659  @Override
660  public CleanupBulkLoadResponse cleanupBulkLoad(RpcController controller,
661      CleanupBulkLoadRequest request) throws ServiceException {
662    return null;
663  }
664
665  @Override
666  public SecureBulkLoadManager getSecureBulkLoadManager() {
667    return null;
668  }
669
670  @Override
671  public void unassign(byte[] regionName) throws IOException {
672  }
673
674  @Override
675  public RegionServerSpaceQuotaManager getRegionServerSpaceQuotaManager() {
676    return null;
677  }
678
679  @Override
680  public ExecuteProceduresResponse executeProcedures(RpcController controller,
681      ExecuteProceduresRequest request) throws ServiceException {
682    return null;
683  }
684
685  @Override
686  public SlowLogResponses getSlowLogResponses(RpcController controller,
687      SlowLogResponseRequest request) throws ServiceException {
688    return null;
689  }
690
691  @Override
692  public SlowLogResponses getLargeLogResponses(RpcController controller,
693      SlowLogResponseRequest request) throws ServiceException {
694    return null;
695  }
696
697  @Override
698  public ClearSlowLogResponses clearSlowLogsResponses(RpcController controller,
699      ClearSlowLogResponseRequest request) throws ServiceException {
700    return null;
701  }
702
703  @Override
704  public HBaseProtos.LogEntry getLogEntries(RpcController controller,
705      HBaseProtos.LogRequest request) throws ServiceException {
706    return null;
707  }
708
709  @Override
710  public GetSpaceQuotaSnapshotsResponse getSpaceQuotaSnapshots(
711      RpcController controller, GetSpaceQuotaSnapshotsRequest request)
712      throws ServiceException {
713    return null;
714  }
715
716  @Override
717  public Connection createConnection(Configuration conf) throws IOException {
718    return null;
719  }
720
721  @Override
722  public boolean isClusterUp() {
723    return true;
724  }
725
726  @Override
727  public TableDescriptors getTableDescriptors() {
728    return null;
729  }
730
731  @Override
732  public Optional<BlockCache> getBlockCache() {
733    return Optional.empty();
734  }
735
736  @Override
737  public Optional<MobFileCache> getMobFileCache() {
738    return Optional.empty();
739  }
740
741  @Override
742  public AccessChecker getAccessChecker() {
743    return null;
744  }
745
746  @Override
747  public ZKPermissionWatcher getZKPermissionWatcher() {
748    return null;
749  }
750
751  @Override
752  public boolean reportRegionSizesForQuotas(RegionSizeStore sizeStore) {
753    return true;
754  }
755
756  @Override
757  public boolean reportFileArchivalForQuotas(
758      TableName tableName, Collection<Entry<String, Long>> archivedFiles) {
759    return false;
760  }
761}