Hi Marco,

On 05/11/17 18:37, Marco Piovesana wrote:
I've seen that there are three types of garbage collectors: version, journal and blob. Do I have to call them all?

No, you only have to take care of scheduling the Revision GC and the Blob GC. The Journal GC is scheduled automatically by the implementation.

If yes, there's a specific order that I should keep? For my trial I
did this:

The Blob GC will potentially be able to remove more blobs when scheduled after the Revision GC. However, a common schedule I see is Revision GC once a day and Blob GC once a week (e.g. on the weekend). So it doesn't matter that much which one runs first.

documentNodeStore.getVersionGarbageCollector().gc(1, TimeUnit.DAYS);

This works, but I would recommend you use the RepositoryManagementMBean, which is considered public and stable, whereas the method you are using is considered internal and subject to change between releases.

documentNodeStore.getJournalGarbageCollector().gc(1, TimeUnit.DAYS);

As mentioned already, this is not necessary.

long oneDay = TimeUnit.SECONDS.convert(1, TimeUnit.DAYS); documentNodeStore.createBlobGarbageCollector(oneDay, ClusterRepositoryInfo. getOrCreateId(documentNodeStore)).collectGarbage(false);

My recommendation again is to use RepositoryManagementMBean. There's a startDataStoreGC() method. This avoids using implementation specific classes.

Regards
 Marcel

Reply via email to