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
83e9c21f
Commit
83e9c21f
authored
4 years ago
by
jyoti0208
Committed by
Madhan Neethiraj
4 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3875: updated sample client to improve logging
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
b7255ec7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
71 additions
and
76 deletions
+71
-76
DiscoveryExample.java
...org/apache/atlas/examples/sampleapp/DiscoveryExample.java
+10
-10
EntityExample.java
...va/org/apache/atlas/examples/sampleapp/EntityExample.java
+12
-11
GlossaryExample.java
.../org/apache/atlas/examples/sampleapp/GlossaryExample.java
+6
-6
LineageExample.java
...a/org/apache/atlas/examples/sampleapp/LineageExample.java
+1
-1
SampleApp.java
...n/java/org/apache/atlas/examples/sampleapp/SampleApp.java
+20
-26
SampleAppConstants.java
...g/apache/atlas/examples/sampleapp/SampleAppConstants.java
+10
-10
TypeDefExample.java
...a/org/apache/atlas/examples/sampleapp/TypeDefExample.java
+12
-12
No files found.
atlas-examples/sample-app/src/main/java/org/apache/atlas/examples/sampleapp/DiscoveryExample.java
View file @
83e9c21f
...
...
@@ -41,14 +41,14 @@ public class DiscoveryExample {
List
<
AtlasEntityHeader
>
entities
=
result
!=
null
?
result
.
getEntities
()
:
null
;
int
resultCount
=
entities
==
null
?
0
:
entities
.
size
();
S
ystem
.
out
.
println
(
"DSL Query: "
+
dslQuery
);
S
ystem
.
out
.
println
(
" result count: "
+
resultCount
);
S
ampleApp
.
log
(
"DSL Query: "
+
dslQuery
);
S
ampleApp
.
log
(
" result count: "
+
resultCount
);
for
(
int
i
=
0
;
i
<
resultCount
;
i
++)
{
S
ystem
.
out
.
println
(
" result # "
+
(
i
+
1
)
+
": "
+
entities
.
get
(
i
));
S
ampleApp
.
log
(
" result # "
+
(
i
+
1
)
+
": "
+
entities
.
get
(
i
));
}
}
catch
(
Exception
e
)
{
S
ystem
.
out
.
println
(
"query -: "
+
dslQuery
+
" failed"
);
S
ampleApp
.
log
(
"query -: "
+
dslQuery
+
" failed"
);
}
}
}
...
...
@@ -59,11 +59,11 @@ public class DiscoveryExample {
List
<
AtlasEntityHeader
>
entities
=
result
!=
null
&&
result
.
getSearchResults
()
!=
null
?
result
.
getSearchResults
().
getEntities
()
:
null
;
int
resultCount
=
entities
==
null
?
0
:
entities
.
size
();
S
ystem
.
out
.
println
(
"Quick search: query-string="
+
searchString
);
S
ystem
.
out
.
println
(
" result count: "
+
resultCount
);
S
ampleApp
.
log
(
"Quick search: query-string="
+
searchString
);
S
ampleApp
.
log
(
" result count: "
+
resultCount
);
for
(
int
i
=
0
;
i
<
resultCount
;
i
++)
{
S
ystem
.
out
.
println
(
" result # "
+
(
i
+
1
)
+
": "
+
entities
.
get
(
i
));
S
ampleApp
.
log
(
" result # "
+
(
i
+
1
)
+
": "
+
entities
.
get
(
i
));
}
}
catch
(
AtlasServiceException
e
)
{
e
.
printStackTrace
();
...
...
@@ -76,11 +76,11 @@ public class DiscoveryExample {
List
<
AtlasEntityHeader
>
entities
=
result
!=
null
?
result
.
getEntities
()
:
null
;
int
resultCount
=
entities
==
null
?
0
:
entities
.
size
();
S
ystem
.
out
.
println
(
"Basic search: typeName="
+
typeName
+
", classification="
+
classification
+
", query="
+
query
);
S
ystem
.
out
.
println
(
" result count: "
+
resultCount
);
S
ampleApp
.
log
(
"Basic search: typeName="
+
typeName
+
", classification="
+
classification
+
", query="
+
query
);
S
ampleApp
.
log
(
" result count: "
+
resultCount
);
for
(
int
i
=
0
;
i
<
resultCount
;
i
++)
{
S
ystem
.
out
.
println
(
" result # "
+
(
i
+
1
)
+
": "
+
entities
.
get
(
i
));
S
ampleApp
.
log
(
" result # "
+
(
i
+
1
)
+
": "
+
entities
.
get
(
i
));
}
}
catch
(
AtlasServiceException
e
)
{
e
.
printStackTrace
();
...
...
This diff is collapsed.
Click to expand it.
atlas-examples/sample-app/src/main/java/org/apache/atlas/examples/sampleapp/EntityExample.java
View file @
83e9c21f
...
...
@@ -65,25 +65,25 @@ public class EntityExample {
if
(
dbEntity
==
null
)
{
dbEntity
=
createDatabaseEntity
(
DATABASE_NAME
);
S
ystem
.
out
.
println
(
"Created database entity: typeName="
+
dbEntity
.
getTypeName
(
)
+
", guid="
+
dbEntity
.
getGuid
());
S
ampleApp
.
log
(
"Created entity: typeName="
+
dbEntity
.
getTypeName
()
+
", qualifiedName="
+
dbEntity
.
getAttribute
(
ATTR_QUALIFIED_NAME
)
+
", guid="
+
dbEntity
.
getGuid
());
}
if
(
tableEntityCanada
==
null
)
{
tableEntityCanada
=
createTableEntity
(
TABLE_NAME
+
"_CANADA"
);
S
ystem
.
out
.
println
(
"Created table entity : typeName="
+
tableEntityCanada
.
getTypeName
(
)
+
", guid="
+
tableEntityCanada
.
getGuid
());
S
ampleApp
.
log
(
"Created entity: typeName="
+
tableEntityCanada
.
getTypeName
()
+
", qualifiedName="
+
tableEntityCanada
.
getAttribute
(
ATTR_QUALIFIED_NAME
)
+
", guid="
+
tableEntityCanada
.
getGuid
());
}
if
(
tableEntityUS
==
null
)
{
tableEntityUS
=
createTableEntity
(
TABLE_NAME
+
"_US"
);
S
ystem
.
out
.
println
(
"Created table entity : typeName="
+
tableEntityUS
.
getTypeName
(
)
+
", guid="
+
tableEntityUS
.
getGuid
());
S
ampleApp
.
log
(
"Created entity: typeName="
+
tableEntityUS
.
getTypeName
()
+
", qualifiedName="
+
tableEntityUS
.
getAttribute
(
ATTR_QUALIFIED_NAME
)
+
", guid="
+
tableEntityUS
.
getGuid
());
}
if
(
loadProcess
==
null
)
{
loadProcess
=
createProcessEntity
(
PROCESS_NAME
);
S
ystem
.
out
.
println
(
"Created process entity : typeName="
+
loadProcess
.
getTypeName
(
)
+
", guid="
+
loadProcess
.
getGuid
());
S
ampleApp
.
log
(
"Created entity: typeName="
+
loadProcess
.
getTypeName
()
+
", qualifiedName="
+
loadProcess
.
getAttribute
(
ATTR_QUALIFIED_NAME
)
+
", guid="
+
loadProcess
.
getGuid
());
}
}
...
...
@@ -95,22 +95,23 @@ public class EntityExample {
AtlasEntityWithExtInfo
entity
=
client
.
getEntityByGuid
(
entityGuid
);
if
(
entity
!=
null
)
{
System
.
out
.
println
(
"Retrieved entity with guid="
+
entityGuid
+
": "
+
entity
);
SampleApp
.
log
(
"Retrieved entity with guid="
+
entityGuid
);
SampleApp
.
log
(
" "
+
entity
);
}
}
public
void
deleteEntities
()
throws
Exception
{
client
.
deleteEntityByGuid
(
loadProcess
.
getGuid
());
S
ystem
.
out
.
println
(
"Deleted entity: guid="
+
loadProcess
.
getGuid
());
S
ampleApp
.
log
(
"Deleted entity: guid="
+
loadProcess
.
getGuid
());
List
<
String
>
entityGuids
=
Arrays
.
asList
(
tableEntityUS
.
getGuid
(),
tableEntityCanada
.
getGuid
(),
dbEntity
.
getGuid
());
client
.
deleteEntitiesByGuids
(
entityGuids
);
S
ystem
.
out
.
println
(
"Deleted entities:"
);
S
ampleApp
.
log
(
"Deleted entities:"
);
for
(
String
entityGuid
:
entityGuids
)
{
S
ystem
.
out
.
println
(
" guid="
+
entityGuid
);
S
ampleApp
.
log
(
" guid="
+
entityGuid
);
}
}
...
...
@@ -119,14 +120,14 @@ public class EntityExample {
Arrays
.
asList
(
createColumn
(
COLUMN_TIME_ID
,
"int"
,
"time id"
),
createColumn
(
COLUMN_CUSTOMER_ID
,
"int"
,
"customer id"
,
SampleAppConstants
.
PII_TAG
),
createColumn
(
COLUMN_COMPANY_ID
,
"double"
,
"company id"
,
SampleAppConstants
.
FINANCE_TAG
)),
SampleAppConstants
.
METRIC_
CLASSIFICATION
);
SampleAppConstants
.
METRIC_
TAG
);
}
private
AtlasEntityHeader
createProcessEntity
(
String
processName
)
throws
Exception
{
return
createProcess
(
processName
,
"hive query for monthly avg salary"
,
"user ETL"
,
asList
(
tableEntityUS
),
asList
(
tableEntityCanada
),
"create table as select "
,
"plan"
,
"id"
,
"graph"
,
SampleAppConstants
.
CLASSIFI
CATION
);
"create table as select "
,
"plan"
,
"id"
,
"graph"
,
SampleAppConstants
.
CLASSIFI
ED_TAG
);
}
private
AtlasEntityHeader
createProcess
(
String
name
,
String
description
,
String
user
,
List
<
AtlasEntity
>
inputs
,
List
<
AtlasEntity
>
outputs
,
...
...
@@ -193,7 +194,7 @@ public class EntityExample {
}
}
}
catch
(
AtlasServiceException
e
)
{
S
ystem
.
out
.
println
(
"failed in create entity"
);
S
ampleApp
.
log
(
"failed in create entity"
);
e
.
printStackTrace
();
}
...
...
This diff is collapsed.
Click to expand it.
atlas-examples/sample-app/src/main/java/org/apache/atlas/examples/sampleapp/GlossaryExample.java
View file @
83e9c21f
...
...
@@ -51,12 +51,12 @@ public class GlossaryExample {
assert
(
extInfo
!=
null
);
S
ystem
.
out
.
println
(
"extra info of Glossary is :- "
+
extInfo
.
getGuid
()
+
" name is :- "
+
extInfo
.
getName
()
+
" language is :- "
+
extInfo
.
getLanguage
());
S
ampleApp
.
log
(
"extra info of Glossary is :- "
+
extInfo
.
getGuid
()
+
" name is :- "
+
extInfo
.
getName
()
+
" language is :- "
+
extInfo
.
getLanguage
());
}
public
void
createGlossaryTerm
()
throws
Exception
{
if
(
empSalaryTerm
!=
null
)
{
S
ystem
.
out
.
println
(
"EmpSalaryTerm: term already exists"
);
S
ampleApp
.
log
(
"EmpSalaryTerm: term already exists"
);
return
;
}
...
...
@@ -72,13 +72,13 @@ public class GlossaryExample {
empSalaryTerm
=
client
.
createGlossaryTerm
(
term
);
if
(
empSalaryTerm
!=
null
)
{
S
ystem
.
out
.
println
(
"Created term for Employee Salary: "
+
empSalaryTerm
);
S
ampleApp
.
log
(
"Created term for Employee Salary: "
+
empSalaryTerm
);
}
}
public
void
createGlossaryCategory
()
throws
Exception
{
if
(
empCompanyCategory
!=
null
)
{
S
ystem
.
out
.
println
(
"EmpSalaryCategory: category already exists"
);
S
ampleApp
.
log
(
"EmpSalaryCategory: category already exists"
);
return
;
}
...
...
@@ -94,7 +94,7 @@ public class GlossaryExample {
empCompanyCategory
=
client
.
createGlossaryCategory
(
category
);
if
(
empCompanyCategory
!=
null
)
{
S
ystem
.
out
.
println
(
"Created Category for Employee Category :- "
+
empCompanyCategory
);
S
ampleApp
.
log
(
"Created Category for Employee Category :- "
+
empCompanyCategory
);
}
}
...
...
@@ -102,7 +102,7 @@ public class GlossaryExample {
if
(
empGlossary
!=
null
)
{
client
.
deleteGlossaryByGuid
(
empGlossary
.
getGuid
());
S
ystem
.
out
.
println
(
"empGlossary is not present. Skipping the delete operation."
);
S
ampleApp
.
log
(
"empGlossary is not present. Skipping the delete operation."
);
}
empGlossary
=
null
;
...
...
This diff is collapsed.
Click to expand it.
atlas-examples/sample-app/src/main/java/org/apache/atlas/examples/sampleapp/LineageExample.java
View file @
83e9c21f
...
...
@@ -41,7 +41,7 @@ public class LineageExample {
AtlasEntityHeader
fromEntity
=
guidEntityMap
.
get
(
relation
.
getFromEntityId
());
AtlasEntityHeader
toEntity
=
guidEntityMap
.
get
(
relation
.
getToEntityId
());
S
ystem
.
out
.
println
(
fromEntity
.
getDisplayText
()
+
"("
+
fromEntity
.
getTypeName
()
+
") -> "
+
S
ampleApp
.
log
(
fromEntity
.
getDisplayText
()
+
"("
+
fromEntity
.
getTypeName
()
+
") -> "
+
toEntity
.
getDisplayText
()
+
"("
+
toEntity
.
getTypeName
()
+
")"
);
}
}
...
...
This diff is collapsed.
Click to expand it.
atlas-examples/sample-app/src/main/java/org/apache/atlas/examples/sampleapp/SampleApp.java
View file @
83e9c21f
...
...
@@ -22,7 +22,7 @@ import org.apache.atlas.AtlasException;
import
org.apache.atlas.model.instance.AtlasEntity
;
import
org.apache.atlas.utils.AuthenticationUtil
;
import
java.util.
Scanner
;
import
java.util.
Date
;
public
class
SampleApp
{
private
AtlasClientV2
client
;
...
...
@@ -36,17 +36,17 @@ public class SampleApp {
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
String
[]
basicAuthUsernamePassword
=
null
;
String
[]
atlasServerUrls
=
null
;
SampleApp
sampleApp
=
null
;
try
{
atlasServerUrls
=
getServerUrl
();
if
(!
AuthenticationUtil
.
isKerberosAuthenticationEnabled
())
{
basicAuthUsernamePassword
=
getUserInput
();
String
[]
atlasServerUrls
=
getServerUrl
();
String
[]
basicAuthUsernamePassword
=
getUserInput
();
sampleApp
=
new
SampleApp
(
atlasServerUrls
,
basicAuthUsernamePassword
);
}
else
{
String
[]
atlasServerUrls
=
getServerUrl
();
sampleApp
=
new
SampleApp
(
atlasServerUrls
);
}
...
...
@@ -75,8 +75,6 @@ public class SampleApp {
sampleApp
.
glossaryExample
();
entityExample
.
deleteEntities
();
typeDefExample
.
removeTypeDefinitions
();
}
finally
{
if
(
sampleApp
!=
null
&&
sampleApp
.
getClient
()
!=
null
)
{
sampleApp
.
getClient
().
close
();
...
...
@@ -84,6 +82,10 @@ public class SampleApp {
}
}
public
static
void
log
(
String
message
)
{
System
.
out
.
println
(
"["
+
new
Date
()
+
"] "
+
message
);
}
public
AtlasClientV2
getClient
()
{
return
client
;
}
...
...
@@ -99,7 +101,7 @@ public class SampleApp {
discoveryExample
.
testSearch
();
discoveryExample
.
quickSearch
(
entity
.
getTypeName
());
discoveryExample
.
basicSearch
(
entity
.
getTypeName
(),
SampleAppConstants
.
METRIC_
CLASSIFICATION
,
(
String
)
entity
.
getAttribute
(
SampleAppConstants
.
ATTR_NAME
));
discoveryExample
.
basicSearch
(
entity
.
getTypeName
(),
SampleAppConstants
.
METRIC_
TAG
,
(
String
)
entity
.
getAttribute
(
SampleAppConstants
.
ATTR_NAME
));
}
private
void
glossaryExample
()
throws
Exception
{
...
...
@@ -113,39 +115,30 @@ public class SampleApp {
}
private
static
String
[]
getUserInput
()
{
String
username
=
null
;
String
password
=
null
;
try
{
Scanner
scanner
=
new
Scanner
(
System
.
in
);
String
username
=
System
.
console
().
readLine
(
"Enter username: "
);
char
[]
pwChar
=
System
.
console
().
readPassword
(
"Enter password: "
);
String
password
=
(
pwChar
!=
null
)
?
new
String
(
pwChar
)
:
""
;
System
.
out
.
println
(
"Enter username for atlas :- "
);
username
=
scanner
.
nextLine
();
System
.
out
.
println
(
"Enter password for atlas :- "
);
password
=
scanner
.
nextLine
();
return
new
String
[]
{
username
,
password
};
}
catch
(
Exception
e
)
{
System
.
out
.
print
(
"Error while reading user input"
);
System
.
exit
(
1
);
}
return
n
ew
String
[]
{
username
,
password
};
return
n
ull
;
// will not reach here
}
private
static
String
[]
getServerUrl
()
{
String
atlasServerUrl
=
null
;
try
{
S
canner
scanner
=
new
Scanner
(
System
.
in
);
S
tring
atlasServerUrl
=
System
.
console
().
readLine
(
"Enter Atlas server URL: "
);
System
.
out
.
println
(
"Enter url for Atlas server :- "
);
atlasServerUrl
=
scanner
.
nextLine
();
return
new
String
[]
{
atlasServerUrl
};
}
catch
(
Exception
e
)
{
System
.
out
.
print
(
"Error while reading user input"
);
System
.
exit
(
1
);
}
return
n
ew
String
[]
{
atlasServerUrl
};
return
n
ull
;
// will not reach here
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
atlas-examples/sample-app/src/main/java/org/apache/atlas/examples/sampleapp/SampleAppConstants.java
View file @
83e9c21f
...
...
@@ -56,20 +56,20 @@ public final class SampleAppConstants {
public
static
final
String
ENTITY_TYPE_DATASET
=
"DataSet"
;
public
static
final
String
ENTITY_TYPE_PROCESS
=
"Process"
;
public
static
final
String
PII_TAG
=
"
sample_pii_Tag
"
;
public
static
final
String
FINANCE_TAG
=
"
sample_finance_Tag
"
;
public
static
final
String
CLASSIFI
CATION
=
"classification
"
;
public
static
final
String
METRIC_
CLASSIFICATION
=
"Metric
"
;
public
static
final
String
PII_TAG
=
"
SAMPLE_PII
"
;
public
static
final
String
FINANCE_TAG
=
"
SAMPLE_FINANCE
"
;
public
static
final
String
CLASSIFI
ED_TAG
=
"SAMPLE_CLASSIFIED
"
;
public
static
final
String
METRIC_
TAG
=
"SAMPLE_METRIC
"
;
public
static
final
String
DATABASE_TYPE
=
"sample_db_type"
;
public
static
final
String
PROCESS_TYPE
=
"sample_process_type"
;
public
static
final
String
TABLE_TYPE
=
"sample_table_type"
;
public
static
final
String
COLUMN_TYPE
=
"sample_column_type"
;
public
static
final
String
TABLE_DATABASE_TYPE
=
"sample_
Table_DB
"
;
public
static
final
String
TABLE_COLUMNS_TYPE
=
"sample_
Table_C
olumns"
;
public
static
final
String
ENUM_TABLE_TYPE
=
"tableType"
;
public
static
final
String
BUSINESS_METADATA_TYPE
=
"bmWithAllTypes"
;
public
static
final
String
BUSINESS_METADATA_TYPE_MV
=
"bmWithAllTypesMV"
;
public
static
final
String
STRUCT_TYPE_SERDE
=
"serdeType"
;
public
static
final
String
TABLE_DATABASE_TYPE
=
"sample_
db_tables
"
;
public
static
final
String
TABLE_COLUMNS_TYPE
=
"sample_
table_c
olumns"
;
public
static
final
String
ENUM_TABLE_TYPE
=
"
sample_
tableType"
;
public
static
final
String
BUSINESS_METADATA_TYPE
=
"
sample_
bmWithAllTypes"
;
public
static
final
String
BUSINESS_METADATA_TYPE_MV
=
"
sample_
bmWithAllTypesMV"
;
public
static
final
String
STRUCT_TYPE_SERDE
=
"s
ample_s
erdeType"
;
}
This diff is collapsed.
Click to expand it.
atlas-examples/sample-app/src/main/java/org/apache/atlas/examples/sampleapp/TypeDefExample.java
View file @
83e9c21f
...
...
@@ -58,9 +58,9 @@ public class TypeDefExample {
SampleAppConstants
.
COLUMN_TYPE
,
SampleAppConstants
.
PROCESS_TYPE
,
SampleAppConstants
.
PII_TAG
,
SampleAppConstants
.
CLASSIFI
CATION
,
SampleAppConstants
.
CLASSIFI
ED_TAG
,
SampleAppConstants
.
FINANCE_TAG
,
SampleAppConstants
.
METRIC_
CLASSIFICATION
SampleAppConstants
.
METRIC_
TAG
};
private
final
AtlasClientV2
client
;
...
...
@@ -104,7 +104,7 @@ public class TypeDefExample {
assert
(!
typesDef
.
isEmpty
());
S
ystem
.
out
.
println
(
"Created type ["
+
typeName
+
"]"
);
S
ampleApp
.
log
(
"Created type: "
+
typeName
);
}
}
...
...
@@ -114,7 +114,7 @@ public class TypeDefExample {
typesDef
=
null
;
S
ystem
.
out
.
println
(
"Deleted Type
Def successfully!"
);
S
ampleApp
.
log
(
"Deleted Types
Def successfully!"
);
}
}
...
...
@@ -172,10 +172,10 @@ public class TypeDefExample {
}
private
List
<
AtlasClassificationDef
>
createClassificationDefs
()
{
AtlasClassificationDef
classification
=
createTraitTypeDef
(
SampleAppConstants
.
CLASSIFI
CATION
,
Collections
.<
String
>
emptySet
(),
AtlasTypeUtil
.
createRequiredAttrDef
(
"tag"
,
"string"
));
AtlasClassificationDef
classification
=
createTraitTypeDef
(
SampleAppConstants
.
CLASSIFI
ED_TAG
,
Collections
.<
String
>
emptySet
(),
AtlasTypeUtil
.
createRequiredAttrDef
(
"tag"
,
"string"
));
AtlasClassificationDef
pii
=
createTraitTypeDef
(
SampleAppConstants
.
PII_TAG
,
Collections
.<
String
>
emptySet
());
AtlasClassificationDef
finance
=
createTraitTypeDef
(
SampleAppConstants
.
FINANCE_TAG
,
Collections
.<
String
>
emptySet
());
AtlasClassificationDef
metric
=
createTraitTypeDef
(
SampleAppConstants
.
METRIC_
CLASSIFICATION
,
Collections
.
emptySet
());
AtlasClassificationDef
metric
=
createTraitTypeDef
(
SampleAppConstants
.
METRIC_
TAG
,
Collections
.
emptySet
());
return
Arrays
.
asList
(
classification
,
pii
,
finance
,
metric
);
}
...
...
@@ -223,7 +223,7 @@ public class TypeDefExample {
for
(
AtlasEnumDef
enumDef
:
typesDef
.
getEnumDefs
())
{
if
(
client
.
typeWithNameExists
(
enumDef
.
getName
()))
{
S
ystem
.
out
.
println
(
"Type "
+
enumDef
.
getName
()
+
"
already exists. Skipping"
);
S
ampleApp
.
log
(
enumDef
.
getName
()
+
": type
already exists. Skipping"
);
}
else
{
typesToCreate
.
getEnumDefs
().
add
(
enumDef
);
}
...
...
@@ -231,7 +231,7 @@ public class TypeDefExample {
for
(
AtlasStructDef
structDef
:
typesDef
.
getStructDefs
())
{
if
(
client
.
typeWithNameExists
(
structDef
.
getName
()))
{
S
ystem
.
out
.
println
(
"Type "
+
structDef
.
getName
()
+
"
already exists. Skipping"
);
S
ampleApp
.
log
(
structDef
.
getName
()
+
": type
already exists. Skipping"
);
}
else
{
typesToCreate
.
getStructDefs
().
add
(
structDef
);
}
...
...
@@ -239,7 +239,7 @@ public class TypeDefExample {
for
(
AtlasEntityDef
entityDef
:
typesDef
.
getEntityDefs
())
{
if
(
client
.
typeWithNameExists
(
entityDef
.
getName
()))
{
S
ystem
.
out
.
println
(
"Type "
+
entityDef
.
getName
()
+
"
already exists. Skipping"
);
S
ampleApp
.
log
(
entityDef
.
getName
()
+
": type
already exists. Skipping"
);
}
else
{
typesToCreate
.
getEntityDefs
().
add
(
entityDef
);
}
...
...
@@ -247,7 +247,7 @@ public class TypeDefExample {
for
(
AtlasClassificationDef
classificationDef
:
typesDef
.
getClassificationDefs
())
{
if
(
client
.
typeWithNameExists
(
classificationDef
.
getName
()))
{
S
ystem
.
out
.
println
(
"Type "
+
classificationDef
.
getName
()
+
"
already exists. Skipping"
);
S
ampleApp
.
log
(
classificationDef
.
getName
()
+
": type
already exists. Skipping"
);
}
else
{
typesToCreate
.
getClassificationDefs
().
add
(
classificationDef
);
}
...
...
@@ -255,7 +255,7 @@ public class TypeDefExample {
for
(
AtlasRelationshipDef
relationshipDef
:
typesDef
.
getRelationshipDefs
())
{
if
(
client
.
typeWithNameExists
(
relationshipDef
.
getName
()))
{
S
ystem
.
out
.
println
(
"Type "
+
relationshipDef
.
getName
()
+
"
already exists. Skipping"
);
S
ampleApp
.
log
(
relationshipDef
.
getName
()
+
": type
already exists. Skipping"
);
}
else
{
typesToCreate
.
getRelationshipDefs
().
add
(
relationshipDef
);
}
...
...
@@ -263,7 +263,7 @@ public class TypeDefExample {
for
(
AtlasBusinessMetadataDef
businessMetadataDef
:
typesDef
.
getBusinessMetadataDefs
())
{
if
(
client
.
typeWithNameExists
(
businessMetadataDef
.
getName
()))
{
S
ystem
.
out
.
println
(
"Type "
+
businessMetadataDef
.
getName
()
+
"
already exists. Skipping"
);
S
ampleApp
.
log
(
businessMetadataDef
.
getName
()
+
": type
already exists. Skipping"
);
}
else
{
typesToCreate
.
getBusinessMetadataDefs
().
add
(
businessMetadataDef
);
}
...
...
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