You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by Marco Piovesana <pi...@esteco.com> on 2018/01/10 16:36:52 UTC

run garbage collector through RepositoryManagementMBean

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.

Re: run garbage collector through RepositoryManagementMBean

Posted by Marcel Reutegger <mr...@adobe.com.INVALID>.
Hi,

On 10/01/18 17:37, Thiago Sanches wrote:
> Hi guys, how can I proceed to exit the group?
> Regards.

See instructions here: http://jackrabbit.apache.org/jcr/mailing-lists.html

Regards
  Marcel

Re: run garbage collector through RepositoryManagementMBean

Posted by Thiago Sanches <ts...@gmail.com>.
Hi guys, how can I proceed to exit the group?
Regards.

On Wed, Jan 10, 2018 at 2:36 PM, Marco Piovesana <pi...@esteco.com>
wrote:

> 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.
>

Re: run garbage collector through RepositoryManagementMBean

Posted by Marcel Reutegger <mr...@adobe.com.INVALID>.
Hi,

On 10/01/18 17:36, Marco Piovesana wrote:
> 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".
> [...] 
> What is the correct way to run the garbage collector?

You obtain the garbage collectors directly from the DocumentNodeStore. 
The DocumentNodeStoreService shows how this is done. Please note, you 
also have to schedule tasks to periodically call the Journal GC (on one 
node in the cluster) and the LastRevRecoveryAgent (on each node in the 
cluster). Again, see the DocumentNodeStoreService for an example how 
this is done.

Regards
  Marcel