This is an automated email from the ASF dual-hosted git repository.
thomasm pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
The following commit(s) were added to refs/heads/trunk by this push:
new a4ca2a5b7a OAK-10518 IndexInfo should have a isActive() method (#1180)
a4ca2a5b7a is described below
commit a4ca2a5b7a719b25044fa9dc479df8e5a6ad40c6
Author: Thomas Mueller <[email protected]>
AuthorDate: Thu Oct 26 13:04:32 2023 +0200
OAK-10518 IndexInfo should have a isActive() method (#1180)
* OAK-10518 IndexInfo should have a isActive() method
* Update
oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexInfoServiceImpl.java
Co-authored-by: Nuno Santos <[email protected]>
* OAK-10518 IndexInfo should have a isActive() method
---------
Co-authored-by: Nuno Santos <[email protected]>
---
.../jackrabbit/oak/plugins/index/IndexInfo.java | 11 +++++
.../oak/plugins/index/IndexInfoServiceImpl.java | 26 ++++++++++-
.../jackrabbit/oak/plugins/index}/IndexName.java | 3 +-
.../oak/plugins/index/IndexPathService.java | 9 ++++
.../oak/plugins/index/IndexPathServiceImpl.java | 7 ++-
.../oak/plugins/index/inventory/IndexPrinter.java | 1 +
.../index/property/PropertyIndexInfoProvider.java | 10 +++++
.../plugins/index/inventory/IndexPrinterTest.java | 10 +++++
.../index/lucene/LuceneIndexInfoProvider.java | 11 +++++
.../composite/blueGreen/CustomizedIndexTest.java | 50 ++++++++++++++++++++++
.../oak/composite/blueGreen/Persistence.java | 6 ++-
.../oak/indexversion/IndexVersionOperation.java | 2 +-
.../oak/indexversion/PurgeOldIndexVersion.java | 2 +-
.../oak/indexversion/PurgeOldVersionUtils.java | 2 +-
.../indexversion/ElasticIndexVersionOperation.java | 2 +-
.../indexversion/ElasticPurgeOldIndexVersion.java | 2 +-
.../oak/index/merge/IndexDefMergerUtils.java | 2 +-
.../jackrabbit/oak/index/merge/IndexDiff.java | 2 +-
.../indexversion/LuceneIndexVersionOperation.java | 2 +-
.../indexversion/LucenePurgeOldIndexVersion.java | 3 +-
.../index/elastic/ElasticIndexInfoProvider.java | 10 +++++
.../index/search/spi/query/FulltextIndex.java | 7 +--
.../plugins/index/search/spi/query/IndexName.java | 13 ++----
.../index/search/spi/query/IndexNameTest.java | 1 +
24 files changed, 166 insertions(+), 28 deletions(-)
diff --git
a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexInfo.java
b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexInfo.java
index 1746dde26b..f5f79a4dcc 100644
---
a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexInfo.java
+++
b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexInfo.java
@@ -103,6 +103,17 @@ public interface IndexInfo {
*/
boolean hasPropertyIndexNode();
+ /**
+ * Sets whether an index is active (can be used for queries)
+ */
+ void setActive(boolean value);
+
+ /**
+ * Determines if the index is active (can be used for queries)
+ * @return true if yes
+ */
+ boolean isActive();
+
/**
* Index suggest data storage size
* @return storage size or -1 if unknown
diff --git
a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexInfoServiceImpl.java
b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexInfoServiceImpl.java
index 2b6e76f359..c263bc767a 100644
---
a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexInfoServiceImpl.java
+++
b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexInfoServiceImpl.java
@@ -20,6 +20,7 @@
package org.apache.jackrabbit.oak.plugins.index;
import java.io.IOException;
+import java.util.HashSet;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@@ -62,11 +63,23 @@ public class IndexInfoServiceImpl implements
IndexInfoService{
@Override
public Iterable<IndexInfo> getAllIndexInfo() {
+ HashSet<String> allIndexes = new HashSet<>();
+ indexPathService.getIndexPaths().forEach(allIndexes::add);
+ HashSet<String> activeIndexes = new HashSet<>();
+ if (indexPathService.getMountInfoProvider().hasNonDefaultMounts()) {
+ activeIndexes.addAll(IndexName.filterReplacedIndexes(allIndexes,
nodeStore.getRoot(), true));
+ } else {
+ activeIndexes.addAll(allIndexes);
+ }
return
Iterables.filter(Iterables.transform(indexPathService.getIndexPaths(), new
Function<String, IndexInfo>() {
@Override
public IndexInfo apply(String indexPath) {
try {
- return getInfo(indexPath);
+ IndexInfo info = getInfo(indexPath);
+ if (info != null) {
+ info.setActive(activeIndexes.contains(indexPath));
+ }
+ return info;
} catch (Exception e) {
log.warn("Error occurred while capturing IndexInfo for
path {}", indexPath, e);
return null;
@@ -129,6 +142,7 @@ public class IndexInfoServiceImpl implements
IndexInfoService{
private static class SimpleIndexInfo implements IndexInfo {
private final String indexPath;
private final String type;
+ private boolean isActive;
private SimpleIndexInfo(String indexPath, String type) {
this.indexPath = indexPath;
@@ -203,5 +217,15 @@ public class IndexInfoServiceImpl implements
IndexInfoService{
public long getReindexCompletionTimestamp() {
return -1;
}
+
+ @Override
+ public void setActive(boolean value) {
+ isActive = value;
+ }
+
+ @Override
+ public boolean isActive() {
+ return isActive;
+ }
}
}
diff --git
a/oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/spi/query/IndexName.java
b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexName.java
similarity index 98%
copy from
oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/spi/query/IndexName.java
copy to
oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexName.java
index d3cbab5858..6ad2005a56 100644
---
a/oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/spi/query/IndexName.java
+++
b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexName.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.jackrabbit.oak.plugins.index.search.spi.query;
+package org.apache.jackrabbit.oak.plugins.index;
import java.util.ArrayList;
import java.util.Collection;
@@ -27,7 +27,6 @@ import java.util.List;
import org.apache.jackrabbit.oak.api.PropertyState;
import org.apache.jackrabbit.oak.api.Type;
import org.apache.jackrabbit.oak.commons.PathUtils;
-import org.apache.jackrabbit.oak.plugins.index.IndexConstants;
import org.apache.jackrabbit.oak.spi.state.NodeState;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git
a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexPathService.java
b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexPathService.java
index f00bfc6841..2b19a78156 100644
---
a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexPathService.java
+++
b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexPathService.java
@@ -19,6 +19,8 @@
package org.apache.jackrabbit.oak.plugins.index;
+import org.apache.jackrabbit.oak.spi.mount.MountInfoProvider;
+import org.apache.jackrabbit.oak.spi.mount.Mounts;
public interface IndexPathService {
@@ -27,4 +29,11 @@ public interface IndexPathService {
*/
Iterable<String> getIndexPaths();
+ /**
+ * Get the mount info provider
+ */
+ default MountInfoProvider getMountInfoProvider() {
+ return Mounts.defaultMountInfoProvider();
+ }
+
}
diff --git
a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexPathServiceImpl.java
b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexPathServiceImpl.java
index 4ea6e79ae5..9b9dd6314c 100644
---
a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexPathServiceImpl.java
+++
b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexPathServiceImpl.java
@@ -22,7 +22,6 @@ package org.apache.jackrabbit.oak.plugins.index;
import java.util.Iterator;
import org.apache.jackrabbit.guava.common.collect.Iterables;
-import org.apache.jackrabbit.guava.common.collect.Iterators;
import org.apache.jackrabbit.oak.commons.PathUtils;
import org.apache.jackrabbit.oak.plugins.index.nodetype.NodeTypeIndexProvider;
import org.apache.jackrabbit.oak.query.NodeStateNodeTypeInfoProvider;
@@ -35,7 +34,6 @@ import org.apache.jackrabbit.oak.spi.mount.MountInfoProvider;
import org.apache.jackrabbit.oak.spi.mount.Mounts;
import org.apache.jackrabbit.oak.spi.query.IndexRow;
import org.apache.jackrabbit.oak.spi.query.QueryIndex;
-import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
import org.apache.jackrabbit.oak.spi.state.NodeState;
import org.apache.jackrabbit.oak.spi.state.NodeStateUtils;
import org.apache.jackrabbit.oak.spi.state.NodeStore;
@@ -116,4 +114,9 @@ public class IndexPathServiceImpl implements
IndexPathService {
idxProvider.with(mountInfoProvider);
return idxProvider.getQueryIndexes(nodeStore.getRoot()).get(0);
}
+
+ @Override
+ public MountInfoProvider getMountInfoProvider() {
+ return mountInfoProvider;
+ }
}
diff --git
a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/inventory/IndexPrinter.java
b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/inventory/IndexPrinter.java
index 2b920843bf..0128c2c374 100644
---
a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/inventory/IndexPrinter.java
+++
b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/inventory/IndexPrinter.java
@@ -163,6 +163,7 @@ public class IndexPrinter implements InventoryPrinter {
po.text("Has hidden oak mount", info.hasHiddenOakLibsMount());
po.text("Has property index", info.hasPropertyIndexNode());
}
+ po.text("Is active", info.isActive());
if (info.hasIndexDefinitionChangedWithoutReindexing()) {
String diff = info.getIndexDefinitionDiff();
diff --git
a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexInfoProvider.java
b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexInfoProvider.java
index 8cde72574a..f1921a9502 100644
---
a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexInfoProvider.java
+++
b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexInfoProvider.java
@@ -156,6 +156,16 @@ public class PropertyIndexInfoProvider implements
IndexInfoProvider {
return false;
}
+ @Override
+ public boolean isActive() {
+ return true;
+ }
+
+ @Override
+ public void setActive(boolean value) {
+ // ignore
+ }
+
@Override
public long getSuggestSizeInBytes() {
return -1;
diff --git
a/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/inventory/IndexPrinterTest.java
b/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/inventory/IndexPrinterTest.java
index 93c5162d93..8c8a406e10 100644
---
a/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/inventory/IndexPrinterTest.java
+++
b/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/inventory/IndexPrinterTest.java
@@ -203,6 +203,16 @@ public class IndexPrinterTest {
public long getReindexCompletionTimestamp() {
return 0;
}
+
+ @Override
+ public void setActive(boolean value) {
+ // ignore
+ }
+
+ @Override
+ public boolean isActive() {
+ return true;
+ }
}
}
diff --git
a/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexInfoProvider.java
b/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexInfoProvider.java
index 69a94185f2..91d47c333b 100644
---
a/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexInfoProvider.java
+++
b/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexInfoProvider.java
@@ -199,6 +199,7 @@ public class LuceneIndexInfoProvider implements
IndexInfoProvider {
String indexDiff;
boolean hasHiddenOakLibsMount;
boolean hasPropertyIndexNode;
+ boolean isActive;
long suggestSize;
long creationTimestamp;
long reindexCompletionTimestamp;
@@ -262,6 +263,16 @@ public class LuceneIndexInfoProvider implements
IndexInfoProvider {
return hasPropertyIndexNode;
}
+ @Override
+ public void setActive(boolean value) {
+ isActive = value;
+ }
+
+ @Override
+ public boolean isActive() {
+ return isActive;
+ }
+
@Override
public long getSuggestSizeInBytes() {
return suggestSize;
diff --git
a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/composite/blueGreen/CustomizedIndexTest.java
b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/composite/blueGreen/CustomizedIndexTest.java
index 404e8c2bc0..3eac5e3399 100644
---
a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/composite/blueGreen/CustomizedIndexTest.java
+++
b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/composite/blueGreen/CustomizedIndexTest.java
@@ -18,11 +18,22 @@
*/
package org.apache.jackrabbit.oak.composite.blueGreen;
+import static org.junit.Assert.assertEquals;
+
import java.io.File;
import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
import javax.jcr.Node;
+import org.apache.jackrabbit.oak.plugins.index.IndexInfo;
+import org.apache.jackrabbit.oak.plugins.index.IndexInfoServiceImpl;
+import org.apache.jackrabbit.oak.plugins.index.IndexPathServiceImpl;
+import org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexConstants;
+import org.apache.jackrabbit.oak.spi.mount.MountInfoProvider;
+import org.apache.jackrabbit.oak.spi.state.NodeStore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
@@ -81,11 +92,19 @@ public class CustomizedIndexTest {
private void compositeLibs1() throws Exception {
Persistence p = Persistence.openComposite(globalDir, libs1Dir, config);
IndexUtils.checkLibsIsReadOnly(p);
+ assertEquals("[/oak:index/lucene]",
+ getActiveLuceneIndexes(p).toString());
+
p.session.getRootNode().getNode("oak:index").getNode("lucene").remove();
+ p.session.save();
+ assertEquals("[]",
+ getActiveLuceneIndexes(p).toString());
IndexUtils.createIndex(p, "test-1", "foo", 10);
IndexUtils.assertQueryUsesIndexAndReturns(p,
"/jcr:root//*[@foo] order by @jcr:path",
"test-1",
"[/content/test, /libs/test]");
+ assertEquals("[/oak:index/test-1]",
+ getActiveLuceneIndexes(p).toString());
p.close();
}
@@ -100,6 +119,8 @@ public class CustomizedIndexTest {
"/jcr:root//*[@foo] order by @jcr:path",
"test-2",
"[/content/test, /libs/test2]");
+ assertEquals("[/oak:index/lucene, /oak:index/test-2]",
+ getActiveLuceneIndexes(p).toString());
p.close();
// the new index must not be used in the old version (with libs1)
@@ -108,6 +129,8 @@ public class CustomizedIndexTest {
"/jcr:root//*[@foo] order by @jcr:path",
"test-1",
"[/content/test, /libs/test]");
+ assertEquals("[/oak:index/lucene, /oak:index/test-1]",
+ getActiveLuceneIndexes(p).toString());
p.close();
}
@@ -129,6 +152,8 @@ public class CustomizedIndexTest {
"/jcr:root//*[@foo] order by @jcr:path",
"test-2-custom-1",
"[/content/test]");
+ assertEquals("[/oak:index/lucene, /oak:index/test-2-custom-1]",
+ getActiveLuceneIndexes(p).toString());
p.close();
// the merged index is not used in the old version (with libs1)
@@ -148,6 +173,8 @@ public class CustomizedIndexTest {
"/jcr:root//*[@foo] order by @jcr:path",
"test-2-custom-1",
"[/content/test]");
+ assertEquals("[/oak:index/lucene, /oak:index/test-2-custom-1]",
+ getActiveLuceneIndexes(p).toString());
p.close();
}
@@ -200,6 +227,8 @@ public class CustomizedIndexTest {
"/jcr:root//*[@foo] order by @jcr:path",
"test-3-custom-1",
"[/content/test]");
+ assertEquals("[/oak:index/lucene, /oak:index/test-3-custom-1]",
+ getActiveLuceneIndexes(p).toString());
}
private void createFolders() throws IOException {
@@ -211,4 +240,25 @@ public class CustomizedIndexTest {
indexDir = tempDir.newFolder("index");
}
+ private static Collection<String> getActiveLuceneIndexes(Persistence p) {
+ return getActiveLuceneIndexes(p.getCompositeNodestore(),
p.getMountInfoProvider());
+ }
+
+ private static Collection<String> getActiveLuceneIndexes(NodeStore ns,
MountInfoProvider m) {
+ ArrayList<String> list = new ArrayList<>();
+ IndexInfoServiceImpl indexService = new IndexInfoServiceImpl(ns,
+ new IndexPathServiceImpl(ns, m));
+ for (IndexInfo info : indexService.getAllIndexInfo()) {
+ if (!LuceneIndexConstants.TYPE_LUCENE.equals(info.getType())) {
+ continue;
+ }
+ if (!info.isActive()) {
+ continue;
+ }
+ list.add(info.getIndexPath());
+ }
+ Collections.sort(list);
+ return list;
+ }
+
}
diff --git
a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/composite/blueGreen/Persistence.java
b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/composite/blueGreen/Persistence.java
index c2ae5a5521..a91c513684 100644
---
a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/composite/blueGreen/Persistence.java
+++
b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/composite/blueGreen/Persistence.java
@@ -372,7 +372,11 @@ public class Persistence {
}
}
-
+
+ public MountInfoProvider getMountInfoProvider() {
+ return MOUNT_INFO_PROVIDER;
+ }
+
public static class Config {
public BlobStore blobStore;
public File indexDir;
diff --git
a/oak-run-commons/src/main/java/org/apache/jackrabbit/oak/indexversion/IndexVersionOperation.java
b/oak-run-commons/src/main/java/org/apache/jackrabbit/oak/indexversion/IndexVersionOperation.java
index 84cdf5b9ba..55a27a83b5 100644
---
a/oak-run-commons/src/main/java/org/apache/jackrabbit/oak/indexversion/IndexVersionOperation.java
+++
b/oak-run-commons/src/main/java/org/apache/jackrabbit/oak/indexversion/IndexVersionOperation.java
@@ -25,8 +25,8 @@ import java.util.List;
import org.apache.jackrabbit.oak.api.Type;
import org.apache.jackrabbit.oak.commons.PathUtils;
+import org.apache.jackrabbit.oak.plugins.index.IndexName;
import org.apache.jackrabbit.oak.plugins.index.search.IndexDefinition;
-import org.apache.jackrabbit.oak.plugins.index.search.spi.query.IndexName;
import org.apache.jackrabbit.oak.spi.state.NodeState;
import org.apache.jackrabbit.oak.spi.state.NodeStateUtils;
import org.jetbrains.annotations.Nullable;
diff --git
a/oak-run-commons/src/main/java/org/apache/jackrabbit/oak/indexversion/PurgeOldIndexVersion.java
b/oak-run-commons/src/main/java/org/apache/jackrabbit/oak/indexversion/PurgeOldIndexVersion.java
index 8a5e9ed3fe..083e7ac576 100644
---
a/oak-run-commons/src/main/java/org/apache/jackrabbit/oak/indexversion/PurgeOldIndexVersion.java
+++
b/oak-run-commons/src/main/java/org/apache/jackrabbit/oak/indexversion/PurgeOldIndexVersion.java
@@ -34,6 +34,7 @@ import org.apache.jackrabbit.oak.api.Type;
import org.apache.jackrabbit.oak.commons.PathUtils;
import org.apache.jackrabbit.oak.plugins.index.CompositeIndexEditorProvider;
import org.apache.jackrabbit.oak.plugins.index.IndexEditorProvider;
+import org.apache.jackrabbit.oak.plugins.index.IndexName;
import org.apache.jackrabbit.oak.plugins.index.IndexPathService;
import org.apache.jackrabbit.oak.plugins.index.IndexPathServiceImpl;
import org.apache.jackrabbit.oak.plugins.index.IndexUpdateProvider;
@@ -41,7 +42,6 @@ import
org.apache.jackrabbit.oak.plugins.index.counter.NodeCounterEditorProvider
import
org.apache.jackrabbit.oak.plugins.index.property.OrderedPropertyIndexEditorProvider;
import
org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditorProvider;
import
org.apache.jackrabbit.oak.plugins.index.reference.ReferenceEditorProvider;
-import org.apache.jackrabbit.oak.plugins.index.search.spi.query.IndexName;
import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
import org.apache.jackrabbit.oak.spi.commit.EditorHook;
import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
diff --git
a/oak-run-commons/src/main/java/org/apache/jackrabbit/oak/indexversion/PurgeOldVersionUtils.java
b/oak-run-commons/src/main/java/org/apache/jackrabbit/oak/indexversion/PurgeOldVersionUtils.java
index c8d88655d2..8c08ad9f87 100644
---
a/oak-run-commons/src/main/java/org/apache/jackrabbit/oak/indexversion/PurgeOldVersionUtils.java
+++
b/oak-run-commons/src/main/java/org/apache/jackrabbit/oak/indexversion/PurgeOldVersionUtils.java
@@ -20,9 +20,9 @@ package org.apache.jackrabbit.oak.indexversion;
import org.apache.jackrabbit.oak.api.CommitFailedException;
import org.apache.jackrabbit.oak.commons.PathUtils;
+import org.apache.jackrabbit.oak.plugins.index.IndexName;
import org.apache.jackrabbit.oak.plugins.index.property.RecursiveDelete;
import org.apache.jackrabbit.oak.plugins.index.search.IndexDefinition;
-import org.apache.jackrabbit.oak.plugins.index.search.spi.query.IndexName;
import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
import org.apache.jackrabbit.oak.spi.commit.EmptyHook;
import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
diff --git
a/oak-run-elastic/src/main/java/org/apache/jackrabbit/oak/indexversion/ElasticIndexVersionOperation.java
b/oak-run-elastic/src/main/java/org/apache/jackrabbit/oak/indexversion/ElasticIndexVersionOperation.java
index a4adb71754..5811b00539 100644
---
a/oak-run-elastic/src/main/java/org/apache/jackrabbit/oak/indexversion/ElasticIndexVersionOperation.java
+++
b/oak-run-elastic/src/main/java/org/apache/jackrabbit/oak/indexversion/ElasticIndexVersionOperation.java
@@ -18,7 +18,7 @@
*/
package org.apache.jackrabbit.oak.indexversion;
-import org.apache.jackrabbit.oak.plugins.index.search.spi.query.IndexName;
+import org.apache.jackrabbit.oak.plugins.index.IndexName;
import org.apache.jackrabbit.oak.spi.state.NodeState;
import java.util.List;
diff --git
a/oak-run-elastic/src/main/java/org/apache/jackrabbit/oak/indexversion/ElasticPurgeOldIndexVersion.java
b/oak-run-elastic/src/main/java/org/apache/jackrabbit/oak/indexversion/ElasticPurgeOldIndexVersion.java
index 5bf0c41f8b..799593f712 100644
---
a/oak-run-elastic/src/main/java/org/apache/jackrabbit/oak/indexversion/ElasticPurgeOldIndexVersion.java
+++
b/oak-run-elastic/src/main/java/org/apache/jackrabbit/oak/indexversion/ElasticPurgeOldIndexVersion.java
@@ -22,10 +22,10 @@ import
co.elastic.clients.elasticsearch.indices.DeleteIndexResponse;
import co.elastic.clients.elasticsearch.indices.ElasticsearchIndicesClient;
import org.apache.jackrabbit.oak.api.PropertyState;
import org.apache.jackrabbit.oak.api.Type;
+import org.apache.jackrabbit.oak.plugins.index.IndexName;
import org.apache.jackrabbit.oak.plugins.index.elastic.ElasticConnection;
import org.apache.jackrabbit.oak.plugins.index.elastic.ElasticIndexDefinition;
import org.apache.jackrabbit.oak.plugins.index.elastic.ElasticIndexNameHelper;
-import org.apache.jackrabbit.oak.plugins.index.search.spi.query.IndexName;
import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git
a/oak-run/src/main/java/org/apache/jackrabbit/oak/index/merge/IndexDefMergerUtils.java
b/oak-run/src/main/java/org/apache/jackrabbit/oak/index/merge/IndexDefMergerUtils.java
index 82c1e04d62..3736e3c7ea 100644
---
a/oak-run/src/main/java/org/apache/jackrabbit/oak/index/merge/IndexDefMergerUtils.java
+++
b/oak-run/src/main/java/org/apache/jackrabbit/oak/index/merge/IndexDefMergerUtils.java
@@ -31,7 +31,7 @@ import java.util.stream.Collectors;
import org.apache.jackrabbit.oak.commons.json.JsonObject;
import org.apache.jackrabbit.oak.commons.json.JsopBuilder;
-import org.apache.jackrabbit.oak.plugins.index.search.spi.query.IndexName;
+import org.apache.jackrabbit.oak.plugins.index.IndexName;
/**
* Utility that allows to merge index definitions.
diff --git
a/oak-run/src/main/java/org/apache/jackrabbit/oak/index/merge/IndexDiff.java
b/oak-run/src/main/java/org/apache/jackrabbit/oak/index/merge/IndexDiff.java
index c9fa91b17f..c20d4a4abc 100644
--- a/oak-run/src/main/java/org/apache/jackrabbit/oak/index/merge/IndexDiff.java
+++ b/oak-run/src/main/java/org/apache/jackrabbit/oak/index/merge/IndexDiff.java
@@ -39,7 +39,7 @@ import java.util.stream.Stream;
import org.apache.jackrabbit.oak.commons.PathUtils;
import org.apache.jackrabbit.oak.commons.json.JsonObject;
import org.apache.jackrabbit.oak.commons.json.JsopBuilder;
-import org.apache.jackrabbit.oak.plugins.index.search.spi.query.IndexName;
+import org.apache.jackrabbit.oak.plugins.index.IndexName;
/**
* The index diff tools allows to compare and merge indexes
diff --git
a/oak-run/src/main/java/org/apache/jackrabbit/oak/indexversion/LuceneIndexVersionOperation.java
b/oak-run/src/main/java/org/apache/jackrabbit/oak/indexversion/LuceneIndexVersionOperation.java
index 50f69561f4..7a3a127425 100644
---
a/oak-run/src/main/java/org/apache/jackrabbit/oak/indexversion/LuceneIndexVersionOperation.java
+++
b/oak-run/src/main/java/org/apache/jackrabbit/oak/indexversion/LuceneIndexVersionOperation.java
@@ -19,7 +19,7 @@
package org.apache.jackrabbit.oak.indexversion;
import org.apache.jackrabbit.oak.commons.PathUtils;
-import org.apache.jackrabbit.oak.plugins.index.search.spi.query.IndexName;
+import org.apache.jackrabbit.oak.plugins.index.IndexName;
import org.apache.jackrabbit.oak.spi.state.NodeState;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git
a/oak-run/src/main/java/org/apache/jackrabbit/oak/indexversion/LucenePurgeOldIndexVersion.java
b/oak-run/src/main/java/org/apache/jackrabbit/oak/indexversion/LucenePurgeOldIndexVersion.java
index 7805f8f595..c1cb0f2db5 100644
---
a/oak-run/src/main/java/org/apache/jackrabbit/oak/indexversion/LucenePurgeOldIndexVersion.java
+++
b/oak-run/src/main/java/org/apache/jackrabbit/oak/indexversion/LucenePurgeOldIndexVersion.java
@@ -18,11 +18,12 @@
*/
package org.apache.jackrabbit.oak.indexversion;
-import org.apache.jackrabbit.oak.plugins.index.search.spi.query.IndexName;
import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
import static
org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexConstants.TYPE_LUCENE;
+import org.apache.jackrabbit.oak.plugins.index.IndexName;
+
public class LucenePurgeOldIndexVersion extends PurgeOldIndexVersion {
@Override
protected String getIndexType() {
diff --git
a/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticIndexInfoProvider.java
b/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticIndexInfoProvider.java
index ddd80980f3..4df7a0bf07 100644
---
a/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticIndexInfoProvider.java
+++
b/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticIndexInfoProvider.java
@@ -197,5 +197,15 @@ class ElasticIndexInfoProvider implements
IndexInfoProvider {
public long getReindexCompletionTimestamp() {
return reindexCompletionTimestamp;
}
+
+ @Override
+ public void setActive(boolean value) {
+ // ignore
+ }
+
+ @Override
+ public boolean isActive() {
+ return true;
+ }
}
}
diff --git
a/oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/spi/query/FulltextIndex.java
b/oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/spi/query/FulltextIndex.java
index 6d1b2663bb..fe7d3f9727 100644
---
a/oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/spi/query/FulltextIndex.java
+++
b/oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/spi/query/FulltextIndex.java
@@ -26,6 +26,7 @@ import org.apache.jackrabbit.oak.api.Type;
import org.apache.jackrabbit.oak.commons.PathUtils;
import org.apache.jackrabbit.oak.commons.json.JsopBuilder;
import org.apache.jackrabbit.oak.commons.json.JsopWriter;
+import org.apache.jackrabbit.oak.plugins.index.IndexName;
import org.apache.jackrabbit.oak.plugins.index.cursor.Cursors;
import org.apache.jackrabbit.oak.plugins.index.cursor.PathCursor;
import org.apache.jackrabbit.oak.plugins.index.search.IndexLookup;
@@ -94,9 +95,9 @@ public abstract class FulltextIndex implements
AdvancedQueryIndex, QueryIndex, N
*/
protected abstract boolean filterReplacedIndexes();
- /*
- * Whether the isActiveIndex check should run during filtering of replaced
indexes.
- *
+ /**
+ * Whether the isActiveIndex check should run during filtering of replaced
indexes.
+ *
*/
protected abstract boolean runIsActiveIndexCheck();
diff --git
a/oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/spi/query/IndexName.java
b/oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/spi/query/IndexName.java
index d3cbab5858..b19fb0f174 100644
---
a/oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/spi/query/IndexName.java
+++
b/oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/spi/query/IndexName.java
@@ -33,17 +33,10 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * An index name, which possibly contains two version numbers: the product
- * version number, and the customer version number.
- *
- * The format of an index node name is:
- * - The name of the index,
- * - optionally a dash ('-') and the product version number,
- * - optionally "-custom-" and the customer version number.
- *
- * If the node name doesn't contain version numbers / dashes, then version 0 is
- * assumed (for both the product version number and customer version number).
+ * @deprecated
+ * Use oak-core org.apache.jackrabbit.oak.plugins.index.IndexName instead.
*/
+@Deprecated(since = "1.60.0", forRemoval = true)
public class IndexName implements Comparable<IndexName> {
private final static Logger LOG = LoggerFactory.getLogger(IndexName.class);
diff --git
a/oak-search/src/test/java/org/apache/jackrabbit/oak/plugins/index/search/spi/query/IndexNameTest.java
b/oak-search/src/test/java/org/apache/jackrabbit/oak/plugins/index/search/spi/query/IndexNameTest.java
index 02ed726c64..1135772def 100644
---
a/oak-search/src/test/java/org/apache/jackrabbit/oak/plugins/index/search/spi/query/IndexNameTest.java
+++
b/oak-search/src/test/java/org/apache/jackrabbit/oak/plugins/index/search/spi/query/IndexNameTest.java
@@ -24,6 +24,7 @@ import static org.junit.Assert.fail;
import static
org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState.EMPTY_NODE;
import org.apache.jackrabbit.oak.commons.junit.LogCustomizer;
+import org.apache.jackrabbit.oak.plugins.index.IndexName;
import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
import org.apache.jackrabbit.oak.spi.state.NodeState;
import org.junit.Test;