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
a5f971a3
Commit
a5f971a3
authored
Jan 03, 2019
by
Kapildeo Nayak
Committed by
nixonrodrigues
Jan 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3019 Handle NPE while transform and adding replicatedTo in import-export
Signed-off-by:
nixonrodrigues
<
nixon@apache.org
>
parent
22041f51
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
10 deletions
+20
-10
AtlasExportRequest.java
...ava/org/apache/atlas/model/impexp/AtlasExportRequest.java
+16
-10
ImportTransforms.java
.../org/apache/atlas/repository/impexp/ImportTransforms.java
+4
-0
No files found.
intg/src/main/java/org/apache/atlas/model/impexp/AtlasExportRequest.java
View file @
a5f971a3
...
...
@@ -6,9 +6,9 @@
* 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.
...
...
@@ -40,9 +40,9 @@ import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE;
import
static
com
.
fasterxml
.
jackson
.
annotation
.
JsonAutoDetect
.
Visibility
.
PUBLIC_ONLY
;
@JsonAutoDetect
(
getterVisibility
=
PUBLIC_ONLY
,
setterVisibility
=
PUBLIC_ONLY
,
fieldVisibility
=
NONE
)
@JsonSerialize
(
include
=
JsonSerialize
.
Inclusion
.
NON_NULL
)
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
@JsonAutoDetect
(
getterVisibility
=
PUBLIC_ONLY
,
setterVisibility
=
PUBLIC_ONLY
,
fieldVisibility
=
NONE
)
@JsonSerialize
(
include
=
JsonSerialize
.
Inclusion
.
NON_NULL
)
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
@XmlRootElement
@XmlAccessorType
(
XmlAccessType
.
PROPERTY
)
public
class
AtlasExportRequest
implements
Serializable
{
...
...
@@ -83,7 +83,7 @@ public class AtlasExportRequest implements Serializable {
}
public
String
getFetchTypeOptionValue
()
{
if
(
MapUtils
.
isEmpty
(
getOptions
())
||
!
getOptions
().
containsKey
(
OPTION_FETCH_TYPE
))
{
if
(
MapUtils
.
isEmpty
(
getOptions
())
||
!
getOptions
().
containsKey
(
OPTION_FETCH_TYPE
))
{
return
FETCH_TYPE_FULL
;
}
...
...
@@ -96,17 +96,17 @@ public class AtlasExportRequest implements Serializable {
}
public
boolean
getSkipLineageOptionValue
()
{
if
(
MapUtils
.
isEmpty
(
getOptions
())
||
if
(
MapUtils
.
isEmpty
(
getOptions
())
||
!
getOptions
().
containsKey
(
AtlasExportRequest
.
OPTION_SKIP_LINEAGE
))
{
return
false
;
}
Object
o
=
getOptions
().
get
(
AtlasExportRequest
.
OPTION_SKIP_LINEAGE
);
if
(
o
instanceof
String
)
{
if
(
o
instanceof
String
)
{
return
Boolean
.
parseBoolean
((
String
)
o
);
}
if
(
o
instanceof
Boolean
)
{
if
(
o
instanceof
Boolean
)
{
return
(
Boolean
)
o
;
}
...
...
@@ -142,7 +142,13 @@ public class AtlasExportRequest implements Serializable {
@JsonIgnore
public
String
getOptionKeyReplicatedTo
()
{
return
isReplicationOptionSet
()
?
(
String
)
options
.
get
(
OPTION_KEY_REPLICATED_TO
)
:
StringUtils
.
EMPTY
;
String
replicateToServerName
=
isReplicationOptionSet
()
?
(
String
)
options
.
get
(
OPTION_KEY_REPLICATED_TO
)
:
StringUtils
.
EMPTY
;
if
(
replicateToServerName
==
null
)
{
return
StringUtils
.
EMPTY
;
}
else
{
return
replicateToServerName
;
}
}
public
StringBuilder
toString
(
StringBuilder
sb
)
{
...
...
repository/src/main/java/org/apache/atlas/repository/impexp/ImportTransforms.java
View file @
a5f971a3
...
...
@@ -64,7 +64,11 @@ public class ImportTransforms {
getTransforms
().
put
(
subType
,
attribtueTransformMap
);
}
else
{
for
(
Map
.
Entry
<
String
,
List
<
ImportTransformer
>>
entry
:
attribtueTransformMap
.
entrySet
())
{
if
((
getTransforms
().
get
(
subType
).
containsKey
(
entry
.
getKey
()))){
getTransforms
().
get
(
subType
).
get
(
entry
.
getKey
()).
addAll
(
entry
.
getValue
());
}
else
{
LOG
.
warn
(
"Attribute {} does not exist for Type : {}"
,
entry
.
getKey
(),
parentType
);
}
}
}
}
...
...
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