Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
868cd831
Commit
868cd831
authored
8 years ago
by
Shwetha GS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-871 Make audit repository implementation configurable (jnhagelb via shwethags)
parent
5ab19951
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
114 additions
and
10 deletions
+114
-10
pom.xml
distro/pom.xml
+2
-0
atlas_start.py
distro/src/bin/atlas_start.py
+8
-4
atlas-application.properties
distro/src/conf/atlas-application.properties
+21
-0
pom.xml
pom.xml
+2
-0
release-log.txt
release-log.txt
+1
-0
RepositoryMetadataModule.java
.../main/java/org/apache/atlas/RepositoryMetadataModule.java
+24
-6
InMemoryEntityAuditRepository.java
...atlas/repository/audit/InMemoryEntityAuditRepository.java
+3
-0
NoopEntityAuditRepository.java
...che/atlas/repository/audit/NoopEntityAuditRepository.java
+50
-0
atlas-application.properties
typesystem/src/main/resources/atlas-application.properties
+3
-0
No files found.
distro/pom.xml
View file @
868cd831
...
@@ -52,6 +52,7 @@ atlas.graph.index.search.solr.zookeeper-url=
...
@@ -52,6 +52,7 @@ atlas.graph.index.search.solr.zookeeper-url=
</titan.index.properties>
</titan.index.properties>
<hbase.embedded>
false
</hbase.embedded>
<hbase.embedded>
false
</hbase.embedded>
<solr.embedded>
false
</solr.embedded>
<solr.embedded>
false
</solr.embedded>
<entity.repository.properties>
#atlas.EntityAuditRepository.impl=org.apache.atlas.repository.audit.HBaseBasedAuditRepository
</entity.repository.properties>
</properties>
</properties>
<profiles>
<profiles>
...
@@ -130,6 +131,7 @@ atlas.graph.index.search.elasticsearch.client-only=false
...
@@ -130,6 +131,7 @@ atlas.graph.index.search.elasticsearch.client-only=false
atlas.graph.index.search.elasticsearch.local-mode=true
atlas.graph.index.search.elasticsearch.local-mode=true
atlas.graph.index.search.elasticsearch.create.sleep=2000
atlas.graph.index.search.elasticsearch.create.sleep=2000
</titan.index.properties>
</titan.index.properties>
<entity.repository.properties>
atlas.EntityAuditRepository.impl=org.apache.atlas.repository.audit.NoopEntityAuditRepository
</entity.repository.properties>
</properties>
</properties>
</profile>
</profile>
...
...
This diff is collapsed.
Click to expand it.
distro/src/bin/atlas_start.py
View file @
868cd831
...
@@ -72,15 +72,19 @@ def main():
...
@@ -72,15 +72,19 @@ def main():
web_app_dir
=
mc
.
webAppDir
(
atlas_home
)
web_app_dir
=
mc
.
webAppDir
(
atlas_home
)
mc
.
expandWebApp
(
atlas_home
)
mc
.
expandWebApp
(
atlas_home
)
#add hbase-site.xml to classpath
hbase_conf_dir
=
mc
.
hbaseConfDir
(
atlas_home
)
p
=
os
.
pathsep
p
=
os
.
pathsep
atlas_classpath
=
confdir
+
p
\
atlas_classpath
=
confdir
+
p
\
+
os
.
path
.
join
(
web_app_dir
,
"atlas"
,
"WEB-INF"
,
"classes"
)
+
p
\
+
os
.
path
.
join
(
web_app_dir
,
"atlas"
,
"WEB-INF"
,
"classes"
)
+
p
\
+
os
.
path
.
join
(
web_app_dir
,
"atlas"
,
"WEB-INF"
,
"lib"
,
"atlas-titan-${project.version}.jar"
)
+
p
\
+
os
.
path
.
join
(
web_app_dir
,
"atlas"
,
"WEB-INF"
,
"lib"
,
"atlas-titan-${project.version}.jar"
)
+
p
\
+
os
.
path
.
join
(
web_app_dir
,
"atlas"
,
"WEB-INF"
,
"lib"
,
"*"
)
+
p
\
+
os
.
path
.
join
(
web_app_dir
,
"atlas"
,
"WEB-INF"
,
"lib"
,
"*"
)
+
p
\
+
os
.
path
.
join
(
atlas_home
,
"libext"
,
"*"
)
+
os
.
path
.
join
(
atlas_home
,
"libext"
,
"*"
)
is_hbase
=
mc
.
is_hbase
(
confdir
)
if
is_hbase
:
#add hbase-site.xml to classpath
hbase_conf_dir
=
mc
.
hbaseConfDir
(
atlas_home
)
if
os
.
path
.
exists
(
hbase_conf_dir
):
if
os
.
path
.
exists
(
hbase_conf_dir
):
atlas_classpath
=
atlas_classpath
+
p
\
atlas_classpath
=
atlas_classpath
+
p
\
+
hbase_conf_dir
+
hbase_conf_dir
...
@@ -106,7 +110,7 @@ def main():
...
@@ -106,7 +110,7 @@ def main():
else
:
else
:
mc
.
server_pid_not_running
(
pid
)
mc
.
server_pid_not_running
(
pid
)
if
mc
.
is_hbase_local
(
confdir
):
if
is_hbase
and
mc
.
is_hbase_local
(
confdir
):
print
"configured for local hbase."
print
"configured for local hbase."
mc
.
configure_hbase
(
atlas_home
)
mc
.
configure_hbase
(
atlas_home
)
mc
.
run_hbase_action
(
mc
.
hbaseBinDir
(
atlas_home
),
"start"
,
hbase_conf_dir
,
logdir
)
mc
.
run_hbase_action
(
mc
.
hbaseBinDir
(
atlas_home
),
"start"
,
hbase_conf_dir
,
logdir
)
...
...
This diff is collapsed.
Click to expand it.
distro/src/conf/atlas-application.properties
View file @
868cd831
...
@@ -22,6 +22,27 @@ atlas.graph.storage.backend=${titan.storage.backend}
...
@@ -22,6 +22,27 @@ atlas.graph.storage.backend=${titan.storage.backend}
${titan.storage.properties}
${titan.storage.properties}
# Delete handler
#
# This allows the default behavior of doing "soft" deletes to be changed.
#
# Allowed Values:
# org.apache.atlas.repository.graph.SoftDeleteHandler - all deletes are "soft" deletes
# org.apache.atlas.repository.graph.HardDeleteHandler - all deletes are "hard" deletes
#
#atlas.DeleteHandler.impl=org.apache.atlas.repository.graph.SoftDeleteHandler
# Entity audit repository
#
# This allows the default behavior of logging entity changes to hbase to be changed.
#
# Allowed Values:
# org.apache.atlas.repository.audit.HBaseBasedAuditRepository - log entity changes to hbase
# org.apache.atlas.repository.audit.NoopEntityAuditRepository - disable the audit repository
#
${entity.repository.properties}
# Graph Search Index
# Graph Search Index
atlas.graph.index.search.backend
=
${titan.index.backend}
atlas.graph.index.search.backend
=
${titan.index.backend}
...
...
This diff is collapsed.
Click to expand it.
pom.xml
View file @
868cd831
...
@@ -411,6 +411,7 @@
...
@@ -411,6 +411,7 @@
<titan.storage.backend>
berkeleyje
</titan.storage.backend>
<titan.storage.backend>
berkeleyje
</titan.storage.backend>
<titan.index.backend>
elasticsearch
</titan.index.backend>
<titan.index.backend>
elasticsearch
</titan.index.backend>
<entity.repository.impl>
org.apache.atlas.repository.audit.InMemoryEntityAuditRepository
</entity.repository.impl>
</properties>
</properties>
<profiles>
<profiles>
...
@@ -425,6 +426,7 @@
...
@@ -425,6 +426,7 @@
<titan.index.backend>
solr5
</titan.index.backend>
<titan.index.backend>
solr5
</titan.index.backend>
<solr.zk.address>
localhost:9983
</solr.zk.address>
<solr.zk.address>
localhost:9983
</solr.zk.address>
<titan.storage.hostname>
localhost
</titan.storage.hostname>
<titan.storage.hostname>
localhost
</titan.storage.hostname>
<entity.repository.impl>
org.apache.atlas.repository.audit.HBaseBasedAuditRepository
</entity.repository.impl>
</properties>
</properties>
</profile>
</profile>
...
...
This diff is collapsed.
Click to expand it.
release-log.txt
View file @
868cd831
...
@@ -22,6 +22,7 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file (dosset
...
@@ -22,6 +22,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)
ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via shwethags)
ALL CHANGES:
ALL CHANGES:
ATLAS-871 Make audit repository implementation configurable (jnhagelb via shwethags)
ATLAS-885 optimize HBaseStoreManager to avoid expensive HTable instantiation every 5 seconds (madhan.neethiraj via yhemanth)
ATLAS-885 optimize HBaseStoreManager to avoid expensive HTable instantiation every 5 seconds (madhan.neethiraj via yhemanth)
ATLAS-878 UI: Not showing details of SD, DB and COLUMNS (saqeeb.s via shwethags)
ATLAS-878 UI: Not showing details of SD, DB and COLUMNS (saqeeb.s via shwethags)
ATLAS-853 User's name to be mentioned in the top user drop down (saqeeb.s via shwethags)
ATLAS-853 User's name to be mentioned in the top user drop down (saqeeb.s via shwethags)
...
...
This diff is collapsed.
Click to expand it.
repository/src/main/java/org/apache/atlas/RepositoryMetadataModule.java
View file @
868cd831
...
@@ -87,7 +87,7 @@ public class RepositoryMetadataModule extends com.google.inject.AbstractModule {
...
@@ -87,7 +87,7 @@ public class RepositoryMetadataModule extends com.google.inject.AbstractModule {
bindAuditRepository
(
binder
());
bindAuditRepository
(
binder
());
bind
(
DeleteHandler
.
class
).
to
(
getDeleteHandler
()).
asEagerSingleton
();
bind
(
DeleteHandler
.
class
).
to
(
getDeleteHandler
Impl
()).
asEagerSingleton
();
//Add EntityAuditListener as EntityChangeListener
//Add EntityAuditListener as EntityChangeListener
Multibinder
<
EntityChangeListener
>
entityChangeListenerBinder
=
Multibinder
<
EntityChangeListener
>
entityChangeListenerBinder
=
...
@@ -100,17 +100,35 @@ public class RepositoryMetadataModule extends com.google.inject.AbstractModule {
...
@@ -100,17 +100,35 @@ public class RepositoryMetadataModule extends com.google.inject.AbstractModule {
}
}
protected
void
bindAuditRepository
(
Binder
binder
)
{
protected
void
bindAuditRepository
(
Binder
binder
)
{
//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
Class
<?
extends
EntityAuditRepository
>
auditRepoImpl
=
getAuditRepositoryImpl
();
//Map EntityAuditRepository interface to configured implementation
binder
.
bind
(
EntityAuditRepository
.
class
).
to
(
auditRepoImpl
).
asEagerSingleton
();
if
(
Service
.
class
.
isAssignableFrom
(
auditRepoImpl
))
{
Class
<?
extends
Service
>
auditRepoService
=
(
Class
<?
extends
Service
>)
auditRepoImpl
;
//if it's a service, make sure that it gets properly closed at shutdown
Multibinder
<
Service
>
serviceBinder
=
Multibinder
.
newSetBinder
(
binder
,
Service
.
class
);
Multibinder
<
Service
>
serviceBinder
=
Multibinder
.
newSetBinder
(
binder
,
Service
.
class
);
serviceBinder
.
addBinding
().
to
(
HBaseBasedAuditRepository
.
class
);
serviceBinder
.
addBinding
().
to
(
auditRepoService
);
}
}
private
static
final
String
AUDIT_REPOSITORY_IMPLEMENTATION_PROPERTY
=
"atlas.EntityAuditRepository.impl"
;
private
Class
<?
extends
EntityAuditRepository
>
getAuditRepositoryImpl
()
{
try
{
return
ApplicationProperties
.
getClass
(
AUDIT_REPOSITORY_IMPLEMENTATION_PROPERTY
,
HBaseBasedAuditRepository
.
class
.
getName
(),
EntityAuditRepository
.
class
);
}
catch
(
AtlasException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
private
static
final
String
DELETE_HANDLER_IMPLEMENTATION_PROPERTY
=
"atlas.DeleteHandler.impl"
;
private
static
final
String
DELETE_HANDLER_IMPLEMENTATION_PROPERTY
=
"atlas.DeleteHandler.impl"
;
private
Class
<?
extends
DeleteHandler
>
getDeleteHandler
()
{
private
Class
<?
extends
DeleteHandler
>
getDeleteHandler
Impl
()
{
try
{
try
{
return
ApplicationProperties
.
getClass
(
DELETE_HANDLER_IMPLEMENTATION_PROPERTY
,
return
ApplicationProperties
.
getClass
(
DELETE_HANDLER_IMPLEMENTATION_PROPERTY
,
SoftDeleteHandler
.
class
.
getName
(),
DeleteHandler
.
class
);
SoftDeleteHandler
.
class
.
getName
(),
DeleteHandler
.
class
);
...
...
This diff is collapsed.
Click to expand it.
repository/src/main/java/org/apache/atlas/repository/audit/InMemoryEntityAuditRepository.java
View file @
868cd831
...
@@ -21,6 +21,8 @@ package org.apache.atlas.repository.audit;
...
@@ -21,6 +21,8 @@ package org.apache.atlas.repository.audit;
import
org.apache.atlas.AtlasException
;
import
org.apache.atlas.AtlasException
;
import
org.apache.atlas.EntityAuditEvent
;
import
org.apache.atlas.EntityAuditEvent
;
import
com.google.inject.Singleton
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
...
@@ -30,6 +32,7 @@ import java.util.TreeMap;
...
@@ -30,6 +32,7 @@ import java.util.TreeMap;
/**
/**
* Entity audit repository where audit events are stored in-memory. Used only for integration tests
* Entity audit repository where audit events are stored in-memory. Used only for integration tests
*/
*/
@Singleton
public
class
InMemoryEntityAuditRepository
implements
EntityAuditRepository
{
public
class
InMemoryEntityAuditRepository
implements
EntityAuditRepository
{
private
TreeMap
<
String
,
EntityAuditEvent
>
auditEvents
=
new
TreeMap
<>();
private
TreeMap
<
String
,
EntityAuditEvent
>
auditEvents
=
new
TreeMap
<>();
...
...
This diff is collapsed.
Click to expand it.
repository/src/main/java/org/apache/atlas/repository/audit/NoopEntityAuditRepository.java
0 → 100644
View file @
868cd831
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
apache
.
atlas
.
repository
.
audit
;
import
java.util.Collections
;
import
java.util.List
;
import
org.apache.atlas.AtlasException
;
import
org.apache.atlas.EntityAuditEvent
;
import
com.google.inject.Singleton
;
/**
* Implementation that completely disables the audit repository.
*/
@Singleton
public
class
NoopEntityAuditRepository
implements
EntityAuditRepository
{
@Override
public
void
putEvents
(
EntityAuditEvent
...
events
)
throws
AtlasException
{
//do nothing
}
@Override
public
synchronized
void
putEvents
(
List
<
EntityAuditEvent
>
events
)
throws
AtlasException
{
//do nothing
}
@Override
public
List
<
EntityAuditEvent
>
listEvents
(
String
entityId
,
String
startKey
,
short
maxResults
)
throws
AtlasException
{
return
Collections
.
emptyList
();
}
}
This diff is collapsed.
Click to expand it.
typesystem/src/main/resources/atlas-application.properties
View file @
868cd831
...
@@ -23,6 +23,9 @@ atlas.rest.address=http://localhost:31000
...
@@ -23,6 +23,9 @@ atlas.rest.address=http://localhost:31000
# Graph Storage
# Graph Storage
atlas.graph.storage.backend
=
${titan.storage.backend}
atlas.graph.storage.backend
=
${titan.storage.backend}
# Entity repository implementation
atlas.EntityAuditRepository.impl
=
${entity.repository.impl}
# Graph Search Index Backend
# Graph Search Index Backend
atlas.graph.index.search.backend
=
${titan.index.backend}
atlas.graph.index.search.backend
=
${titan.index.backend}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment