public RepositoryImpl(@NotNull ContentRepository contentRepository, @NotNull Whiteboard whiteboard, @NotNull SecurityProvider securityProvider, int observationQueueLength, CommitRateLimiter commitRateLimiter, boolean fastQueryResultSize) { this.contentRepository = checkNotNull(contentRepository); this.whiteboard = checkNotNull(whiteboard); this.securityProvider = checkNotNull(securityProvider); this.observationQueueLength = observationQueueLength; this.commitRateLimiter = commitRateLimiter; this.descriptors = determineDescriptors(); this.statisticManager = new StatisticManager(whiteboard, scheduledExecutor); this.clock = new Clock.Fast(scheduledExecutor); this.gcMonitorRegistration = whiteboard.register(GCMonitor.class, gcMonitor, emptyMap()); this.fastQueryResultSize = fastQueryResultSize; this.mountInfoProvider = WhiteboardUtils.getService(whiteboard, MountInfoProvider.class); this.blobAccessProvider = WhiteboardUtils.getService(whiteboard, BlobAccessProvider.class); }
@Override public void shutdown() { statisticManager.dispose(); gcMonitorRegistration.unregister(); clock.close(); new ExecutorCloser(scheduledExecutor).close(); if (contentRepository instanceof Closeable) { IOUtils.closeQuietly((Closeable) contentRepository); } }
public RepositoryImpl(@Nonnull ContentRepository contentRepository, @Nonnull Whiteboard whiteboard, @Nonnull SecurityProvider securityProvider, int observationQueueLength, CommitRateLimiter commitRateLimiter, boolean fastQueryResultSize) { this.contentRepository = checkNotNull(contentRepository); this.whiteboard = checkNotNull(whiteboard); this.securityProvider = checkNotNull(securityProvider); this.observationQueueLength = observationQueueLength; this.commitRateLimiter = commitRateLimiter; this.descriptors = determineDescriptors(); this.statisticManager = new StatisticManager(whiteboard, scheduledExecutor); this.clock = new Clock.Fast(scheduledExecutor); this.gcMonitorRegistration = whiteboard.register(GCMonitor.class, gcMonitor, emptyMap()); this.fastQueryResultSize = fastQueryResultSize; this.mountInfoProvider = WhiteboardUtils.getService(whiteboard, MountInfoProvider.class); }
public RepositoryImpl(@NotNull ContentRepository contentRepository, @NotNull Whiteboard whiteboard, @NotNull SecurityProvider securityProvider, int observationQueueLength, CommitRateLimiter commitRateLimiter, boolean fastQueryResultSize) { this.contentRepository = checkNotNull(contentRepository); this.whiteboard = checkNotNull(whiteboard); this.securityProvider = checkNotNull(securityProvider); this.observationQueueLength = observationQueueLength; this.commitRateLimiter = commitRateLimiter; this.descriptors = determineDescriptors(); this.statisticManager = new StatisticManager(whiteboard, scheduledExecutor); this.clock = new Clock.Fast(scheduledExecutor); this.gcMonitorRegistration = whiteboard.register(GCMonitor.class, gcMonitor, emptyMap()); this.fastQueryResultSize = fastQueryResultSize; this.mountInfoProvider = WhiteboardUtils.getService(whiteboard, MountInfoProvider.class); this.blobAccessProvider = WhiteboardUtils.getService(whiteboard, BlobAccessProvider.class); }
public MetricStatisticsProvider(MBeanServer server, ScheduledExecutorService executor) { clock = new Clock.Fast(executor); metricsClock = new OakMetricClock(clock); registry = new MetricRegistry(); repoStats = new RepositoryStatisticsImpl(executor); reporter = JmxReporter.forRegistry(registry) .inDomain(WhiteboardUtils.JMX_OAK_DOMAIN) .registerWith(server) .createsObjectNamesWith(new OakNameFactory()) .build(); reporter.start(); registerAverages(); }
public MetricStatisticsProvider(MBeanServer server, ScheduledExecutorService executor) { clock = new Clock.Fast(executor); metricsClock = new OakMetricClock(clock); registry = new MetricRegistry(); repoStats = new RepositoryStatisticsImpl(executor); reporter = JmxReporter.forRegistry(registry) .inDomain(WhiteboardUtils.JMX_OAK_DOMAIN) .registerWith(server) .createsObjectNamesWith(new OakNameFactory()) .build(); reporter.start(); registerAverages(); }
public MetricStatisticsProvider(MBeanServer server, ScheduledExecutorService executor) { clock = new Clock.Fast(executor); metricsClock = new OakMetricClock(clock); registry = new MetricRegistry(); repoStats = new RepositoryStatisticsImpl(executor); reporter = JmxReporter.forRegistry(registry) .inDomain(WhiteboardUtils.JMX_OAK_DOMAIN) .registerWith(server) .createsObjectNamesWith(new OakNameFactory()) .build(); reporter.start(); registerAverages(); }
@Override public void shutdown() { statisticManager.dispose(); gcMonitorRegistration.unregister(); clock.close(); new ExecutorCloser(scheduledExecutor).close(); if (contentRepository instanceof Closeable) { IOUtils.closeQuietly((Closeable) contentRepository); } }
@Test @Ignore("OAK-3220") public void testClockDriftFast() throws InterruptedException { ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(); try { testClockDrift(new Clock.Fast(executor)); } finally { executor.shutdown(); } }
public void close() { clock.close(); if (reporter != null) { reporter.close(); } }
/** * starts the clock */ public void start() { clock = new Clock.Fast(executor); start = clock.getTimeMonotonic(); }
public void close() { clock.close(); if (reporter != null) { reporter.close(); } }
@Override public void shutdown() { statisticManager.dispose(); gcMonitorRegistration.unregister(); clock.close(); new ExecutorCloser(scheduledExecutor).close(); if (contentRepository instanceof Closeable) { IOUtils.closeQuietly((Closeable) contentRepository); } }
public void close() { clock.close(); if (reporter != null) { reporter.close(); } }
/** * starts the clock */ public void start() { clock = new Clock.Fast(executor); start = clock.getTimeMonotonic(); }
@Test public void testClockIncreasingFast() throws InterruptedException { ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(); try { testClockIncreasing(new Clock.Fast(executor)); } finally { executor.shutdown(); } }