This is an automated email from the ASF dual-hosted git repository.
pinal pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/master by this push:
new 8c1b1430a ATLAS-4727: admin/audits , admin/purge APIs fail with
'[__AtlasAuditEntry.startTime] is not indexed in the targeted index
[vertex_index]'
8c1b1430a is described below
commit 8c1b1430a1fe21c2dc8cf30c619f93411cdac628
Author: Pinal Shah <[email protected]>
AuthorDate: Fri Jan 20 13:06:07 2023 +0530
ATLAS-4727: admin/audits , admin/purge APIs fail with
'[__AtlasAuditEntry.startTime] is not indexed in the targeted index
[vertex_index]'
Signed-off-by: Pinal Shah <[email protected]>
---
.../repository/store/graph/AtlasTypeDefGraphStore.java | 5 +++--
.../store/graph/v2/AtlasTypeDefGraphStoreV2.java | 3 ++-
.../src/test/java/org/apache/atlas/TestModules.java | 15 ++++++++++-----
3 files changed, 15 insertions(+), 8 deletions(-)
diff --git
a/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
b/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
index 8447ae2b4..c5e2448db 100644
---
a/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
+++
b/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
@@ -48,6 +48,7 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import java.util.LinkedHashSet;
import static
org.apache.atlas.model.discovery.SearchParameters.ALL_ENTITY_TYPES;
import static
org.apache.atlas.model.discovery.SearchParameters.ALL_CLASSIFICATION_TYPES;
@@ -67,9 +68,9 @@ public abstract class AtlasTypeDefGraphStore implements
AtlasTypeDefStore {
private final int typeUpdateLockMaxWaitTimeSeconds;
protected AtlasTypeDefGraphStore(AtlasTypeRegistry typeRegistry,
- Set<TypeDefChangeListener>
typeDefChangeListeners) {
+ List<TypeDefChangeListener>
typeDefChangeListenersList) {
this.typeRegistry = typeRegistry;
- this.typeDefChangeListeners = typeDefChangeListeners;
+ this.typeDefChangeListeners = new
LinkedHashSet<>(typeDefChangeListenersList);
this.typeUpdateLockMaxWaitTimeSeconds =
AtlasRepositoryConfiguration.getTypeUpdateLockMaxWaitTimeInSeconds();
}
diff --git
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasTypeDefGraphStoreV2.java
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasTypeDefGraphStoreV2.java
index 5da6fdefa..1a18e1684 100644
---
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasTypeDefGraphStoreV2.java
+++
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasTypeDefGraphStoreV2.java
@@ -50,6 +50,7 @@ import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
+import java.util.List;
import static org.apache.atlas.repository.Constants.TYPE_CATEGORY_PROPERTY_KEY;
import static org.apache.atlas.repository.Constants.VERTEX_TYPE_PROPERTY_KEY;
@@ -70,7 +71,7 @@ public class AtlasTypeDefGraphStoreV2 extends
AtlasTypeDefGraphStore {
@Inject
public AtlasTypeDefGraphStoreV2(AtlasTypeRegistry typeRegistry,
- Set<TypeDefChangeListener>
typeDefChangeListeners,
+ List<TypeDefChangeListener>
typeDefChangeListeners,
AtlasGraph atlasGraph,
EntityDiscoveryService
entityDiscoveryService) {
super(typeRegistry, typeDefChangeListeners);
diff --git a/repository/src/test/java/org/apache/atlas/TestModules.java
b/repository/src/test/java/org/apache/atlas/TestModules.java
index a0a635464..06ff36c0d 100644
--- a/repository/src/test/java/org/apache/atlas/TestModules.java
+++ b/repository/src/test/java/org/apache/atlas/TestModules.java
@@ -20,6 +20,7 @@ package org.apache.atlas;
import com.google.inject.AbstractModule;
import com.google.inject.Binder;
import com.google.inject.Provider;
+import com.google.inject.Provides;
import com.google.inject.Singleton;
import com.google.inject.matcher.Matchers;
import com.google.inject.multibindings.Multibinder;
@@ -79,6 +80,9 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.Test;
+import java.util.Arrays;
+import java.util.List;
+
import static org.apache.atlas.graph.GraphSandboxUtil.useLocalSolr;
@Test(enabled = false)
@@ -141,11 +145,6 @@ public class TestModules {
bind(EntityGraphMapper.class).asEagerSingleton();
bind(ExportService.class).asEagerSingleton();
- // New typesdef/instance change listener should also be bound to
the corresponding implementation
- Multibinder<TypeDefChangeListener>
typeDefChangeListenerMultibinder =
- Multibinder.newSetBinder(binder(),
TypeDefChangeListener.class);
-
typeDefChangeListenerMultibinder.addBinding().to(GraphBackedSearchIndexer.class).asEagerSingleton();
-
bind(SearchTracker.class).asEagerSingleton();
bind(AtlasEntityStore.class).to(AtlasEntityStoreV2.class);
@@ -196,6 +195,12 @@ public class TestModules {
bindInterceptor(Matchers.any(),
Matchers.annotatedWith(GraphTransaction.class), graphTransactionInterceptor);
}
+ @Singleton
+ @Provides
+ public List<TypeDefChangeListener>
getTypeDefChangeListenerList(GraphBackedSearchIndexer indexer) {
+ return Arrays.asList(indexer);
+ }
+
protected void bindAuditRepository(Binder binder) {
Class<? extends EntityAuditRepository> auditRepoImpl =
AtlasRepositoryConfiguration.getAuditRepositoryImpl();