Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kieker-TeeTime-Stages
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeeTime
Kieker-TeeTime-Stages
Commits
e32c2589
Commit
e32c2589
authored
9 years ago
by
Sören Henning
Browse files
Options
Downloads
Patches
Plain Diff
add Blueprints exporter
parent
15bd424f
No related branches found
No related tags found
1 merge request
!17
Get impletemented stages and Java 8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/kieker/analysis/graph/BlueprintsExporter.java
+56
-0
56 additions, 0 deletions
src/main/java/kieker/analysis/graph/BlueprintsExporter.java
src/main/java/kieker/analysis/graph/GraphTester.java
+2
-2
2 additions, 2 deletions
src/main/java/kieker/analysis/graph/GraphTester.java
with
58 additions
and
2 deletions
src/main/java/kieker/analysis/graph/BlueprintsExporter.java
0 → 100644
+
56
−
0
View file @
e32c2589
package
kieker.analysis.graph
;
import
java.util.HashMap
;
import
java.util.Map
;
import
com.tinkerpop.blueprints.impls.tg.TinkerGraph
;
public
class
BlueprintsExporter
{
private
final
Graph
graph
;
private
final
com
.
tinkerpop
.
blueprints
.
Graph
exportGraph
=
new
TinkerGraph
();
private
final
Map
<
Vertex
,
com
.
tinkerpop
.
blueprints
.
Vertex
>
mappedVertices
=
new
HashMap
<>();
public
BlueprintsExporter
(
final
Graph
graph
)
{
this
.
graph
=
graph
;
}
public
com
.
tinkerpop
.
blueprints
.
Graph
exportGraph
()
{
mapVertices
();
mapEdges
();
return
exportGraph
;
}
private
void
mapVertices
()
{
for
(
final
Vertex
vertex
:
graph
.
getVertices
())
{
com
.
tinkerpop
.
blueprints
.
Vertex
mappedVertex
=
exportGraph
.
addVertex
(
vertex
.
getId
());
mappedVertices
.
put
(
vertex
,
mappedVertex
);
for
(
final
String
propertyKey
:
vertex
.
getPropertyKeys
())
{
mappedVertex
.
setProperty
(
propertyKey
,
vertex
.
getProperty
(
propertyKey
));
}
}
}
private
void
mapEdges
()
{
for
(
final
Edge
edge
:
graph
.
getEdges
())
{
final
com
.
tinkerpop
.
blueprints
.
Vertex
mappedInVertex
=
mappedVertices
.
get
(
edge
.
getVertex
(
Direction
.
IN
));
final
com
.
tinkerpop
.
blueprints
.
Vertex
mappedOutVertex
=
mappedVertices
.
get
(
edge
.
getVertex
(
Direction
.
OUT
));
String
label
=
edge
.
getProperty
(
"label"
);
if
(
label
==
null
)
{
label
=
""
;
}
com
.
tinkerpop
.
blueprints
.
Edge
mappedEdge
=
exportGraph
.
addEdge
(
edge
.
getId
(),
mappedOutVertex
,
mappedInVertex
,
label
);
for
(
final
String
propertyKey
:
edge
.
getPropertyKeys
())
{
mappedEdge
.
setProperty
(
propertyKey
,
edge
.
getProperty
(
propertyKey
));
}
}
}
}
This diff is collapsed.
Click to expand it.
src/main/java/kieker/analysis/graph/GraphTester.java
+
2
−
2
View file @
e32c2589
...
@@ -76,8 +76,8 @@ public class GraphTester {
...
@@ -76,8 +76,8 @@ public class GraphTester {
// node2.addEdgeTo(node11);
// node2.addEdgeTo(node11);
// Export to Blueprints
// Export to Blueprints
//
BlueprintsExporter blueprintsExporter = new BlueprintsExporter(graph);
BlueprintsExporter
blueprintsExporter
=
new
BlueprintsExporter
(
graph
);
//
System.out.println(blueprintsExporter.exportGraph());
System
.
out
.
println
(
blueprintsExporter
.
exportGraph
());
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment