@Test public void testCheckRegionServerStoppingOnClose() throws Exception { when(conn.isClosed()).thenReturn(true); when(conn.isAborted()).thenReturn(false); mockScanner.close(); verify(conn).isClosed(); verify(callable, never()).call(); verify(runTracker, never()).runTask(callable); }
@Override public void close() throws IOException { boolean async = getConfig().getBoolean(COMMIT_STATS_ASYNC, DEFAULT_COMMIT_STATS_ASYNC); StatisticsCollectionRunTracker collectionTracker = getStatsCollectionRunTracker(config); StatisticsScannerCallable callable = createCallable(); if (isConnectionClosed()) { LOGGER.debug("Not updating table statistics because the server is stopping/stopped"); return; } if (!async) { callable.call(); } else { collectionTracker.runTask(callable); } }
StatisticsScanner implements InternalScanner { @Override public void close() throws IOException { boolean async = getConfig().getBoolean(COMMIT_STATS_ASYNC, DEFAULT_COMMIT_STATS_ASYNC); StatisticsCollectionRunTracker collectionTracker = getStatsCollectionRunTracker(config); StatisticsScannerCallable callable = createCallable(); if (isConnectionClosed()) { LOGGER.debug("Not updating table statistics because the server is stopping/stopped"); return; } if (!async) { callable.call(); } else { collectionTracker.runTask(callable); } } }
StatisticsScanner implements InternalScanner { @Override public void close() throws IOException { boolean async = getConfig().getBoolean(COMMIT_STATS_ASYNC, DEFAULT_COMMIT_STATS_ASYNC); StatisticsCollectionRunTracker collectionTracker = getStatsCollectionRunTracker(config); StatisticsScannerCallable callable = createCallable(); if (isConnectionClosed()) { LOGGER.debug("Not updating table statistics because the server is stopping/stopped"); return; } if (!async) { callable.call(); } else { collectionTracker.runTask(callable); } } StatisticsScanner(StatisticsCollector tracker, StatisticsWriter stats, RegionCoprocessorEnvironment env,
            InternalScanner delegate, ImmutableBytesPtr family); }
StatisticsScanner implements InternalScanner { @Override public void close() throws IOException { boolean async = getConfig().getBoolean(COMMIT_STATS_ASYNC, DEFAULT_COMMIT_STATS_ASYNC); StatisticsCollectionRunTracker collectionTracker = getStatsCollectionRunTracker(config); StatisticsScannerCallable callable = createCallable(); if (isConnectionClosed()) { LOGGER.debug("Not updating table statistics because the server is stopping/stopped"); return; } if (!async) { callable.call(); } else { collectionTracker.runTask(callable); } } StatisticsScanner(StatisticsCollector tracker, StatisticsWriter stats, RegionCoprocessorEnvironment env,
            InternalScanner delegate, ImmutableBytesPtr family); @Override boolean next(List<Cell> result); @Override boolean next(List<Cell> result, ScannerContext scannerContext); @Override void close(); }
StatisticsScanner implements InternalScanner { @Override public void close() throws IOException { boolean async = getConfig().getBoolean(COMMIT_STATS_ASYNC, DEFAULT_COMMIT_STATS_ASYNC); StatisticsCollectionRunTracker collectionTracker = getStatsCollectionRunTracker(config); StatisticsScannerCallable callable = createCallable(); if (isConnectionClosed()) { LOGGER.debug("Not updating table statistics because the server is stopping/stopped"); return; } if (!async) { callable.call(); } else { collectionTracker.runTask(callable); } } StatisticsScanner(StatisticsCollector tracker, StatisticsWriter stats, RegionCoprocessorEnvironment env,
            InternalScanner delegate, ImmutableBytesPtr family); @Override boolean next(List<Cell> result); @Override boolean next(List<Cell> result, ScannerContext scannerContext); @Override void close();  }