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
b04c5bd2
Commit
b04c5bd2
authored
Sep 23, 2018
by
Ashutosh Mestry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2888: Export & Import Process: Change Marker Removed Inadvertently
parent
8639ada6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
28 deletions
+10
-28
AuditsWriter.java
...java/org/apache/atlas/repository/impexp/AuditsWriter.java
+10
-28
No files found.
repository/src/main/java/org/apache/atlas/repository/impexp/AuditsWriter.java
View file @
b04c5bd2
...
@@ -130,6 +130,10 @@ public class AuditsWriter {
...
@@ -130,6 +130,10 @@ public class AuditsWriter {
return
StringUtils
.
split
(
fullName
,
"$"
)[
1
];
return
StringUtils
.
split
(
fullName
,
"$"
)[
1
];
}
}
private
void
saveCurrentServer
()
throws
AtlasBaseException
{
saveServer
(
getCurrentClusterName
(),
getCurrentClusterName
());
}
private
class
ExportAudits
{
private
class
ExportAudits
{
private
AtlasExportRequest
request
;
private
AtlasExportRequest
request
;
private
String
targetServerName
;
private
String
targetServerName
;
...
@@ -144,8 +148,10 @@ public class AuditsWriter {
...
@@ -144,8 +148,10 @@ public class AuditsWriter {
request
=
result
.
getRequest
();
request
=
result
.
getRequest
();
replicationOptionState
=
isReplicationOptionSet
(
request
.
getOptions
(),
optionKeyReplicatedTo
);
replicationOptionState
=
isReplicationOptionSet
(
request
.
getOptions
(),
optionKeyReplicatedTo
);
save
Servers
();
save
CurrentServer
();
targetServerFullName
=
getClusterNameFromOptions
(
request
.
getOptions
(),
optionKeyReplicatedTo
);
targetServerName
=
getServerNameFromFullName
(
targetServerFullName
);
auditService
.
add
(
userName
,
getCurrentClusterName
(),
targetServerName
,
auditService
.
add
(
userName
,
getCurrentClusterName
(),
targetServerName
,
ExportImportAuditEntry
.
OPERATION_EXPORT
,
ExportImportAuditEntry
.
OPERATION_EXPORT
,
AtlasType
.
toJson
(
result
),
startTime
,
endTime
,
!
entityGuids
.
isEmpty
());
AtlasType
.
toJson
(
result
),
startTime
,
endTime
,
!
entityGuids
.
isEmpty
());
...
@@ -157,16 +163,6 @@ public class AuditsWriter {
...
@@ -157,16 +163,6 @@ public class AuditsWriter {
updateReplicationAttribute
(
replicationOptionState
,
targetServerName
,
targetServerFullName
,
updateReplicationAttribute
(
replicationOptionState
,
targetServerName
,
targetServerFullName
,
entityGuids
,
Constants
.
ATTR_NAME_REPLICATED_TO
,
result
.
getChangeMarker
());
entityGuids
,
Constants
.
ATTR_NAME_REPLICATED_TO
,
result
.
getChangeMarker
());
}
}
private
void
saveServers
()
throws
AtlasBaseException
{
saveServer
(
getCurrentClusterName
(),
getCurrentClusterName
());
targetServerFullName
=
getClusterNameFromOptions
(
request
.
getOptions
(),
optionKeyReplicatedTo
);
targetServerName
=
getServerNameFromFullName
(
targetServerFullName
);
if
(
StringUtils
.
isNotEmpty
(
targetServerName
))
{
saveServer
(
targetServerName
,
targetServerFullName
);
}
}
}
}
private
class
ImportAudits
{
private
class
ImportAudits
{
...
@@ -183,8 +179,10 @@ public class AuditsWriter {
...
@@ -183,8 +179,10 @@ public class AuditsWriter {
request
=
result
.
getRequest
();
request
=
result
.
getRequest
();
replicationOptionState
=
isReplicationOptionSet
(
request
.
getOptions
(),
optionKeyReplicatedFrom
);
replicationOptionState
=
isReplicationOptionSet
(
request
.
getOptions
(),
optionKeyReplicatedFrom
);
save
Servers
();
save
CurrentServer
();
sourceServerFullName
=
getClusterNameFromOptions
(
request
.
getOptions
(),
optionKeyReplicatedFrom
);
sourceServerName
=
getServerNameFromFullName
(
sourceServerFullName
);
auditService
.
add
(
userName
,
auditService
.
add
(
userName
,
sourceServerName
,
getCurrentClusterName
(),
sourceServerName
,
getCurrentClusterName
(),
ExportImportAuditEntry
.
OPERATION_IMPORT
,
ExportImportAuditEntry
.
OPERATION_IMPORT
,
...
@@ -197,21 +195,5 @@ public class AuditsWriter {
...
@@ -197,21 +195,5 @@ public class AuditsWriter {
updateReplicationAttribute
(
replicationOptionState
,
sourceServerName
,
sourceServerFullName
,
entityGuids
,
updateReplicationAttribute
(
replicationOptionState
,
sourceServerName
,
sourceServerFullName
,
entityGuids
,
Constants
.
ATTR_NAME_REPLICATED_FROM
,
result
.
getExportResult
().
getChangeMarker
());
Constants
.
ATTR_NAME_REPLICATED_FROM
,
result
.
getExportResult
().
getChangeMarker
());
}
}
private
void
saveServers
()
throws
AtlasBaseException
{
saveServer
(
getCurrentClusterName
(),
getCurrentClusterName
());
sourceServerFullName
=
getClusterNameFromOptionsState
();
sourceServerName
=
getServerNameFromFullName
(
sourceServerFullName
);
if
(
StringUtils
.
isNotEmpty
(
sourceServerName
))
{
saveServer
(
sourceServerName
,
sourceServerFullName
);
}
}
private
String
getClusterNameFromOptionsState
()
{
return
replicationOptionState
?
getClusterNameFromOptions
(
request
.
getOptions
(),
optionKeyReplicatedFrom
)
:
StringUtils
.
EMPTY
;
}
}
}
}
}
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