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
f673eba4
Commit
f673eba4
authored
Mar 06, 2017
by
Suma Shivaprasad
Committed by
Madhan Neethiraj
Mar 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1644: Taxonomy API /api/atlas/v1/taxonomies is broken
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
6a4fcb95
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
5 deletions
+46
-5
BaseQuery.java
...c/main/java/org/apache/atlas/catalog/query/BaseQuery.java
+40
-1
AtlasElement.java
...ava/org/apache/atlas/repository/graphdb/AtlasElement.java
+2
-0
Titan0Element.java
...apache/atlas/repository/graphdb/titan0/Titan0Element.java
+2
-1
Titan1Element.java
...apache/atlas/repository/graphdb/titan1/Titan1Element.java
+1
-3
BaseService.java
...main/java/org/apache/atlas/web/resources/BaseService.java
+1
-0
No files found.
catalog/src/main/java/org/apache/atlas/catalog/query/BaseQuery.java
View file @
f673eba4
...
...
@@ -20,8 +20,10 @@ package org.apache.atlas.catalog.query;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.NoSuchElementException
;
import
org.apache.atlas.catalog.Request
;
import
org.apache.atlas.catalog.VertexWrapper
;
...
...
@@ -31,7 +33,9 @@ import org.apache.atlas.catalog.projection.Projection;
import
org.apache.atlas.catalog.projection.ProjectionResult
;
import
org.apache.atlas.repository.Constants
;
import
org.apache.atlas.repository.graph.AtlasGraphProvider
;
import
org.apache.atlas.repository.graphdb.AtlasElement
;
import
org.apache.atlas.repository.graphdb.AtlasGraph
;
import
org.apache.atlas.repository.graphdb.AtlasVertex
;
import
org.apache.atlas.typesystem.persistence.Id
;
import
com.tinkerpop.blueprints.Compare
;
...
...
@@ -113,7 +117,42 @@ public abstract class BaseQuery implements AtlasQuery {
protected
abstract
Pipe
getQueryPipe
();
protected
GremlinPipeline
getRootVertexPipeline
()
{
return
new
GremlinPipeline
(
getGraph
().
getVertices
());
return
new
GremlinPipeline
(
unWrapVertices
());
}
protected
Iterable
<
Object
>
unWrapVertices
()
{
final
Iterable
<
AtlasVertex
>
vertices
=
getGraph
().
getVertices
();
Iterable
<
Object
>
vertexIterable
=
new
Iterable
<
Object
>()
{
Iterator
<
Object
>
iterator
=
new
Iterator
<
Object
>()
{
Iterator
<
AtlasVertex
>
wrapperIterator
=
vertices
.
iterator
();
@Override
public
boolean
hasNext
()
{
return
wrapperIterator
.
hasNext
();
}
@Override
public
Object
next
()
{
if
(
hasNext
())
{
return
((
AtlasElement
)
wrapperIterator
.
next
().
getV
()).
getWrappedElement
();
}
else
{
throw
new
NoSuchElementException
();
}
}
@Override
public
void
remove
()
{
throw
new
UnsupportedOperationException
(
"Remove not supported"
);
}
};
@Override
public
Iterator
<
Object
>
iterator
()
{
return
iterator
;
}
};
return
vertexIterable
;
}
protected
Pipe
getNotDeletedPipe
()
{
...
...
graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasElement.java
View file @
f673eba4
...
...
@@ -166,4 +166,6 @@ public interface AtlasElement {
* @return
*/
boolean
isIdAssigned
();
<
T
>
T
getWrappedElement
();
}
graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/Titan0Element.java
View file @
f673eba4
...
...
@@ -17,6 +17,7 @@
*/
package
org
.
apache
.
atlas
.
repository
.
graphdb
.
titan0
;
import
java.lang.Override
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collections
;
...
...
@@ -134,7 +135,7 @@ public class Titan0Element<T extends Element> implements AtlasElement {
}
// not in interfac
e
@Overrid
e
public
T
getWrappedElement
()
{
return
wrappedElement
;
}
...
...
graphdb/titan1/src/main/java/org/apache/atlas/repository/graphdb/titan1/Titan1Element.java
View file @
f673eba4
...
...
@@ -48,7 +48,6 @@ import com.thinkaurelius.titan.core.TitanElement;
*/
public
class
Titan1Element
<
T
extends
Element
>
implements
AtlasElement
{
private
T
element
;
protected
Titan1Graph
graph
;
...
...
@@ -121,8 +120,7 @@ public class Titan1Element<T extends Element> implements AtlasElement {
return
element
.
id
();
}
//not in interface
@Override
public
T
getWrappedElement
()
{
return
element
;
}
...
...
webapp/src/main/java/org/apache/atlas/web/resources/BaseService.java
View file @
f673eba4
...
...
@@ -65,6 +65,7 @@ public abstract class BaseService {
try
{
return
provider
.
getResources
(
request
);
}
catch
(
RuntimeException
e
)
{
LOG
.
error
(
"Error while retrieving taxonomy "
,
e
);
throw
wrapRuntimeException
(
e
);
}
}
...
...
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