diff --git a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeStoreService.java b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeStoreService.java index eeadbf3..d3310af 100644 --- a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeStoreService.java +++ b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeStoreService.java @@ -539,44 +539,42 @@ public class SegmentNodeStoreService { } // Expose an MBean to managing and monitoring garbage collection - - if (configuration.isPrimarySegmentStore()) { - final FileStoreGCMonitor monitor = new FileStoreGCMonitor(Clock.SIMPLE); - closeables.add(registrations.register( - GCMonitor.class, - monitor + final FileStoreGCMonitor monitor = new FileStoreGCMonitor(Clock.SIMPLE); + closeables.add(registrations.register( + GCMonitor.class, + monitor + )); + if (!configuration.isStandbyInstance()) { + closeables.add(registrations.registerMBean( + SegmentRevisionGC.class, + new SegmentRevisionGCMBean(store, gcOptions, monitor), + SegmentRevisionGC.TYPE, + "Segment node store revision garbage collection" )); - if (!configuration.isStandbyInstance()) { - closeables.add(registrations.registerMBean( - SegmentRevisionGC.class, - new SegmentRevisionGCMBean(store, gcOptions, monitor), - SegmentRevisionGC.TYPE, - "Segment node store revision garbage collection" - )); - } - Runnable cancelGC = new Runnable() { + } - @Override - public void run() { - store.cancelGC(); - } + Runnable cancelGC = new Runnable() { - }; - Supplier statusMessage = new Supplier() { + @Override + public void run() { + store.cancelGC(); + } - @Override - public String get() { - return monitor.getStatus(); - } + }; + Supplier statusMessage = new Supplier() { - }; - closeables.add(registrations.registerMBean( - RevisionGCMBean.class, - new RevisionGC(store.getGCRunner(), cancelGC, statusMessage, executor), - RevisionGCMBean.TYPE, - "Revision garbage collection" - )); - } + @Override + public String get() { + return monitor.getStatus(); + } + + }; + closeables.add(registrations.registerMBean( + RevisionGCMBean.class, + new RevisionGC(store.getGCRunner(), cancelGC, statusMessage, executor), + RevisionGCMBean.TYPE, + "Revision garbage collection" + )); // Expose statistics about the FileStore