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
c6aaef08
Commit
c6aaef08
authored
Oct 15, 2018
by
Ashutosh Mestry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2923: Options copied to AttributeDefinition
parent
3b292409
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
346 deletions
+29
-346
0010-base_model.json
addons/models/0010-base_model.json
+0
-335
AtlasTypeUtil.java
intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java
+1
-0
AttributeDefinition.java
...rg/apache/atlas/v1/model/typedef/AttributeDefinition.java
+24
-7
TypesUtil.java
...org/apache/atlas/v1/typesystem/types/utils/TypesUtil.java
+3
-3
TypeConverterUtil.java
...apache/atlas/repository/converters/TypeConverterUtil.java
+1
-1
No files found.
addons/models/0010-base_model.json
deleted
100644 → 0
View file @
3b292409
{
"enumDefs"
:
[],
"structDefs"
:
[],
"classificationDefs"
:
[
{
"name"
:
"TaxonomyTerm"
,
"superTypes"
:
[],
"typeVersion"
:
"1.0"
,
"attributeDefs"
:
[
{
"name"
:
"atlas.taxonomy"
,
"typeName"
:
"string"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
false
,
"isOptional"
:
true
,
"isUnique"
:
false
}
]
}
],
"entityDefs"
:
[
{
"name"
:
"Referenceable"
,
"superTypes"
:
[],
"typeVersion"
:
"1.0"
,
"attributeDefs"
:
[
{
"name"
:
"qualifiedName"
,
"typeName"
:
"string"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
true
,
"isOptional"
:
false
,
"isUnique"
:
true
}
]
},
{
"name"
:
"__internal"
,
"superTypes"
:
[],
"typeVersion"
:
"1.0"
,
"attributeDefs"
:
[]
},
{
"name"
:
"Asset"
,
"superTypes"
:
[],
"typeVersion"
:
"1.0"
,
"attributeDefs"
:
[
{
"name"
:
"name"
,
"typeName"
:
"string"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
true
,
"isOptional"
:
false
,
"isUnique"
:
false
},
{
"name"
:
"description"
,
"typeName"
:
"string"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
false
,
"isOptional"
:
true
,
"isUnique"
:
false
},
{
"name"
:
"owner"
,
"typeName"
:
"string"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
true
,
"isOptional"
:
true
,
"isUnique"
:
false
}
]
},
{
"name"
:
"DataSet"
,
"superTypes"
:
[
"Referenceable"
,
"Asset"
],
"typeVersion"
:
"1.0"
,
"attributeDefs"
:
[]
},
{
"name"
:
"Infrastructure"
,
"superTypes"
:
[
"Referenceable"
,
"Asset"
],
"typeVersion"
:
"1.0"
,
"attributeDefs"
:
[]
},
{
"name"
:
"Process"
,
"superTypes"
:
[
"Referenceable"
,
"Asset"
],
"typeVersion"
:
"1.0"
,
"attributeDefs"
:
[
{
"name"
:
"inputs"
,
"typeName"
:
"array<DataSet>"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
false
,
"isOptional"
:
true
,
"isUnique"
:
false
},
{
"name"
:
"outputs"
,
"typeName"
:
"array<DataSet>"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
false
,
"isOptional"
:
true
,
"isUnique"
:
false
}
]
},
{
"name"
:
"AtlasServer"
,
"typeVersion"
:
"1.0"
,
"superTypes"
:
[
],
"attributeDefs"
:
[
{
"name"
:
"name"
,
"typeName"
:
"string"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
true
,
"isOptional"
:
false
,
"isUnique"
:
false
},
{
"name"
:
"displayName"
,
"typeName"
:
"string"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
true
,
"isOptional"
:
false
,
"isUnique"
:
false
},
{
"name"
:
"fullName"
,
"typeName"
:
"string"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
true
,
"isOptional"
:
false
,
"isUnique"
:
true
},
{
"name"
:
"urls"
,
"typeName"
:
"array<string>"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
false
,
"isOptional"
:
true
,
"isUnique"
:
false
},
{
"name"
:
"additionalInfo"
,
"typeName"
:
"map<string,string>"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
false
,
"isOptional"
:
true
,
"isUnique"
:
false
}
]
},
{
"name"
:
"__AtlasUserProfile"
,
"superTypes"
:
[
"__internal"
],
"typeVersion"
:
"1.0"
,
"attributeDefs"
:
[
{
"name"
:
"name"
,
"typeName"
:
"string"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
true
,
"isOptional"
:
false
,
"isUnique"
:
true
},
{
"name"
:
"fullName"
,
"typeName"
:
"string"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
false
,
"isOptional"
:
true
,
"isUnique"
:
false
},
{
"name"
:
"savedSearches"
,
"typeName"
:
"array<__AtlasUserSavedSearch>"
,
"cardinality"
:
"LIST"
,
"isIndexable"
:
false
,
"isOptional"
:
true
,
"isUnique"
:
false
,
"constraints"
:
[
{
"type"
:
"ownedRef"
}
]
}
]
},
{
"name"
:
"__AtlasUserSavedSearch"
,
"superTypes"
:
[
"__internal"
],
"typeVersion"
:
"1.0"
,
"attributeDefs"
:
[
{
"name"
:
"name"
,
"typeName"
:
"string"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
false
,
"isOptional"
:
false
,
"isUnique"
:
false
},
{
"name"
:
"ownerName"
,
"typeName"
:
"string"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
false
,
"isOptional"
:
false
,
"isUnique"
:
false
},
{
"name"
:
"uniqueName"
,
"typeName"
:
"string"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
true
,
"isOptional"
:
false
,
"isUnique"
:
true
},
{
"name"
:
"searchType"
,
"typeName"
:
"string"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
true
,
"isOptional"
:
false
,
"isUnique"
:
false
},
{
"name"
:
"searchParameters"
,
"typeName"
:
"string"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
false
,
"isOptional"
:
false
,
"isUnique"
:
false
},
{
"name"
:
"searchParameters"
,
"typeName"
:
"string"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
false
,
"isOptional"
:
true
,
"isUnique"
:
false
}
]
},
{
"name"
:
"__ExportImportAuditEntry"
,
"typeVersion"
:
"1.0"
,
"superTypes"
:
[
"__internal"
],
"attributeDefs"
:
[
{
"name"
:
"userName"
,
"typeName"
:
"string"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
false
,
"isOptional"
:
true
,
"isUnique"
:
false
},
{
"name"
:
"operation"
,
"typeName"
:
"string"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
true
,
"isOptional"
:
false
,
"isUnique"
:
false
},
{
"name"
:
"sourceServerName"
,
"typeName"
:
"string"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
true
,
"isOptional"
:
true
,
"isUnique"
:
false
},
{
"name"
:
"targetServerName"
,
"typeName"
:
"string"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
true
,
"isOptional"
:
true
,
"isUnique"
:
false
},
{
"name"
:
"operationParams"
,
"typeName"
:
"string"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
true
,
"isOptional"
:
true
,
"isUnique"
:
false
},
{
"name"
:
"operationStartTime"
,
"typeName"
:
"long"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
true
,
"isOptional"
:
false
,
"isUnique"
:
false
},
{
"name"
:
"operationEndTime"
,
"typeName"
:
"long"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
true
,
"isOptional"
:
true
,
"isUnique"
:
false
},
{
"name"
:
"resultSummary"
,
"typeName"
:
"string"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
false
,
"isOptional"
:
true
,
"isUnique"
:
false
}
]
}
]
}
intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java
View file @
c6aaef08
...
@@ -481,6 +481,7 @@ public class AtlasTypeUtil {
...
@@ -481,6 +481,7 @@ public class AtlasTypeUtil {
ret
.
setReverseAttributeName
(
attribute
.
getInverseRefAttributeName
());
ret
.
setReverseAttributeName
(
attribute
.
getInverseRefAttributeName
());
ret
.
setDefaultValue
(
attributeDef
.
getDefaultValue
());
ret
.
setDefaultValue
(
attributeDef
.
getDefaultValue
());
ret
.
setDescription
(
attributeDef
.
getDescription
());
ret
.
setDescription
(
attributeDef
.
getDescription
());
ret
.
setOptions
(
attributeDef
.
getOptions
());
final
int
lower
;
final
int
lower
;
final
int
upper
;
final
int
upper
;
...
...
intg/src/main/java/org/apache/atlas/v1/model/typedef/AttributeDefinition.java
View file @
c6aaef08
...
@@ -26,6 +26,8 @@ import javax.xml.bind.annotation.XmlAccessorType;
...
@@ -26,6 +26,8 @@ import javax.xml.bind.annotation.XmlAccessorType;
import
javax.xml.bind.annotation.XmlRootElement
;
import
javax.xml.bind.annotation.XmlRootElement
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Objects
;
import
static
com
.
fasterxml
.
jackson
.
annotation
.
JsonAutoDetect
.
Visibility
.
NONE
;
import
static
com
.
fasterxml
.
jackson
.
annotation
.
JsonAutoDetect
.
Visibility
.
NONE
;
...
@@ -48,22 +50,23 @@ public class AttributeDefinition implements Serializable {
...
@@ -48,22 +50,23 @@ public class AttributeDefinition implements Serializable {
private
String
reverseAttributeName
;
// If this is a reference attribute, then the name of the attribute on the Class that this refers to.
private
String
reverseAttributeName
;
// If this is a reference attribute, then the name of the attribute on the Class that this refers to.
private
String
defaultValue
;
private
String
defaultValue
;
private
String
description
;
private
String
description
;
private
Map
<
String
,
String
>
options
;
public
AttributeDefinition
()
{
public
AttributeDefinition
()
{
}
}
public
AttributeDefinition
(
String
name
,
String
dataTypeName
,
Multiplicity
multiplicity
)
{
public
AttributeDefinition
(
String
name
,
String
dataTypeName
,
Multiplicity
multiplicity
)
{
this
(
name
,
dataTypeName
,
multiplicity
,
false
,
false
,
true
,
null
);
this
(
name
,
dataTypeName
,
multiplicity
,
false
,
false
,
true
,
null
,
null
);
}
}
public
AttributeDefinition
(
String
name
,
String
dataTypeName
,
Multiplicity
multiplicity
,
boolean
isComposite
,
public
AttributeDefinition
(
String
name
,
String
dataTypeName
,
Multiplicity
multiplicity
,
boolean
isComposite
,
String
reverseAttributeName
)
{
String
reverseAttributeName
)
{
this
(
name
,
dataTypeName
,
multiplicity
,
isComposite
,
false
,
false
,
reverseAttributeName
);
this
(
name
,
dataTypeName
,
multiplicity
,
isComposite
,
false
,
false
,
reverseAttributeName
,
null
);
}
}
public
AttributeDefinition
(
String
name
,
String
dataTypeName
,
Multiplicity
multiplicity
,
boolean
isComposite
,
boolean
isUnique
,
boolean
isIndexable
,
String
reverseAttributeName
)
{
public
AttributeDefinition
(
String
name
,
String
dataTypeName
,
Multiplicity
multiplicity
,
boolean
isComposite
,
boolean
isUnique
,
boolean
isIndexable
,
String
reverseAttributeName
,
Map
<
String
,
String
>
options
)
{
this
.
name
=
name
;
this
.
name
=
name
;
this
.
dataTypeName
=
dataTypeName
;
this
.
dataTypeName
=
dataTypeName
;
this
.
multiplicity
=
multiplicity
;
this
.
multiplicity
=
multiplicity
;
...
@@ -71,6 +74,7 @@ public class AttributeDefinition implements Serializable {
...
@@ -71,6 +74,7 @@ public class AttributeDefinition implements Serializable {
this
.
isUnique
=
isUnique
;
this
.
isUnique
=
isUnique
;
this
.
isIndexable
=
isIndexable
;
this
.
isIndexable
=
isIndexable
;
this
.
reverseAttributeName
=
reverseAttributeName
;
this
.
reverseAttributeName
=
reverseAttributeName
;
this
.
options
=
options
;
}
}
...
@@ -146,6 +150,18 @@ public class AttributeDefinition implements Serializable {
...
@@ -146,6 +150,18 @@ public class AttributeDefinition implements Serializable {
this
.
description
=
description
;
this
.
description
=
description
;
}
}
public
Map
<
String
,
String
>
getOptions
()
{
return
options
;
}
public
void
setOptions
(
Map
<
String
,
String
>
options
)
{
if
(
options
!=
null
)
{
this
.
options
=
new
HashMap
<>(
options
);
}
else
{
this
.
options
=
null
;
}
}
@Override
@Override
public
boolean
equals
(
Object
o
)
{
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
{
if
(
this
==
o
)
{
...
@@ -166,12 +182,13 @@ public class AttributeDefinition implements Serializable {
...
@@ -166,12 +182,13 @@ public class AttributeDefinition implements Serializable {
Objects
.
equals
(
multiplicity
,
that
.
multiplicity
)
&&
Objects
.
equals
(
multiplicity
,
that
.
multiplicity
)
&&
Objects
.
equals
(
defaultValue
,
that
.
defaultValue
)
&&
Objects
.
equals
(
defaultValue
,
that
.
defaultValue
)
&&
Objects
.
equals
(
description
,
that
.
description
)
&&
Objects
.
equals
(
description
,
that
.
description
)
&&
Objects
.
equals
(
reverseAttributeName
,
that
.
reverseAttributeName
);
Objects
.
equals
(
reverseAttributeName
,
that
.
reverseAttributeName
)
&&
Objects
.
equals
(
options
,
that
.
options
);
}
}
@Override
@Override
public
int
hashCode
()
{
public
int
hashCode
()
{
return
Objects
.
hash
(
name
,
dataTypeName
,
multiplicity
,
isComposite
,
isUnique
,
isIndexable
,
return
Objects
.
hash
(
name
,
dataTypeName
,
multiplicity
,
isComposite
,
isUnique
,
isIndexable
,
reverseAttributeName
,
defaultValue
,
description
);
reverseAttributeName
,
defaultValue
,
description
,
options
);
}
}
}
}
intg/src/main/java/org/apache/atlas/v1/typesystem/types/utils/TypesUtil.java
View file @
c6aaef08
...
@@ -63,19 +63,19 @@ public class TypesUtil {
...
@@ -63,19 +63,19 @@ public class TypesUtil {
}
}
public
static
AttributeDefinition
createUniqueRequiredAttrDef
(
String
name
,
String
dataTypeName
)
{
public
static
AttributeDefinition
createUniqueRequiredAttrDef
(
String
name
,
String
dataTypeName
)
{
AttributeDefinition
ret
=
new
AttributeDefinition
(
name
,
dataTypeName
,
Multiplicity
.
REQUIRED
,
false
,
true
,
true
,
null
);
AttributeDefinition
ret
=
new
AttributeDefinition
(
name
,
dataTypeName
,
Multiplicity
.
REQUIRED
,
false
,
true
,
true
,
null
,
null
);
return
ret
;
return
ret
;
}
}
public
static
AttributeDefinition
createRequiredAttrDef
(
String
name
,
String
dataTypeName
)
{
public
static
AttributeDefinition
createRequiredAttrDef
(
String
name
,
String
dataTypeName
)
{
AttributeDefinition
ret
=
new
AttributeDefinition
(
name
,
dataTypeName
,
Multiplicity
.
REQUIRED
,
false
,
false
,
true
,
null
);
AttributeDefinition
ret
=
new
AttributeDefinition
(
name
,
dataTypeName
,
Multiplicity
.
REQUIRED
,
false
,
false
,
true
,
null
,
null
);
return
ret
;
return
ret
;
}
}
public
static
AttributeDefinition
createOptionalAttrDef
(
String
name
,
String
dataTypeName
)
{
public
static
AttributeDefinition
createOptionalAttrDef
(
String
name
,
String
dataTypeName
)
{
AttributeDefinition
ret
=
new
AttributeDefinition
(
name
,
dataTypeName
,
Multiplicity
.
OPTIONAL
,
false
,
false
,
true
,
null
);
AttributeDefinition
ret
=
new
AttributeDefinition
(
name
,
dataTypeName
,
Multiplicity
.
OPTIONAL
,
false
,
false
,
true
,
null
,
null
);
return
ret
;
return
ret
;
}
}
...
...
repository/src/main/java/org/apache/atlas/repository/converters/TypeConverterUtil.java
View file @
c6aaef08
...
@@ -362,7 +362,7 @@ public final class TypeConverterUtil {
...
@@ -362,7 +362,7 @@ public final class TypeConverterUtil {
AttributeDefinition
oldAttrDef
=
AtlasStructDefStoreV2
.
toAttributeDefinition
(
attribute
);
AttributeDefinition
oldAttrDef
=
AtlasStructDefStoreV2
.
toAttributeDefinition
(
attribute
);
ret
.
add
(
new
AttributeDefinition
(
oldAttrDef
.
getName
(),
oldAttrDef
.
getDataTypeName
(),
new
Multiplicity
(
oldAttrDef
.
getMultiplicity
()),
oldAttrDef
.
getIsComposite
(),
oldAttrDef
.
getIsUnique
(),
oldAttrDef
.
getIsIndexable
(),
oldAttrDef
.
getReverseAttributeName
()));
ret
.
add
(
new
AttributeDefinition
(
oldAttrDef
.
getName
(),
oldAttrDef
.
getDataTypeName
(),
new
Multiplicity
(
oldAttrDef
.
getMultiplicity
()),
oldAttrDef
.
getIsComposite
(),
oldAttrDef
.
getIsUnique
(),
oldAttrDef
.
getIsIndexable
(),
oldAttrDef
.
getReverseAttributeName
()
,
oldAttrDef
.
getOptions
()
));
}
}
}
}
...
...
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