You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by sh...@apache.org on 2016/04/02 18:16:56 UTC
incubator-atlas git commit: ATLAS-620 Disable hbase based entity
audit (shwethags)
Repository: incubator-atlas
Updated Branches:
refs/heads/master ce73ec352 -> c1d4e7c9c
ATLAS-620 Disable hbase based entity audit (shwethags)
Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/c1d4e7c9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/c1d4e7c9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/c1d4e7c9
Branch: refs/heads/master
Commit: c1d4e7c9cd030e5625fee9fe33c89e3fbfd2dbfa
Parents: ce73ec3
Author: Shwetha GS <ss...@hortonworks.com>
Authored: Sat Apr 2 21:46:44 2016 +0530
Committer: Shwetha GS <ss...@hortonworks.com>
Committed: Sat Apr 2 21:46:44 2016 +0530
----------------------------------------------------------------------
release-log.txt | 1 +
.../apache/atlas/RepositoryMetadataModule.java | 7 ++++--
.../atlas/repository/audit/HBaseTestUtils.java | 4 ----
.../service/DefaultMetadataServiceTest.java | 24 +++++++++++---------
.../service/ActiveInstanceElectorModule.java | 7 +++---
5 files changed, 22 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/c1d4e7c9/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 9a74ec7..586a49e 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -13,6 +13,7 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file (dosset
ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via shwethags)
ALL CHANGES:
+ATLAS-620 Disable hbase based entity audit (shwethags)
ATLAS-618 Fix assembly for hdfs-module (sumasai via yhemanth)
ATLAS-573 Inherited attributes disappear from entities after server restart (dkantor via sumasai)
ATLAS-525 Drop support for partitions, select query lineage, roles, principals, resource, hive_type...(sumasai via shwethags)
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/c1d4e7c9/repository/src/main/java/org/apache/atlas/RepositoryMetadataModule.java
----------------------------------------------------------------------
diff --git a/repository/src/main/java/org/apache/atlas/RepositoryMetadataModule.java b/repository/src/main/java/org/apache/atlas/RepositoryMetadataModule.java
index 4a02b0d..ce1bdfb 100755
--- a/repository/src/main/java/org/apache/atlas/RepositoryMetadataModule.java
+++ b/repository/src/main/java/org/apache/atlas/RepositoryMetadataModule.java
@@ -34,14 +34,13 @@ import org.apache.atlas.listener.TypesChangeListener;
import org.apache.atlas.repository.MetadataRepository;
import org.apache.atlas.repository.audit.EntityAuditListener;
import org.apache.atlas.repository.audit.EntityAuditRepository;
-import org.apache.atlas.repository.audit.HBaseBasedAuditRepository;
+import org.apache.atlas.repository.audit.InMemoryEntityAuditRepository;
import org.apache.atlas.repository.graph.GraphBackedMetadataRepository;
import org.apache.atlas.repository.graph.GraphBackedSearchIndexer;
import org.apache.atlas.repository.graph.GraphProvider;
import org.apache.atlas.repository.graph.TitanGraphProvider;
import org.apache.atlas.repository.typestore.GraphBackedTypeStore;
import org.apache.atlas.repository.typestore.ITypeStore;
-import org.apache.atlas.service.Service;
import org.apache.atlas.services.DefaultMetadataService;
import org.apache.atlas.services.IBootstrapTypesRegistrar;
import org.apache.atlas.services.MetadataService;
@@ -96,11 +95,15 @@ public class RepositoryMetadataModule extends com.google.inject.AbstractModule {
}
protected void bindAuditRepository(Binder binder) {
+ /** Enable this after ATLAS-498 is committed
//Map EntityAuditRepository interface to hbase based implementation
binder.bind(EntityAuditRepository.class).to(HBaseBasedAuditRepository.class).asEagerSingleton();
//Add HBaseBasedAuditRepository to service so that connection is closed at shutdown
Multibinder<Service> serviceBinder = Multibinder.newSetBinder(binder(), Service.class);
serviceBinder.addBinding().to(HBaseBasedAuditRepository.class);
+ **/
+ //Map EntityAuditRepository interface to hbase based implementation
+ binder.bind(EntityAuditRepository.class).to(InMemoryEntityAuditRepository.class).asEagerSingleton();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/c1d4e7c9/repository/src/test/java/org/apache/atlas/repository/audit/HBaseTestUtils.java
----------------------------------------------------------------------
diff --git a/repository/src/test/java/org/apache/atlas/repository/audit/HBaseTestUtils.java b/repository/src/test/java/org/apache/atlas/repository/audit/HBaseTestUtils.java
index 0e43806..84d7bab 100644
--- a/repository/src/test/java/org/apache/atlas/repository/audit/HBaseTestUtils.java
+++ b/repository/src/test/java/org/apache/atlas/repository/audit/HBaseTestUtils.java
@@ -19,7 +19,6 @@
package org.apache.atlas.repository.audit;
import org.apache.atlas.ApplicationProperties;
-import org.apache.atlas.RequestContext;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseTestingUtility;
import org.apache.hadoop.hbase.LocalHBaseCluster;
@@ -40,9 +39,6 @@ public class HBaseTestUtils {
hbaseCluster = new LocalHBaseCluster(hbaseTestUtility.getConfiguration());
hbaseCluster.startup();
-
- RequestContext.createContext();
- RequestContext.get().setUser("testuser");
}
public static void stopCluster() throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/c1d4e7c9/repository/src/test/java/org/apache/atlas/service/DefaultMetadataServiceTest.java
----------------------------------------------------------------------
diff --git a/repository/src/test/java/org/apache/atlas/service/DefaultMetadataServiceTest.java b/repository/src/test/java/org/apache/atlas/service/DefaultMetadataServiceTest.java
index baf89fc..aa00417 100644
--- a/repository/src/test/java/org/apache/atlas/service/DefaultMetadataServiceTest.java
+++ b/repository/src/test/java/org/apache/atlas/service/DefaultMetadataServiceTest.java
@@ -23,22 +23,15 @@ import com.google.common.collect.ImmutableSet;
import com.google.inject.Inject;
import com.thinkaurelius.titan.core.TitanGraph;
import com.thinkaurelius.titan.core.util.TitanCleanup;
-
import org.apache.atlas.AtlasClient;
-import org.apache.atlas.repository.audit.EntityAuditRepository;
-import org.apache.atlas.repository.audit.HBaseBasedAuditRepository;
-import org.apache.atlas.repository.audit.HBaseTestUtils;
-import org.apache.atlas.typesystem.exception.TypeNotFoundException;
-import org.apache.atlas.typesystem.exception.EntityNotFoundException;
-import org.apache.atlas.typesystem.types.ClassType;
-import org.apache.atlas.typesystem.types.DataTypes;
-import org.apache.atlas.typesystem.types.HierarchicalTypeDefinition;
-import org.apache.atlas.typesystem.types.utils.TypesUtil;
-import org.apache.atlas.utils.ParamChecker;
import org.apache.atlas.AtlasException;
import org.apache.atlas.RepositoryMetadataModule;
+import org.apache.atlas.RequestContext;
import org.apache.atlas.TestUtils;
import org.apache.atlas.listener.EntityChangeListener;
+import org.apache.atlas.repository.audit.EntityAuditRepository;
+import org.apache.atlas.repository.audit.HBaseBasedAuditRepository;
+import org.apache.atlas.repository.audit.HBaseTestUtils;
import org.apache.atlas.repository.graph.GraphProvider;
import org.apache.atlas.services.MetadataService;
import org.apache.atlas.typesystem.IReferenceableInstance;
@@ -47,12 +40,19 @@ import org.apache.atlas.typesystem.ITypedReferenceableInstance;
import org.apache.atlas.typesystem.Referenceable;
import org.apache.atlas.typesystem.Struct;
import org.apache.atlas.typesystem.TypesDef;
+import org.apache.atlas.typesystem.exception.EntityNotFoundException;
+import org.apache.atlas.typesystem.exception.TypeNotFoundException;
import org.apache.atlas.typesystem.json.InstanceSerialization;
import org.apache.atlas.typesystem.json.TypesSerialization;
import org.apache.atlas.typesystem.persistence.Id;
+import org.apache.atlas.typesystem.types.ClassType;
+import org.apache.atlas.typesystem.types.DataTypes;
import org.apache.atlas.typesystem.types.EnumValue;
+import org.apache.atlas.typesystem.types.HierarchicalTypeDefinition;
import org.apache.atlas.typesystem.types.TypeSystem;
import org.apache.atlas.typesystem.types.ValueConversionException;
+import org.apache.atlas.typesystem.types.utils.TypesUtil;
+import org.apache.atlas.utils.ParamChecker;
import org.apache.commons.lang.RandomStringUtils;
import org.codehaus.jettison.json.JSONArray;
import org.codehaus.jettison.json.JSONException;
@@ -105,6 +105,8 @@ public class DefaultMetadataServiceTest {
HBaseTestUtils.startCluster();
((HBaseBasedAuditRepository) repository).start();
}
+ RequestContext.createContext();
+ RequestContext.get().setUser("testuser");
TypesDef typesDef = TestUtils.defineHiveTypes();
try {
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/c1d4e7c9/webapp/src/main/java/org/apache/atlas/web/service/ActiveInstanceElectorModule.java
----------------------------------------------------------------------
diff --git a/webapp/src/main/java/org/apache/atlas/web/service/ActiveInstanceElectorModule.java b/webapp/src/main/java/org/apache/atlas/web/service/ActiveInstanceElectorModule.java
index d662683..065666d 100644
--- a/webapp/src/main/java/org/apache/atlas/web/service/ActiveInstanceElectorModule.java
+++ b/webapp/src/main/java/org/apache/atlas/web/service/ActiveInstanceElectorModule.java
@@ -20,13 +20,11 @@ package org.apache.atlas.web.service;
import com.google.inject.AbstractModule;
import com.google.inject.multibindings.Multibinder;
+import org.apache.atlas.listener.ActiveStateChangeHandler;
import org.apache.atlas.notification.NotificationHookConsumer;
-import org.apache.atlas.repository.audit.HBaseBasedAuditRepository;
import org.apache.atlas.repository.graph.GraphBackedSearchIndexer;
import org.apache.atlas.service.Service;
-import org.apache.atlas.listener.ActiveStateChangeHandler;
import org.apache.atlas.services.DefaultMetadataService;
-import org.apache.atlas.web.filters.ActiveServerFilter;
/**
* A Guice module that registers the handlers of High Availability state change handlers and other services.
@@ -41,7 +39,8 @@ public class ActiveInstanceElectorModule extends AbstractModule {
activeStateChangeHandlerBinder.addBinding().to(GraphBackedSearchIndexer.class);
activeStateChangeHandlerBinder.addBinding().to(DefaultMetadataService.class);
activeStateChangeHandlerBinder.addBinding().to(NotificationHookConsumer.class);
- activeStateChangeHandlerBinder.addBinding().to(HBaseBasedAuditRepository.class);
+ //Enable this after ATLAS-498 is committed
+ //activeStateChangeHandlerBinder.addBinding().to(HBaseBasedAuditRepository.class);
Multibinder<Service> serviceBinder = Multibinder.newSetBinder(binder(), Service.class);
serviceBinder.addBinding().to(ActiveInstanceElectorService.class);