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
4ddceacb
Commit
4ddceacb
authored
6 years ago
by
apoorvnaik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Janusgraph update to 0.3.0
parent
1099f1ba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
18 deletions
+13
-18
pom.xml
graphdb/janus/pom.xml
+1
-1
AtlasJanusGraph.java
...pache/atlas/repository/graphdb/janus/AtlasJanusGraph.java
+12
-17
No files found.
graphdb/janus/pom.xml
View file @
4ddceacb
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
<properties>
<properties>
<tinkerpop.version>
3.3.3
</tinkerpop.version>
<tinkerpop.version>
3.3.3
</tinkerpop.version>
<janus.version>
0.
2
.0
</janus.version>
<janus.version>
0.
3
.0
</janus.version>
<checkstyle.failOnViolation>
false
</checkstyle.failOnViolation>
<checkstyle.failOnViolation>
false
</checkstyle.failOnViolation>
<lucene-solr.version>
7.3.0
</lucene-solr.version>
<lucene-solr.version>
7.3.0
</lucene-solr.version>
</properties>
</properties>
...
...
This diff is collapsed.
Click to expand it.
graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraph.java
View file @
4ddceacb
...
@@ -6,9 +6,9 @@
...
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
*
*
<p>
*
http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
*
<p>
* Unless required by applicable law or agreed to in writing, software
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
...
@@ -37,9 +37,8 @@ import org.apache.atlas.repository.graphdb.janus.query.AtlasJanusGraphQuery;
...
@@ -37,9 +37,8 @@ import org.apache.atlas.repository.graphdb.janus.query.AtlasJanusGraphQuery;
import
org.apache.atlas.repository.graphdb.utils.IteratorToIterableAdapter
;
import
org.apache.atlas.repository.graphdb.utils.IteratorToIterableAdapter
;
import
org.apache.atlas.type.AtlasType
;
import
org.apache.atlas.type.AtlasType
;
import
org.apache.commons.configuration.Configuration
;
import
org.apache.commons.configuration.Configuration
;
import
org.apache.tinkerpop.gremlin.groovy.CompilerCustomizerProvider
;
import
org.apache.tinkerpop.gremlin.groovy.DefaultImportCustomizerProvider
;
import
org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine
;
import
org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine
;
import
org.apache.tinkerpop.gremlin.jsr223.DefaultImportCustomizer
;
import
org.apache.tinkerpop.gremlin.process.traversal.P
;
import
org.apache.tinkerpop.gremlin.process.traversal.P
;
import
org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__
;
import
org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__
;
import
org.apache.tinkerpop.gremlin.process.traversal.step.util.ImmutablePath
;
import
org.apache.tinkerpop.gremlin.process.traversal.step.util.ImmutablePath
;
...
@@ -268,15 +267,11 @@ public class AtlasJanusGraph implements AtlasGraph<AtlasJanusVertex, AtlasJanusE
...
@@ -268,15 +267,11 @@ public class AtlasJanusGraph implements AtlasGraph<AtlasJanusVertex, AtlasJanusE
@Override
@Override
public
GremlinGroovyScriptEngine
getGremlinScriptEngine
()
{
public
GremlinGroovyScriptEngine
getGremlinScriptEngine
()
{
Set
<
String
>
extraImports
=
new
HashSet
<
String
>();
DefaultImportCustomizer
.
Builder
importBuilder
=
DefaultImportCustomizer
.
build
()
Set
<
String
>
extraStaticImports
=
new
HashSet
<
String
>();
.
addClassImports
(
java
.
util
.
function
.
Function
.
class
)
.
addMethodImports
(
__
.
class
.
getMethods
())
extraImports
.
add
(
java
.
util
.
function
.
Function
.
class
.
getName
());
.
addMethodImports
(
P
.
class
.
getMethods
());
extraStaticImports
.
add
(
P
.
class
.
getName
()
+
".*"
);
GremlinGroovyScriptEngine
scriptEngine
=
new
GremlinGroovyScriptEngine
(
importBuilder
.
create
());
extraStaticImports
.
add
(
__
.
class
.
getName
()
+
".*"
);
CompilerCustomizerProvider
provider
=
new
DefaultImportCustomizerProvider
(
extraImports
,
extraStaticImports
);
GremlinGroovyScriptEngine
scriptEngine
=
new
GremlinGroovyScriptEngine
(
provider
);
return
scriptEngine
;
return
scriptEngine
;
}
}
...
@@ -285,7 +280,7 @@ public class AtlasJanusGraph implements AtlasGraph<AtlasJanusVertex, AtlasJanusE
...
@@ -285,7 +280,7 @@ public class AtlasJanusGraph implements AtlasGraph<AtlasJanusVertex, AtlasJanusE
public
void
releaseGremlinScriptEngine
(
ScriptEngine
scriptEngine
)
{
public
void
releaseGremlinScriptEngine
(
ScriptEngine
scriptEngine
)
{
if
(
scriptEngine
instanceof
GremlinGroovyScriptEngine
)
{
if
(
scriptEngine
instanceof
GremlinGroovyScriptEngine
)
{
try
{
try
{
((
GremlinGroovyScriptEngine
)
scriptEngine
).
close
();
((
GremlinGroovyScriptEngine
)
scriptEngine
).
close
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// ignore
// ignore
}
}
...
@@ -402,7 +397,7 @@ public class AtlasJanusGraph implements AtlasGraph<AtlasJanusVertex, AtlasJanusE
...
@@ -402,7 +397,7 @@ public class AtlasJanusGraph implements AtlasGraph<AtlasJanusVertex, AtlasJanusE
}
else
if
(
rawValue
instanceof
Edge
)
{
}
else
if
(
rawValue
instanceof
Edge
)
{
return
GraphDbObjectFactory
.
createEdge
(
this
,
(
Edge
)
rawValue
);
return
GraphDbObjectFactory
.
createEdge
(
this
,
(
Edge
)
rawValue
);
}
else
if
(
rawValue
instanceof
Map
)
{
}
else
if
(
rawValue
instanceof
Map
)
{
Map
<
String
,
Object
>
rowValue
=
(
Map
<
String
,
Object
>)
rawValue
;
Map
<
String
,
Object
>
rowValue
=
(
Map
<
String
,
Object
>)
rawValue
;
return
Maps
.
transformValues
(
rowValue
,
GREMLIN_VALUE_CONVERSION_FUNCTION
);
return
Maps
.
transformValues
(
rowValue
,
GREMLIN_VALUE_CONVERSION_FUNCTION
);
}
else
if
(
rawValue
instanceof
ImmutablePath
)
{
}
else
if
(
rawValue
instanceof
ImmutablePath
)
{
...
@@ -410,7 +405,7 @@ public class AtlasJanusGraph implements AtlasGraph<AtlasJanusVertex, AtlasJanusE
...
@@ -410,7 +405,7 @@ public class AtlasJanusGraph implements AtlasGraph<AtlasJanusVertex, AtlasJanusE
return
convertGremlinValue
(
path
.
objects
());
return
convertGremlinValue
(
path
.
objects
());
}
else
if
(
rawValue
instanceof
List
)
{
}
else
if
(
rawValue
instanceof
List
)
{
return
Lists
.
transform
((
List
)
rawValue
,
GREMLIN_VALUE_CONVERSION_FUNCTION
);
return
Lists
.
transform
((
List
)
rawValue
,
GREMLIN_VALUE_CONVERSION_FUNCTION
);
}
else
if
(
rawValue
instanceof
Collection
)
{
}
else
if
(
rawValue
instanceof
Collection
)
{
throw
new
UnsupportedOperationException
(
"Unhandled collection type: "
+
rawValue
.
getClass
());
throw
new
UnsupportedOperationException
(
"Unhandled collection type: "
+
rawValue
.
getClass
());
}
}
...
...
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