FrancoisZhang commented on a change in pull request #520:
URL: https://github.com/apache/jackrabbit-oak/pull/520#discussion_r828228769
##########
File path:
oak-run/src/main/java/org/apache/jackrabbit/oak/indexversion/PurgeOldIndexVersion.java
##########
@@ -38,43 +43,59 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
public class PurgeOldIndexVersion {
private static final Logger LOG =
LoggerFactory.getLogger(PurgeOldIndexVersion.class);
- public void execute(Options opts, long purgeThresholdMillis, List<String>
indexPaths) throws Exception {
- boolean isReadWriteRepository = opts.getCommonOpts().isReadWrite();
+ /**
+ * Execute purging index based on the index version naming and last time
index time
+ *
+ * @param nodeStore the node store
+ * @param isReadWriteRepository bool to indicate if it's read write
repository, if yes, the purge index will not execute
+ * @param purgeThresholdMillis the threshold of time length since last
time index time to determine, will purge if exceed that
+ * @param indexPaths the index path or parent path
+ *
+ * @throws IOException
+ * @throws CommitFailedException
+ */
+ public void execute(NodeStore nodeStore, boolean isReadWriteRepository,
long purgeThresholdMillis, List<String> indexPaths) throws IOException,
CommitFailedException {
if (!isReadWriteRepository) {
- LOG.info("Repository connected in read-only mode. Use
'--read-write' for write operations");
+ LOG.info("Repository is opened in read-only mode");
+ return;
Review comment:
@thomasmueller yes, getting the list index is done in getPurgeIndexes
and it will work when call from tools image. yes, I think makes sense to also
list the indexes in oak run command line. will fix it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]