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
7ebb2013
Commit
7ebb2013
authored
Mar 07, 2016
by
Suma Shivaprasad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-463 Disconnect inverse references ( dkantor via sumasai)
parent
a77d1ab5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
126 additions
and
3 deletions
+126
-3
release-log.txt
release-log.txt
+1
-0
AtlasEdgeLabel.java
...ava/org/apache/atlas/repository/graph/AtlasEdgeLabel.java
+98
-0
TypedInstanceToGraphMapper.java
...he/atlas/repository/graph/TypedInstanceToGraphMapper.java
+0
-0
TestUtils.java
repository/src/test/java/org/apache/atlas/TestUtils.java
+1
-1
GraphBackedMetadataRepositoryDeleteEntitiesTest.java
...raph/GraphBackedMetadataRepositoryDeleteEntitiesTest.java
+0
-0
GraphBackedMetadataRepositoryTest.java
...s/repository/graph/GraphBackedMetadataRepositoryTest.java
+24
-1
DefaultMetadataServiceTest.java
.../org/apache/atlas/service/DefaultMetadataServiceTest.java
+2
-1
No files found.
release-log.txt
View file @
7ebb2013
...
...
@@ -10,6 +10,7 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file (dosset
ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via shwethags)
ALL CHANGES:
ATLAS-463 Disconnect inverse references ( dkantor via sumasai)
ATLAS-479 Add description for different types during create time (guptaneeru via shwethags)
ATLAS-508 Apache nightly build failure - UnsupportedOperationException: Not a single key: __traitNames (shwethags)
ATLAS-422 JavaDoc NotificationConsumer and NotificationInterface.(tbeerbower via sumasai)
...
...
repository/src/main/java/org/apache/atlas/repository/graph/AtlasEdgeLabel.java
0 → 100644
View file @
7ebb2013
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
apache
.
atlas
.
repository
.
graph
;
/**
* Represents an edge label used in Atlas.
* The format of an Atlas edge label is EDGE_LABEL_PREFIX<<typeName>>.<<attributeName>>[.mapKey]
*
*/
public
class
AtlasEdgeLabel
{
private
final
String
typeName_
;
private
final
String
attributeName_
;
private
final
String
mapKey_
;
private
final
String
edgeLabel_
;
private
final
String
qualifiedMapKey_
;
private
final
String
qualifiedAttributeName_
;
public
AtlasEdgeLabel
(
String
edgeLabel
)
{
if
(!
edgeLabel
.
startsWith
(
GraphHelper
.
EDGE_LABEL_PREFIX
))
{
throw
new
IllegalArgumentException
(
"Invalid edge label "
+
edgeLabel
+
": missing required prefix "
+
GraphHelper
.
EDGE_LABEL_PREFIX
);
}
String
labelWithoutPrefix
=
edgeLabel
.
substring
(
GraphHelper
.
EDGE_LABEL_PREFIX
.
length
());
String
[]
fields
=
labelWithoutPrefix
.
split
(
"\\."
,
3
);
if
(
fields
.
length
<
2
||
fields
.
length
>
3
)
{
throw
new
IllegalArgumentException
(
"Invalid edge label "
+
edgeLabel
+
": expected 2 or 3 label components but found "
+
fields
.
length
);
}
typeName_
=
fields
[
0
];
attributeName_
=
fields
[
1
];
if
(
fields
.
length
==
3
)
{
mapKey_
=
fields
[
2
];
qualifiedMapKey_
=
labelWithoutPrefix
;
qualifiedAttributeName_
=
typeName_
+
'.'
+
attributeName_
;
}
else
{
mapKey_
=
null
;
qualifiedMapKey_
=
null
;
qualifiedAttributeName_
=
labelWithoutPrefix
;
}
edgeLabel_
=
edgeLabel
;
}
public
String
getTypeName
()
{
return
typeName_
;
}
public
String
getAttributeName
()
{
return
attributeName_
;
}
public
String
getMapKey
()
{
return
mapKey_
;
}
public
String
getEdgeLabel
()
{
return
edgeLabel_
;
}
public
String
getQualifiedMapKey
()
{
return
qualifiedMapKey_
;
}
public
String
getQualifiedAttributeName
()
{
return
qualifiedAttributeName_
;
}
@Override
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
'('
).
append
(
"typeName: "
).
append
(
typeName_
);
sb
.
append
(
", attributeName: "
).
append
(
attributeName_
);
if
(
mapKey_
!=
null
)
{
sb
.
append
(
", mapKey: "
).
append
(
mapKey_
);
sb
.
append
(
", qualifiedMapKey: "
).
append
(
qualifiedMapKey_
);
}
sb
.
append
(
", edgeLabel: "
).
append
(
edgeLabel_
).
append
(
')'
);
return
sb
.
toString
();
}
}
\ No newline at end of file
repository/src/main/java/org/apache/atlas/repository/graph/TypedInstanceToGraphMapper.java
View file @
7ebb2013
This diff is collapsed.
Click to expand it.
repository/src/test/java/org/apache/atlas/TestUtils.java
View file @
7ebb2013
...
...
@@ -170,7 +170,7 @@ public final class TestUtils {
max
.
set
(
"mentor"
,
julius
);
john
.
set
(
"manager"
,
jane
);
john
.
set
(
"mentor"
,
max
);
hrDept
.
set
(
"employees"
,
ImmutableList
.
of
(
john
,
jane
,
julius
,
max
));
jane
.
set
(
"subordinates"
,
ImmutableList
.
of
(
john
,
max
));
...
...
repository/src/test/java/org/apache/atlas/repository/graph/GraphBackedMetadataRepositoryDeleteEntitiesTest.java
View file @
7ebb2013
This diff is collapsed.
Click to expand it.
repository/src/test/java/org/apache/atlas/repository/graph/GraphBackedMetadataRepositoryTest.java
View file @
7ebb2013
...
...
@@ -534,7 +534,6 @@ public class GraphBackedMetadataRepositoryTest {
Assert
.
assertTrue
(
creationTimestamp
<
modificationTimestampPostUpdate
);
// Update max's mentor reference to jane.
instance
=
personType
.
createInstance
(
max
.
getId
());
instance
.
set
(
"mentor"
,
janeGuid
);
repositoryService
.
updatePartial
(
instance
);
...
...
@@ -550,6 +549,30 @@ public class GraphBackedMetadataRepositoryTest {
Long
modificationTimestampPost2ndUpdate
=
vertex
.
getProperty
(
Constants
.
MODIFICATION_TIMESTAMP_PROPERTY_KEY
);
Assert
.
assertNotNull
(
modificationTimestampPost2ndUpdate
);
Assert
.
assertTrue
(
modificationTimestampPostUpdate
<
modificationTimestampPost2ndUpdate
);
ITypedReferenceableInstance
julius
=
repositoryService
.
getEntityDefinition
(
"Person"
,
"name"
,
"Julius"
);
Id
juliusGuid
=
julius
.
getId
();
instance
=
personType
.
createInstance
(
max
.
getId
());
instance
.
set
(
"manager"
,
juliusGuid
);
repositoryService
.
updatePartial
(
instance
);
// Verify the update was applied correctly - julius should now be max's manager.
max
=
repositoryService
.
getEntityDefinition
(
maxGuid
);
object
=
max
.
get
(
"manager"
);
Assert
.
assertTrue
(
object
instanceof
ITypedReferenceableInstance
);
refTarget
=
(
ITypedReferenceableInstance
)
object
;
Assert
.
assertEquals
(
refTarget
.
getId
().
_getId
(),
juliusGuid
.
_getId
());
// Verify that max is no longer a subordinate of jane.
jane
=
repositoryService
.
getEntityDefinition
(
janeGuid
.
_getId
());
Object
refValue
=
jane
.
get
(
"subordinates"
);
Assert
.
assertTrue
(
refValue
instanceof
List
);
List
<
Object
>
subordinates
=
(
List
<
Object
>)
refValue
;
Assert
.
assertEquals
(
subordinates
.
size
(),
1
);
Object
listValue
=
subordinates
.
get
(
0
);
Assert
.
assertTrue
(
listValue
instanceof
ITypedReferenceableInstance
);
ITypedReferenceableInstance
subordinate
=
(
ITypedReferenceableInstance
)
listValue
;
Assert
.
assertNotEquals
(
subordinate
.
getId
().
_getId
(),
maxGuid
);
}
private
ITypedReferenceableInstance
createHiveTableInstance
(
Referenceable
databaseInstance
)
throws
Exception
{
...
...
repository/src/test/java/org/apache/atlas/service/DefaultMetadataServiceTest.java
View file @
7ebb2013
...
...
@@ -788,7 +788,8 @@ public class DefaultMetadataServiceTest {
for
(
ITypedReferenceableInstance
deletedEntity
:
deletedEntitiesFromListener
)
{
deletedGuidsFromListener
.
add
(
deletedEntity
.
getId
().
_getId
());
}
Assert
.
assertEquals
(
deletedGuidsFromListener
,
deletedGuids
);
Assert
.
assertEquals
(
deletedGuidsFromListener
.
size
(),
deletedGuids
.
size
());
Assert
.
assertTrue
(
deletedGuidsFromListener
.
containsAll
(
deletedGuids
));
}
private
static
class
DeleteEntitiesChangeListener
implements
EntityChangeListener
{
...
...
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