use of org.apache.jackrabbit.oak.run.cli.NodeStoreFixture in project jackrabbit-oak by apache.
the class IndexCommand method performReindexInReadOnlyMode.
private File performReindexInReadOnlyMode(IndexOptions indexOpts, String checkpoint) throws Exception {
try (Closer closer = Closer.create()) {
configureCustomizer(opts, closer, true);
NodeStoreFixture fixture = NodeStoreFixtureProvider.create(opts, true);
closer.register(fixture);
IndexHelper indexHelper = createIndexHelper(fixture, indexOpts, closer);
reindex(indexOpts, indexHelper, checkpoint);
return new File(indexOpts.getOutDir(), OutOfBandIndexer.LOCAL_INDEX_ROOT_DIR);
}
}
use of org.apache.jackrabbit.oak.run.cli.NodeStoreFixture in project jackrabbit-oak by apache.
the class NodeStateExportCommand method execute.
@Override
public void execute(String... args) throws Exception {
Stopwatch w = Stopwatch.createStarted();
OptionParser parser = new OptionParser();
Options opts = new Options();
opts.setCommandName(NAME);
opts.setSummary(summary);
opts.registerOptionsFactory(ExportOptions.FACTORY);
opts.setConnectionString(CommonOptions.DEFAULT_CONNECTION_STRING);
opts.parseAndConfigure(parser, args);
ExportOptions eo = opts.getOptionBean(ExportOptions.class);
try (NodeStoreFixture fixture = NodeStoreFixtureProvider.create(opts)) {
NodeStateSerializer serializer = new NodeStateSerializer(fixture.getStore().getRoot());
serializer.setDepth(eo.getDepth());
serializer.setPath(eo.getPath());
serializer.setFilter(eo.getFilter());
serializer.setFilterFile(eo.getFilterFile());
serializer.setFormat(eo.getFormat());
serializer.setMaxChildNodes(eo.getMaxChildNodes());
serializer.setPrettyPrint(eo.isPrettyPrint());
serializer.setSerializeBlobContent(eo.includeBlobs());
File dir = eo.getOutDir();
serializer.serialize(dir);
System.out.printf("Export the nodes under path [%s] to file [%s] in %s%n", eo.getPath(), dir.getAbsolutePath(), w);
}
}
Aggregations