This is an automated email from the ASF dual-hosted git repository. sidmishra pushed a commit to branch branch-2.0 in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/branch-2.0 by this push: new c3ce1e1 ATLAS-4502: Added cassandra and elasticsearch search profile for Atlas c3ce1e1 is described below commit c3ce1e1e99fd39176576669505692ac257c539b9 Author: Sidharth Mishra <sidharthkmis...@gmail.com> AuthorDate: Fri Dec 3 16:18:19 2021 -0800 ATLAS-4502: Added cassandra and elasticsearch search profile for Atlas Signed-off-by: Sidharth Mishra <sidmis...@apache.org> (cherry picked from commit 35627e5b191d6697b6fee6422067734620b78dad) --- distro/pom.xml | 58 ++++++++++++++++++++++ pom.xml | 2 +- .../audit/CassandraBasedAuditRepository.java | 6 +-- webapp/pom.xml | 10 ++++ 4 files changed, 72 insertions(+), 4 deletions(-) diff --git a/distro/pom.xml b/distro/pom.xml index ae55b4b..eec737a 100644 --- a/distro/pom.xml +++ b/distro/pom.xml @@ -299,6 +299,64 @@ atlas.graph.storage.lock.wait-time=300 </build> </profile> + <!-- profile to configure cassandra and elasticsearch with the distribution --> + <profile> + <id>cassandra-elasticsearch</id> + <activation> + <activeByDefault>false</activeByDefault> + </activation> + <properties> + <cassandra.embedded>true</cassandra.embedded> + <entity.repository.properties>atlas.EntityAuditRepository.impl=org.apache.atlas.repository.audit.CassandraBasedAuditRepository</entity.repository.properties> + <graph.storage.backend>embeddedcassandra</graph.storage.backend> + <graph.storage.properties>#Cassandra +atlas.graph.storage.conf-file=${sys:atlas.home}/conf/cassandra.yml + </graph.storage.properties> + <hbase.embedded>false</hbase.embedded> + <elasticsearch.dir>${project.build.directory}/elasticsearch</elasticsearch.dir> + <elasticsearch.folder>elasticsearch-${elasticsearch.version}</elasticsearch.folder> + <elasticsearch.managed>true</elasticsearch.managed> + <elasticsearch.tar>https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${elasticsearch.version}-linux-x86_64.tar.gz</elasticsearch.tar> + <graph.index.backend>elasticsearch</graph.index.backend> + <graph.index.properties>#ElasticSearch +atlas.graph.index.search.hostname=localhost +atlas.graph.index.search.elasticsearch.client-only=true + </graph.index.properties> + </properties> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <version>1.7</version> + <executions> + <!-- package elasticsearch --> + <execution> + <id>elasticsearch</id> + <phase>generate-resources</phase> + <goals> + <goal>run</goal> + </goals> + <configuration> + <target name="Download Elasticsearch"> + <mkdir dir="${elasticsearch.dir}" /> + <mkdir dir="${project.basedir}/elasticsearch" /> + <get src="${elasticsearch.tar}" dest="${project.basedir}/elasticsearch/${elasticsearch.folder}.tar.gz" usetimestamp="true" verbose="true" skipexisting="true" /> + <untar src="${project.basedir}/elasticsearch/${elasticsearch.folder}.tar.gz" dest="${project.build.directory}/elasticsearch.temp" compression="gzip" /> + <copy todir="${elasticsearch.dir}"> + <fileset dir="${project.build.directory}/elasticsearch.temp/${elasticsearch.folder}"> + <include name="**/*" /> + </fileset> + </copy> + </target> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + <!-- profile to configure external hbase and solr with the distribution --> <profile> <id>external-hbase-solr</id> diff --git a/pom.xml b/pom.xml index 086e182..102a943 100644 --- a/pom.xml +++ b/pom.xml @@ -583,7 +583,7 @@ <profile> <id>embedded-cassandra-solr</id> <properties> - <guava.version>19.0</guava.version> + <guava.version>${guava.version}</guava.version> </properties> </profile> diff --git a/repository/src/main/java/org/apache/atlas/repository/audit/CassandraBasedAuditRepository.java b/repository/src/main/java/org/apache/atlas/repository/audit/CassandraBasedAuditRepository.java index fb890fc..4037ac2 100644 --- a/repository/src/main/java/org/apache/atlas/repository/audit/CassandraBasedAuditRepository.java +++ b/repository/src/main/java/org/apache/atlas/repository/audit/CassandraBasedAuditRepository.java @@ -162,7 +162,7 @@ public class CassandraBasedAuditRepository extends AbstractStorageBasedAuditRepo } @Override - public List<EntityAuditEventV2> listEventsV2(String entityId, EntityAuditEventV2.EntityAuditActionV2 auditAction, String startKey, short maxResults) throws AtlasBaseException { + public List<EntityAuditEventV2> listEventsV2(String entityId, EntityAuditEventV2.EntityAuditActionV2 auditAction, String startKey, short maxResults) { if (LOG.isDebugEnabled()) { LOG.debug("Listing events for entity id {}, starting timestamp {}, #records {}", entityId, startKey, maxResults); } @@ -190,8 +190,8 @@ public class CassandraBasedAuditRepository extends AbstractStorageBasedAuditRepo } @Override - public List<EntityAuditEventV2> listEventsV2(String entityId, EntityAuditEventV2.EntityAuditActionV2 auditAction, String sortByColumn, boolean sortOrderDesc, int offset, short limit) throws AtlasBaseException { - throw new NotImplementedException(); + public List<EntityAuditEventV2> listEventsV2(String entityId, EntityAuditEventV2.EntityAuditActionV2 auditAction, String sortByColumn, boolean sortOrderDesc, int offset, short limit) { + return listEventsV2(entityId, auditAction, null, limit); } @Override diff --git a/webapp/pom.xml b/webapp/pom.xml index 0ef5cc4..32c04d7 100755 --- a/webapp/pom.xml +++ b/webapp/pom.xml @@ -59,6 +59,16 @@ </profile> <profile> + <id>cassandra-elasticsearch</id> + <activation> + <activeByDefault>false</activeByDefault> + </activation> + <properties> + <packages.to.exclude>WEB-INF/lib/dom4j-*.jar</packages.to.exclude> + </properties> + </profile> + + <profile> <id>berkeley-solr</id> <activation> <activeByDefault>false</activeByDefault>