I have an Oak repository connected to a Mongo DocumentNodeStore. When I try
to run the garbage collector through the RepositoryManagementMBean I get
the message "Cannot perform operation: no service of type RevisionGCMBean
found".
Here is how I create the repository:
DB db = new MongoClient("myhost", 27017).getDB("test_db");
DocumentNodeStore documentNodeStore = new
DocumentMK.Builder().setMongoDB(db).getNodeStore();
Oak oak = new Oak(documentNodeStore);
Jcr jcr = new Jcr(oak).with(new InitialContent()).with(new
SecurityProviderImpl());
Repository repository = jcr.createRepository();
and here how I run the garbage collector:
Tracker<RepositoryManagementMBean> track =
oak.getWhiteboard().track(RepositoryManagementMBean.class);
CompositeData revisionCompactData =
track.getServices().get(0).startRevisionGC();
CompositeData dataStoreCompactData =
track.getServices().get(0).startDataStoreGC(false);
I was looking at the Oak source code. The RepositoryManagementMBean is
created and injected when the repository is created, but the
RevisionGCMBean and the BlobGCMBean are never injected. The only class that
I found that does so is the DocumentNodeStoreService (but that is used in
an OSGi environment if I'm not mistaken).
What is the correct way to run the garbage collector?
Marco.