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
3ff785a8
Commit
3ff785a8
authored
Apr 08, 2020
by
sidmishra
Committed by
Sarath Subramanian
Apr 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3726: Added extra field to admin audit for result count
Signed-off-by:
Sarath Subramanian
<
sarath@apache.org
>
parent
ec48c09a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
11 deletions
+33
-11
0010-base_model.json
addons/models/0000-Area0/0010-base_model.json
+8
-0
AtlasAuditEntry.java
...in/java/org/apache/atlas/model/audit/AtlasAuditEntry.java
+10
-0
AtlasAuditService.java
.../org/apache/atlas/repository/audit/AtlasAuditService.java
+2
-1
AtlasAuditEntryDTO.java
...a/org/apache/atlas/repository/ogm/AtlasAuditEntryDTO.java
+11
-8
AdminPurgeTest.java
...ava/org/apache/atlas/repository/audit/AdminPurgeTest.java
+1
-1
AdminResource.java
...in/java/org/apache/atlas/web/resources/AdminResource.java
+1
-1
No files found.
addons/models/0000-Area0/0010-base_model.json
View file @
3ff785a8
...
...
@@ -479,6 +479,14 @@
"isIndexable"
:
false
,
"isOptional"
:
true
,
"isUnique"
:
false
},
{
"name"
:
"resultCount"
,
"typeName"
:
"long"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
true
,
"isOptional"
:
true
,
"isUnique"
:
false
}
]
},
...
...
intg/src/main/java/org/apache/atlas/model/audit/AtlasAuditEntry.java
View file @
3ff785a8
...
...
@@ -49,6 +49,7 @@ public class AtlasAuditEntry extends AtlasBaseModelObject implements Serializabl
private
Date
endTime
;
private
String
clientId
;
private
String
result
;
private
long
resultCount
;
public
AtlasAuditEntry
()
{
}
...
...
@@ -115,6 +116,14 @@ public class AtlasAuditEntry extends AtlasBaseModelObject implements Serializabl
this
.
result
=
result
;
}
public
long
getResultCount
()
{
return
resultCount
;
}
public
void
setResultCount
(
long
resultCount
)
{
this
.
resultCount
=
resultCount
;
}
@Override
public
StringBuilder
toString
(
StringBuilder
sb
)
{
sb
.
append
(
", userName: "
).
append
(
userName
);
...
...
@@ -124,6 +133,7 @@ public class AtlasAuditEntry extends AtlasBaseModelObject implements Serializabl
sb
.
append
(
", startTime: "
).
append
(
startTime
);
sb
.
append
(
", endTime: "
).
append
(
endTime
);
sb
.
append
(
", result: "
).
append
(
result
);
sb
.
append
(
", resultCount: "
).
append
(
resultCount
);
return
sb
;
}
...
...
repository/src/main/java/org/apache/atlas/repository/audit/AtlasAuditService.java
View file @
3ff785a8
...
...
@@ -62,7 +62,7 @@ public class AtlasAuditService {
}
public
void
add
(
String
userName
,
AuditOperation
operation
,
String
clientId
,
Date
startTime
,
Date
endTime
,
String
params
,
String
result
)
throws
AtlasBaseException
{
Date
endTime
,
String
params
,
String
result
,
long
resultCount
)
throws
AtlasBaseException
{
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"==> AtlasAuditService.add()"
);
}
...
...
@@ -76,6 +76,7 @@ public class AtlasAuditService {
entry
.
setEndTime
(
endTime
);
entry
.
setParams
(
params
);
entry
.
setResult
(
result
);
entry
.
setResultCount
(
resultCount
);
save
(
entry
);
...
...
repository/src/main/java/org/apache/atlas/repository/ogm/AtlasAuditEntryDTO.java
View file @
3ff785a8
...
...
@@ -35,18 +35,19 @@ import java.util.Arrays;
@Component
public
class
AtlasAuditEntryDTO
extends
AbstractDataTransferObject
<
AtlasAuditEntry
>
{
public
static
final
String
ATTRIBUTE_USER_NAME
=
"userName"
;
public
static
final
String
ATTRIBUTE_OPERATION
=
"operation"
;
public
static
final
String
ATTRIBUTE_PARAMS
=
"params"
;
public
static
final
String
ATTRIBUTE_START_TIME
=
"startTime"
;
public
static
final
String
ATTRIBUTE_END_TIME
=
"endTime"
;
public
static
final
String
ATTRIBUTE_CLIENT_ID
=
"clientId"
;
public
static
final
String
ATTRIBUTE_RESULT
=
"result"
;
public
static
final
String
ATTRIBUTE_USER_NAME
=
"userName"
;
public
static
final
String
ATTRIBUTE_OPERATION
=
"operation"
;
public
static
final
String
ATTRIBUTE_PARAMS
=
"params"
;
public
static
final
String
ATTRIBUTE_START_TIME
=
"startTime"
;
public
static
final
String
ATTRIBUTE_END_TIME
=
"endTime"
;
public
static
final
String
ATTRIBUTE_CLIENT_ID
=
"clientId"
;
public
static
final
String
ATTRIBUTE_RESULT
=
"result"
;
public
static
final
String
ATTRIBUTE_RESULT_COUNT
=
"resultCount"
;
private
static
final
Set
<
String
>
ATTRIBUTE_NAMES
=
new
HashSet
<>(
Arrays
.
asList
(
ATTRIBUTE_USER_NAME
,
ATTRIBUTE_OPERATION
,
ATTRIBUTE_PARAMS
,
ATTRIBUTE_START_TIME
,
ATTRIBUTE_END_TIME
,
ATTRIBUTE_CLIENT_ID
,
ATTRIBUTE_RESULT
));
ATTRIBUTE_CLIENT_ID
,
ATTRIBUTE_RESULT
,
ATTRIBUTE_RESULT_COUNT
));
@Inject
public
AtlasAuditEntryDTO
(
AtlasTypeRegistry
typeRegistry
)
{
...
...
@@ -69,6 +70,7 @@ public class AtlasAuditEntryDTO extends AbstractDataTransferObject<AtlasAuditEnt
entry
.
setEndTime
((
Date
)
attributes
.
get
(
ATTRIBUTE_END_TIME
));
entry
.
setClientId
((
String
)
attributes
.
get
(
ATTRIBUTE_CLIENT_ID
));
entry
.
setResult
((
String
)
attributes
.
get
(
ATTRIBUTE_RESULT
));
entry
.
setResultCount
((
long
)
attributes
.
get
(
ATTRIBUTE_RESULT_COUNT
));
return
entry
;
}
...
...
@@ -94,6 +96,7 @@ public class AtlasAuditEntryDTO extends AbstractDataTransferObject<AtlasAuditEnt
entity
.
setAttribute
(
ATTRIBUTE_END_TIME
,
obj
.
getEndTime
());
entity
.
setAttribute
(
ATTRIBUTE_CLIENT_ID
,
obj
.
getClientId
());
entity
.
setAttribute
(
ATTRIBUTE_RESULT
,
obj
.
getResult
());
entity
.
setAttribute
(
ATTRIBUTE_RESULT_COUNT
,
obj
.
getResultCount
());
return
entity
;
}
...
...
repository/src/test/java/org/apache/atlas/repository/audit/AdminPurgeTest.java
View file @
3ff785a8
...
...
@@ -134,7 +134,7 @@ public class AdminPurgeTest extends AtlasTestBase {
auditService
.
add
(
DEFAULT_USER
,
AtlasAuditEntry
.
AuditOperation
.
PURGE
,
CLIENT_HOST
,
startTimestamp
,
new
Date
(),
guids
.
toString
(),
response
.
getPurgedEntitiesIds
());
response
.
getPurgedEntitiesIds
()
,
response
.
getPurgedEntities
().
size
()
);
AuditSearchParameters
auditParameterNull
=
createAuditParameter
(
"audit-search-parameter-without-filter"
);
assertAuditEntry
(
auditService
,
auditParameterNull
);
...
...
webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
View file @
3ff785a8
...
...
@@ -479,7 +479,7 @@ public class AdminResource {
auditService
.
add
(
AtlasAuthorizationUtils
.
getCurrentUserName
(),
AuditOperation
.
PURGE
,
clientId
!=
null
?
clientId
:
""
,
startTime
,
endTime
,
guids
.
toString
(),
resp
.
getPurgedEntitiesIds
());
resp
.
getPurgedEntitiesIds
()
,
resp
.
getPurgedEntities
().
size
()
);
}
return
resp
;
...
...
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