@Before public void setupBasicMocks() throws IOException, ServiceException { rs = Mockito.mock(HRegionServer.class); rpcServices = Mockito.mock(RSRpcServices.class); rpcServer = Mockito.mock(RpcServerInterface.class); Mockito.doReturn(HBaseConfiguration.create()) .when(rs).getConfiguration(); Mockito.doReturn(rpcServices).when(rs).getRSRpcServices(); Mockito.doReturn(rpcServer).when(rs).getRpcServer(); Mockito.doReturn(fakeResponse).when(rpcServices).getServerInfo( (RpcController)Mockito.any(), (GetServerInfoRequest)Mockito.any()); // Fake ZKW ZKWatcher zkw = Mockito.mock(ZKWatcher.class); Mockito.doReturn("fakequorum").when(zkw).getQuorum(); Mockito.doReturn(zkw).when(rs).getZooKeeper(); // Fake BlockCache LOG.warn("The " + HConstants.HFILE_BLOCK_CACHE_SIZE_KEY + " is set to 0"); Mockito.doReturn(Optional.empty()).when(rs).getBlockCache(); // Fake MasterAddressTracker MasterAddressTracker mat = Mockito.mock(MasterAddressTracker.class); Mockito.doReturn(fakeMasterAddress).when(mat).getMasterAddress(); Mockito.doReturn(mat).when(rs).getMasterAddressTracker(); MetricsRegionServer rms = Mockito.mock(MetricsRegionServer.class); Mockito.doReturn(new MetricsRegionServerWrapperStub()).when(rms).getRegionServerWrapper(); Mockito.doReturn(rms).when(rs).getRegionServerMetrics(); MetricsHBaseServer ms = Mockito.mock(MetricsHBaseServer.class); Mockito.doReturn(new MetricsHBaseServerWrapperStub()).when(ms).getHBaseServerWrapper(); Mockito.doReturn(ms).when(rpcServer).getMetrics(); }
private void failRegionAction(MultiResponse.Builder responseBuilder, RegionActionResult.Builder regionActionResultBuilder, RegionAction regionAction, CellScanner cellScanner, Throwable error) { rpcServer.getMetrics().exception(error); regionActionResultBuilder.setException(ResponseConverter.buildException(error)); responseBuilder.addRegionActionResult(regionActionResultBuilder.build()); // All Mutations in this RegionAction not executed as we can not see the Region online here // in this RS. Will be retried from Client. Skipping all the Cells in CellScanner // corresponding to these Mutations. if (cellScanner != null) { skipCellsForMutations(regionAction.getActionList(), cellScanner); } }
__jamon__var_9.renderNoFlush(jamonWriter, regionServer.getRegionServerMetrics().getRegionServerWrapper(), regionServer.getRpcServer().getMetrics().getHBaseServerWrapper());
BaseSource s = rpcServer.getMetrics().getMetricsSource(); long startingExceptions = METRICS_ASSERT.getCounter("exceptions", s); long startingMultiExceptions = METRICS_ASSERT.getCounter("exceptions.multiResponseTooLarge", s);
BaseSource s = rpcServer.getMetrics().getMetricsSource(); long startingExceptions = METRICS_ASSERT.getCounter("exceptions", s); long startingMultiExceptions = METRICS_ASSERT.getCounter("exceptions.multiResponseTooLarge", s);
table.close(); MetricsHBaseServerSource serverSource = TEST_UTIL.getMiniHBaseCluster().getRegionServer(0) .getRpcServer().getMetrics().getMetricsSource(); HELPER.assertCounter("exceptions.OutOfOrderScannerNextException", 0, serverSource);
rpcServer.getMetrics().exception(sizeIOE); rpcServer.getMetrics().exception(ie); hasResultOrException = true; NameBytesPair pair = ResponseConverter.buildException(ie);
rpcServer.getMetrics().exception(e);
Mockito.doReturn(ms).when(rpcServer).getMetrics();
__jamon__var_8.renderNoFlush(jamonWriter, regionServer.getRegionServerMetrics().getRegionServerWrapper(), regionServer.getRpcServer().getMetrics().getHBaseServerWrapper());
BaseSource s = rpcServer.getMetrics().getMetricsSource(); long startingExceptions = METRICS_ASSERT.getCounter("exceptions", s); long startingMultiExceptions = METRICS_ASSERT.getCounter("exceptions.multiResponseTooLarge", s);
BaseSource s = rpcServer.getMetrics().getMetricsSource(); long startingExceptions = METRICS_ASSERT.getCounter("exceptions", s); long startingMultiExceptions = METRICS_ASSERT.getCounter("exceptions.multiResponseTooLarge", s);
table.close(); MetricsHBaseServerSource serverSource = TEST_UTIL.getMiniHBaseCluster().getRegionServer(0) .getRpcServer().getMetrics().getMetricsSource(); HELPER.assertCounter("exceptions.OutOfOrderScannerNextException", 0, serverSource);
rpcServer.getMetrics().exception(sizeIOE); .setValue(result.toByteString()))); } catch (IOException ioe) { rpcServer.getMetrics().exception(ioe); resultOrExceptionBuilder.setException(ResponseConverter.buildException(ioe)); rpcServer.getMetrics().exception(ie); resultOrExceptionBuilder = ResultOrException.newBuilder(). setException(ResponseConverter.buildException(ie));
quota = getQuotaManager().checkQuota(region, regionAction.getActionList()); } catch (IOException e) { rpcServer.getMetrics().exception(e); regionActionResultBuilder.setException(ResponseConverter.buildException(e)); responseBuilder.addRegionActionResult(regionActionResultBuilder.build()); rpcServer.getMetrics().exception(e);