Last active
September 18, 2017 15:27
-
-
Save chetanmeh/bca50463d3036089a90047591e8316e2 to your computer and use it in GitHub Desktop.
Last Rev Recovery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.common.base.Stopwatch | |
import org.apache.jackrabbit.oak.spi.state.NodeStore | |
import org.slf4j.Logger | |
import org.slf4j.LoggerFactory | |
NodeStore ns = getStore() | |
def agent = ns.getLastRevRecoveryAgent() | |
def lastRevUtil = agent.missingLastRevUtil | |
def time = 1504742400000 | |
def endTime = System.currentTimeMillis() | |
Stopwatch w = Stopwatch.createStarted() | |
Logger log = LoggerFactory.getLogger("org.apache.jackrabbit.oak.plugins.document") | |
log.info("===== Starting recovery") | |
assert ns.clusterId != 4 : "ClusterId should not be 1" | |
def count = agent.recoverCandidates(4, time) | |
log.info("===== Recovery completed in $w for $count nodes") | |
def getStore(){ | |
osgi.getService(org.apache.sling.jcr.api.SlingRepository.class).manager.store | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment