Skip to content

Commit 0f4f4f0

Browse files
author
Rishabh Kumar
committed
OAK-11453 : changed variable name for setting full gc max revision age
1 parent f77284a commit 0f4f4f0

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

oak-run/src/main/java/org/apache/jackrabbit/oak/run/RevisionsCommand.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ private static class RevisionsOptions extends Utils.NodeStoreOptions {
121121
final OptionSpec<Long> olderThan;
122122
final OptionSpec<Double> delay;
123123
final OptionSpec<Double> fullGcDelayFactor;
124-
final OptionSpec<Long> fullGcMaxAgeInSecs;
124+
final OptionSpec<Long> fullGcMaxAge;
125125
final OptionSpec<?> continuous;
126126
final OptionSpec<?> fullGCOnly;
127127
final OptionSpec<Boolean> resetFullGC;
@@ -191,10 +191,10 @@ private static class RevisionsOptions extends Utils.NodeStoreOptions {
191191
fullGcProgressSize = parser.accepts("fullGcProgressSize", "The number of documents to check for " +
192192
"garbage in each Full GC cycle")
193193
.withRequiredArg().ofType(Integer.class).defaultsTo(10000);
194-
fullGcMaxAgeInSecs = parser.accepts("fullGcMaxAgeInSecs", "The maximum age of the document in seconds " +
194+
fullGcMaxAge = parser.accepts("fullGcMaxAge", "The maximum age of the document in seconds " +
195195
"to be considered for Full GC i.e. Version Garbage Collector (Full GC) logic will only consider those " +
196-
"nodes for Full GC which are not accessed recently (currentTime - lastModifiedTime > fullGcMaxAgeInSecs)")
197-
.withOptionalArg().ofType(Long.class).defaultsTo(86400L);
196+
"nodes for Full GC which are not accessed recently (currentTime - lastModifiedTime > fullGcMaxAge)")
197+
.withOptionalArg().ofType(Long.class).defaultsTo(TimeUnit.DAYS.toMillis(1));
198198
}
199199

200200
public RevisionsOptions parse(String[] args) {
@@ -238,8 +238,8 @@ int getFullGcProgressSize() {
238238
return fullGcProgressSize.value(options);
239239
}
240240

241-
long getFullGcMaxAgeInSecs() {
242-
return fullGcMaxAgeInSecs.value(options);
241+
long getFullGcMaxAge() {
242+
return fullGcMaxAge.value(options);
243243
}
244244

245245
double getFullGcDelayFactor() {
@@ -357,7 +357,7 @@ private VersionGarbageCollector bootstrapVGC(RevisionsOptions options, Closer cl
357357
builder.setFullGCDelayFactor(options.getFullGcDelayFactor());
358358
builder.setFullGCBatchSize(options.getFullGcBatchSize());
359359
builder.setFullGCProgressSize(options.getFullGcProgressSize());
360-
builder.setFullGcMaxAgeMillis(SECONDS.toMillis(options.getFullGcMaxAgeInSecs()));
360+
builder.setFullGcMaxAgeMillis(SECONDS.toMillis(options.getFullGcMaxAge()));
361361

362362
// create a VersionGCSupport while builder is read-write
363363
VersionGCSupport gcSupport = builder.createVersionGCSupport();
@@ -389,7 +389,7 @@ private VersionGarbageCollector bootstrapVGC(RevisionsOptions options, Closer cl
389389
System.out.println("FullGcDelayFactory is : " + options.getFullGcDelayFactor());
390390
System.out.println("FullGcBatchSize is : " + options.getFullGcBatchSize());
391391
System.out.println("FullGcProgressSize is : " + options.getFullGcProgressSize());
392-
System.out.println("FullGcMaxAgeInSecs is : " + options.getFullGcMaxAgeInSecs());
392+
System.out.println("FullGcMaxAgeInSecs is : " + options.getFullGcMaxAge());
393393
System.out.println("FullGcMaxAgeMillis is : " + builder.getFullGcMaxAgeMillis());
394394
VersionGarbageCollector gc = createVersionGC(builder.build(), gcSupport, options.isDryRun(), builder);
395395

oak-run/src/test/java/org/apache/jackrabbit/oak/plugins/document/RevisionsCommandTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public void fullGC() {
209209
public void fullGCWithMaxAgeInSecs() {
210210
ns.dispose();
211211

212-
String output = captureSystemOut(new RevisionsCmd("fullGC", "--fullGcMaxAgeInSecs", "10000", "--entireRepo"));
212+
String output = captureSystemOut(new RevisionsCmd("fullGC", "--fullGcMaxAge", "10000", "--entireRepo"));
213213
assertTrue(output.contains("FullGcMaxAgeInSecs is : 10000"));
214214
assertTrue(output.contains("FullGcMaxAgeMillis is : 10000000"));
215215
assertTrue(output.contains("starting gc collect"));

0 commit comments

Comments
 (0)