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
84c6fb2b
Commit
84c6fb2b
authored
Sep 26, 2018
by
Ashutosh Mestry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2895: Server full name processing
parent
f4dac184
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
8 deletions
+29
-8
AtlasExportRequest.java
...ava/org/apache/atlas/model/impexp/AtlasExportRequest.java
+8
-6
AuditsWriter.java
...java/org/apache/atlas/repository/impexp/AuditsWriter.java
+8
-1
ReplicationEntityAttributeTest.java
...las/repository/impexp/ReplicationEntityAttributeTest.java
+13
-1
No files found.
intg/src/main/java/org/apache/atlas/model/impexp/AtlasExportRequest.java
View file @
84c6fb2b
...
...
@@ -81,7 +81,7 @@ public class AtlasExportRequest implements Serializable {
}
public
String
getFetchTypeOptionValue
()
{
if
(
getOptions
()
==
null
||
!
getOptions
().
containsKey
(
OPTION_FETCH_TYPE
))
{
if
(
MapUtils
.
isEmpty
(
getOptions
())
||
!
getOptions
().
containsKey
(
OPTION_FETCH_TYPE
))
{
return
FETCH_TYPE_FULL
;
}
...
...
@@ -94,7 +94,8 @@ public class AtlasExportRequest implements Serializable {
}
public
boolean
getSkipLineageOptionValue
()
{
if
(!
getOptions
().
containsKey
(
AtlasExportRequest
.
OPTION_SKIP_LINEAGE
))
{
if
(
MapUtils
.
isEmpty
(
getOptions
())
||
!
getOptions
().
containsKey
(
AtlasExportRequest
.
OPTION_SKIP_LINEAGE
))
{
return
false
;
}
...
...
@@ -123,12 +124,13 @@ public class AtlasExportRequest implements Serializable {
}
public
long
getChangeTokenFromOptions
()
{
if
(
getFetchTypeOptionValue
().
equalsIgnoreCase
(
FETCH_TYPE_INCREMENTAL
)
&&
getOptions
().
containsKey
(
AtlasExportRequest
.
FETCH_TYPE_INCREMENTAL_CHANGE_MARKER
))
{
return
Long
.
parseLong
(
getOptions
().
get
(
AtlasExportRequest
.
FETCH_TYPE_INCREMENTAL_CHANGE_MARKER
).
toString
());
if
(
MapUtils
.
isEmpty
(
getOptions
())
||
!
getFetchTypeOptionValue
().
equalsIgnoreCase
(
FETCH_TYPE_INCREMENTAL
)
||
!
getOptions
().
containsKey
(
AtlasExportRequest
.
FETCH_TYPE_INCREMENTAL_CHANGE_MARKER
))
{
return
0L
;
}
return
0L
;
return
Long
.
parseLong
(
getOptions
().
get
(
AtlasExportRequest
.
FETCH_TYPE_INCREMENTAL_CHANGE_MARKER
).
toString
())
;
}
public
StringBuilder
toString
(
StringBuilder
sb
)
{
...
...
repository/src/main/java/org/apache/atlas/repository/impexp/AuditsWriter.java
View file @
84c6fb2b
...
...
@@ -127,7 +127,14 @@ public class AuditsWriter {
return
fullName
;
}
return
StringUtils
.
split
(
fullName
,
"$"
)[
1
];
String
[]
splits
=
StringUtils
.
split
(
fullName
,
DC_SERVER_NAME_SEPARATOR
);
if
(
splits
==
null
||
splits
.
length
<
1
)
{
return
""
;
}
else
if
(
splits
.
length
>=
2
)
{
return
splits
[
1
];
}
else
{
return
splits
[
0
];
}
}
private
void
saveCurrentServer
()
throws
AtlasBaseException
{
...
...
repository/src/test/java/org/apache/atlas/repository/impexp/ReplicationEntityAttributeTest.java
View file @
84c6fb2b
...
...
@@ -123,7 +123,19 @@ public class ReplicationEntityAttributeTest extends ExportImportTestBase {
assertReplicationAttribute
(
Constants
.
ATTR_NAME_REPLICATED_TO
);
}
@Test
(
dependsOnMethods
=
"exportWithReplicationToOption_AddsClusterObjectIdToReplicatedFromAttribute"
,
enabled
=
false
)
@Test
public
void
fullServerName
()
{
final
String
expectedClusterName
=
"cl1"
;
assertEquals
(
AuditsWriter
.
getServerNameFromFullName
(
""
),
""
);
assertEquals
(
AuditsWriter
.
getServerNameFromFullName
(
expectedClusterName
),
expectedClusterName
);
assertEquals
(
AuditsWriter
.
getServerNameFromFullName
(
"SFO$cl1"
),
expectedClusterName
);
assertEquals
(
AuditsWriter
.
getServerNameFromFullName
(
"cl1$"
),
expectedClusterName
);
assertEquals
(
AuditsWriter
.
getServerNameFromFullName
(
"$cl1"
),
expectedClusterName
);
}
@Test
(
dependsOnMethods
=
"exportWithReplicationToOption_AddsClusterObjectIdToReplicatedFromAttribute"
)
public
void
importWithReplicationFromOption_AddsClusterObjectIdToReplicatedFromAttribute
()
throws
AtlasBaseException
,
IOException
{
AtlasImportRequest
request
=
getImportRequestWithReplicationOption
();
AtlasImportResult
importResult
=
runImportWithParameters
(
importService
,
request
,
zipSource
);
...
...
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