-1

I am using JackRabbit Oak(1.22.3) implementation for deleting nodes using Version garbage collection. I am setting below custom values for garbage collection.

VersionGCOptions versionGCOptions = new VersionGCOptions();
versionGCOptions.withOverflowToDiskThreshold(900000);
versionGCOptions.withCollectLimit(900000L);
versionGCOptions.withMaxIterations(10);
documentNodeStore.getVersionGarbageCollector().setOptions(versionGCOptions);

But when I am trying to get above values, I am getting default values not custom values:

System.out.println("collectLimit : "+versionGarbageCollector.getOptions().collectLimit);
System.out.println("maxIterations : "+versionGarbageCollector.getOptions().maxIterations);

**output:-**
collectLimit : 100000
maxIterations : 0

I am not getting why this is happening, please help me here to resolve this.

abn
  • 41
  • 1
  • 8

1 Answers1

1

The "with...()" methods return a new VersionGCOptions object (they do not modify the existing one).

Thus you need to do something like:

versionGCOptions = versionGCOptions.withOverflowToDiskThreshold(900000);
Julian Reschke
  • 40,156
  • 8
  • 95
  • 98
  • how to modify existing VersionGCOptions object? – abn Jul 23 '20 at 04:39
  • I want 900000 as collectLimit but it is taking default 100000 only. – abn Jul 23 '20 at 07:30
  • I am getting below warning and version GC is getting stop with DocumentStoreException. So I have to increase document collect limit, is this possible in JackRabbit OAK, if yes, How? Warning :- Limit 100000 documents exceeded, reducing next collection interval to 43236 seconds – abn Jul 26 '20 at 11:57
  • I think you need to explain what problem you're trying to solve. – Julian Reschke Jul 26 '20 at 12:48
  • When I am trying to run version garbage collection with revision of 1 day, it is throwing DocumentStoreException(with warning - Limit 100000 documents exceeded) and then Version GC is not happening. It seems document collection has limit of 100000, and when it reached to above it, it is stopping version GC. My point was , how I can increase this document collection limit or what can I do to run version GC smoothly without exception? – abn Jul 26 '20 at 15:15
  • The Garbage collection is supposed to run properly with default values. If you can reproduce this problem, try to write an Oak junit test and then open a ticket over on the Apache Jackrabbit Oak JIRA. – Julian Reschke Jul 26 '20 at 16:33