@Deactivate private void deactivate() throws IOException { for (ServiceRegistration reg : regs){ reg.unregister(); } regs.clear(); if (statisticsProvider instanceof Closeable) { ((Closeable) statisticsProvider).close(); } new ExecutorCloser(executor).close(); }
@Deactivate private void deactivate() throws IOException { for (ServiceRegistration reg : regs){ reg.unregister(); } regs.clear(); if (statisticsProvider instanceof Closeable) { ((Closeable) statisticsProvider).close(); } new ExecutorCloser(executor).close(); }
private synchronized Executor getExecutor() { if (executor == null) { ExecutorService executorService = defaultExecutorService(); executor = executorService; closer.register(new ExecutorCloser(executorService)); } return executor; }
private synchronized Executor getExecutor() { if (executor == null) { ExecutorService executorService = defaultExecutorService(); executor = executorService; closer.register(new ExecutorCloser(executorService)); } return executor; }
@Override public void close() { LOG.info("Uploads in progress on close [{}]", map.size()); LOG.info("Uploads completed but not cleared from cache [{}]", attic.size()); LOG.info("Staging cache stats on close [{}]", cacheStats.cacheInfoAsString()); new ExecutorCloser(executor).close(); new ExecutorCloser(scheduledExecutor).close(); new ExecutorCloser(statsExecutor).close(); }
@Override public void close() { LOG.info("Uploads in progress on close [{}]", map.size()); LOG.info("Uploads completed but not cleared from cache [{}]", attic.size()); LOG.info("Staging cache stats on close [{}]", cacheStats.cacheInfoAsString()); new ExecutorCloser(executor).close(); new ExecutorCloser(scheduledExecutor).close(); new ExecutorCloser(statsExecutor).close(); }
@Override public void close() { LOG.info("Cache stats on close [{}]", cacheStats.cacheInfoAsString()); new ExecutorCloser(executor).close(); }
/** * Closes the tracker and the underlying store. * * @throws IOException */ @Override public void close() throws IOException { store.close(); new ExecutorCloser(scheduler).close(); }
@Override public void close() throws IOException { new ExecutorCloser(scheduledExecutor).close(); new ExecutorCloser(executor).close(); } }
@Override public void shutdown() { statisticManager.dispose(); gcMonitorRegistration.unregister(); clock.close(); new ExecutorCloser(scheduledExecutor).close(); if (contentRepository instanceof Closeable) { IOUtils.closeQuietly((Closeable) contentRepository); } }
@Override public void shutdown() { statisticManager.dispose(); gcMonitorRegistration.unregister(); clock.close(); new ExecutorCloser(scheduledExecutor).close(); if (contentRepository instanceof Closeable) { IOUtils.closeQuietly((Closeable) contentRepository); } }
@Override public void after() throws Exception { super.after(); for (CustomScheduledExecutor exec : executors) { new ExecutorCloser(exec, 10, TimeUnit.SECONDS).close(); } }
@Before public void setup() throws Exception { this.root = folder.newFolder(); if (dataStore == null) { dataStore = getBlobStore(folder.newFolder()); } this.repoId = randomUUID().toString(); this.tracker = new BlobIdTracker(root.getAbsolutePath(), repoId, 100 * 60, dataStore); this.scheduler = newSingleThreadScheduledExecutor(); closer.register(tracker); closer.register(new ExecutorCloser(scheduler)); }
@After public void shutDown(){ statsProvider.close(); new ExecutorCloser(executor).close(); }
@After public void shutDown(){ statsProvider.close(); new ExecutorCloser(executor).close(); }
@After public void shutDown(){ statsProvider.close(); new ExecutorCloser(executor).close(); }
@After public void shutDown(){ statsProvider.close(); new ExecutorCloser(executor).close(); }
@After public void tearDown() throws IOException { luceneIndexProvider.close(); new ExecutorCloser(executorService).close(); }
@After public void tearDown() throws IOException { luceneIndexProvider.close(); new ExecutorCloser(executorService).close(); nrtIndexFactory.close(); }
@Before public void setup() { ScheduledExecutorService scheduler = newScheduledThreadPool(1); StatisticsProvider statistics = new DefaultStatisticsProvider(scheduler); cache = new CacheAccessTracker<String, RecordId>("foo", statistics, newRecordCache(100)); closer = new ExecutorCloser(scheduler); accessStats = statistics.getMeter("foo.access-count", StatsOptions.DEFAULT); missStats = statistics.getMeter("foo.miss-count", StatsOptions.DEFAULT); }