@Test public void info() throws Exception { LuceneIndexDefinitionBuilder defnBuilder = new LuceneIndexDefinitionBuilder(); NodeBuilder builder = store.getRoot().builder(); builder.child("oak:index").setChildNode("fooIndex", defnBuilder.build()); store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY); when(asyncService.getInfo("async")) .thenReturn(new AsyncIndexInfo("async", 0,0, false, null)); IndexInfo info = provider.getInfo("/oak:index/fooIndex"); assertNotNull(info); }
@Override public IndexInfo getInfo(String indexPath) throws IOException { NodeState idxState = NodeStateUtils.getNode(nodeStore.getRoot(), indexPath); checkArgument(LuceneIndexConstants.TYPE_LUCENE.equals(idxState.getString(IndexConstants.TYPE_PROPERTY_NAME)), "Index definition at [%s] is not of type 'lucene'", indexPath); LuceneIndexInfo info = new LuceneIndexInfo(indexPath); computeSize(idxState, info); computeIndexDefinitionChange(idxState, info); computeLastUpdatedTime(idxState, info); computeAsyncIndexInfo(idxState, indexPath, info); return info; }
LuceneIndexInfoProvider implements IndexInfoProvider { @Override public IndexInfo getInfo(String indexPath) throws IOException { NodeState idxState = NodeStateUtils.getNode(nodeStore.getRoot(), indexPath); checkArgument(LuceneIndexConstants.TYPE_LUCENE.equals(idxState.getString(IndexConstants.TYPE_PROPERTY_NAME)), "Index definition at [%s] is not of type 'lucene'", indexPath); LuceneIndexInfo info = new LuceneIndexInfo(indexPath); computeSize(idxState, info); computeIndexDefinitionChange(idxState, info); computeLastUpdatedTime(idxState, info); computeAsyncIndexInfo(idxState, indexPath, info); return info; } }
LuceneIndexInfoProvider implements IndexInfoProvider { @Override public IndexInfo getInfo(String indexPath) throws IOException { NodeState idxState = NodeStateUtils.getNode(nodeStore.getRoot(), indexPath); checkArgument(LuceneIndexConstants.TYPE_LUCENE.equals(idxState.getString(IndexConstants.TYPE_PROPERTY_NAME)), "Index definition at [%s] is not of type 'lucene'", indexPath); LuceneIndexInfo info = new LuceneIndexInfo(indexPath); computeSize(idxState, info); computeIndexDefinitionChange(idxState, info); computeLastUpdatedTime(idxState, info); computeAsyncIndexInfo(idxState, indexPath, info); return info; } LuceneIndexInfoProvider(NodeStore nodeStore, AsyncIndexInfoService asyncInfoService, File workDir); }
LuceneIndexInfoProvider implements IndexInfoProvider { @Override public IndexInfo getInfo(String indexPath) throws IOException { NodeState idxState = NodeStateUtils.getNode(nodeStore.getRoot(), indexPath); checkArgument(LuceneIndexConstants.TYPE_LUCENE.equals(idxState.getString(IndexConstants.TYPE_PROPERTY_NAME)), "Index definition at [%s] is not of type 'lucene'", indexPath); LuceneIndexInfo info = new LuceneIndexInfo(indexPath); computeSize(idxState, info); computeIndexDefinitionChange(idxState, info); computeLastUpdatedTime(idxState, info); computeAsyncIndexInfo(idxState, indexPath, info); return info; } LuceneIndexInfoProvider(NodeStore nodeStore, AsyncIndexInfoService asyncInfoService, File workDir); @Override String getType(); @Override IndexInfo getInfo(String indexPath); @Override boolean isValid(String indexPath); }
LuceneIndexInfoProvider implements IndexInfoProvider { @Override public IndexInfo getInfo(String indexPath) throws IOException { NodeState idxState = NodeStateUtils.getNode(nodeStore.getRoot(), indexPath); checkArgument(LuceneIndexConstants.TYPE_LUCENE.equals(idxState.getString(IndexConstants.TYPE_PROPERTY_NAME)), "Index definition at [%s] is not of type 'lucene'", indexPath); LuceneIndexInfo info = new LuceneIndexInfo(indexPath); computeSize(idxState, info); computeIndexDefinitionChange(idxState, info); computeLastUpdatedTime(idxState, info); computeAsyncIndexInfo(idxState, indexPath, info); return info; } LuceneIndexInfoProvider(NodeStore nodeStore, AsyncIndexInfoService asyncInfoService, File workDir); @Override String getType(); @Override IndexInfo getInfo(String indexPath); @Override boolean isValid(String indexPath);  }