use of org.apache.jackrabbit.oak.plugins.index.importer.IndexDefinitionUpdater in project jackrabbit-oak by apache.
the class IndexCommand method computeIndexPaths.
private List<String> computeIndexPaths(IndexOptions indexOpts) throws IOException {
// Combine the indexPaths from json and cli args
Set<String> indexPaths = new LinkedHashSet<>(indexOpts.getIndexPaths());
File definitions = indexOpts.getIndexDefinitionsFile();
if (definitions != null) {
IndexDefinitionUpdater updater = new IndexDefinitionUpdater(definitions);
Set<String> indexPathsFromJson = updater.getIndexPaths();
Set<String> diff = Sets.difference(indexPathsFromJson, indexPaths);
if (!diff.isEmpty()) {
log.info("Augmenting the indexPaths with {} which are present in {}", diff, definitions);
}
indexPaths.addAll(indexPathsFromJson);
}
return new ArrayList<>(indexPaths);
}
use of org.apache.jackrabbit.oak.plugins.index.importer.IndexDefinitionUpdater in project jackrabbit-oak by apache.
the class ElasticIndexCommand method computeIndexPaths.
private List<String> computeIndexPaths(ElasticIndexOptions indexOpts) throws IOException {
// Combine the indexPaths from json and cli args
Set<String> indexPaths = new LinkedHashSet<>(indexOpts.getIndexPaths());
File definitions = indexOpts.getIndexDefinitionsFile();
if (definitions != null) {
IndexDefinitionUpdater updater = new IndexDefinitionUpdater(definitions);
Set<String> indexPathsFromJson = updater.getIndexPaths();
Set<String> diff = Sets.difference(indexPathsFromJson, indexPaths);
if (!diff.isEmpty()) {
log.info("Augmenting the indexPaths with {} which are present in {}", diff, definitions);
}
indexPaths.addAll(indexPathsFromJson);
}
return new ArrayList<>(indexPaths);
}
use of org.apache.jackrabbit.oak.plugins.index.importer.IndexDefinitionUpdater in project jackrabbit-oak by apache.
the class IndexDefinitionPrinterTest method binaryProps.
@Test
public void binaryProps() throws Exception {
NodeBuilder builder = store.getRoot().builder();
builder.child("a").setProperty("foo", new ArrayBasedBlob("hello".getBytes()));
store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
when(pathService.getIndexPaths()).thenReturn(Lists.newArrayList("/a"));
String json = getJSON();
IndexDefinitionUpdater updater = new IndexDefinitionUpdater(json);
assertTrue(updater.getIndexPaths().contains("/a"));
}
Aggregations