You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by spmallette <gi...@git.apache.org> on 2016/02/23 16:09:14 UTC
[GitHub] incubator-tinkerpop pull request: TINKERPOP-1085 Added gremlin-arc...
GitHub user spmallette opened a pull request:
https://github.com/apache/incubator-tinkerpop/pull/237
TINKERPOP-1085 Added gremlin-archetypes and related submodules
https://issues.apache.org/jira/browse/TINKERPOP-1085
Established the model for "examples" in TinkerPop using Maven archetypes. Provided two archetypes: gremlin-archetype-server and gremlin-archetype-tinkergraph.
Note that each archetype has tests to validate their operations and the tests are configured to execute on standard execution of `mvn clean install`. You can manually try out the achetypes with a command like this:
```text
$ mvn archetype:generate -DarchetypeGroupId=org.apache.tinkerpop -DarchetypeArtifactId=gremlin-archetype-server -DarchetypeVersion=3.1.2-SNAPSHOT -DgroupId=com.my -DartifactId=app
```
which will create a project (based on the `gremlin-archetype-server` module) in a directory called "app".
VOTE +1
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/incubator-tinkerpop TINKERPOP-1085
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-tinkerpop/pull/237.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #237
----
commit bb3bf09f57ba2ceb40565f2f9cefa886718d241d
Author: Stephen Mallette <sp...@genoprime.com>
Date: 2016-02-23T15:01:15Z
Added gremlin-archetypes and related submodules.
Established the model for "examples" in TinkerPop using Maven archetypes. Provided two archetypes: gremlin-archetype-server and gremlin-archetype-tinkergraph.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-tinkerpop pull request: TINKERPOP-1085 Added gremlin-arc...
Posted by pluradj <gi...@git.apache.org>.
Github user pluradj commented on the pull request:
https://github.com/apache/incubator-tinkerpop/pull/237#issuecomment-188378094
I tested both (server and tinkergraph) generated projects on Mac and Windows.
Good stuff @spmallette
VOTE +1
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-tinkerpop pull request: TINKERPOP-1085 Added gremlin-arc...
Posted by spmallette <gi...@git.apache.org>.
Github user spmallette commented on the pull request:
https://github.com/apache/incubator-tinkerpop/pull/237#issuecomment-188407259
@pluradj that was a nice body of feedback - thanks. i've cleaned up and added your suggestions. deploying a fresh SNAPSHOT now.
@okram there really isn't any documentation to "re-publish". i only made one change to our generated asciidoc which added a note about "archetypes" to the reference docs. the other asciidoc i have in this PR is just README's that get generated into a example project when the archetype is used.
I could see where a tutorial could be built around an archetype. In the more complex thoughts you had for "examples" I think that would be the way to do it. Write a tutorial in our standard pattern then build an archetype to support it.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-tinkerpop pull request: TINKERPOP-1085 Added gremlin-arc...
Posted by pluradj <gi...@git.apache.org>.
Github user pluradj commented on a diff in the pull request:
https://github.com/apache/incubator-tinkerpop/pull/237#discussion_r53965414
--- Diff: gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/pom.xml ---
@@ -0,0 +1,80 @@
+<!--
+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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>\${groupId}</groupId>
+ <artifactId>\${artifactId}</artifactId>
+ <version>\${version}</version>
+
+ <name>Getting started with Gremlin Server</name>
+
+ <packaging>jar</packaging>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tinkerpop</groupId>
+ <artifactId>gremlin-driver</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tinkerpop</groupId>
+ <artifactId>gremlin-server</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${slf4j.version}</version>
+ <scope>test</scope>
--- End diff --
suggest making a compile dependency and adding `log4j` also to avoid the `log4j:WARN No appenders could be found for logger`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-tinkerpop pull request: TINKERPOP-1085 Added gremlin-arc...
Posted by pluradj <gi...@git.apache.org>.
Github user pluradj commented on a diff in the pull request:
https://github.com/apache/incubator-tinkerpop/pull/237#discussion_r53962369
--- Diff: gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/README.asciidoc ---
@@ -0,0 +1,67 @@
+////
+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.
+////
+Gremlin Server Application
+==========================
+
+This is a starter project that demonstrates how a basic
+link:http://tinkerpop.apache.org/docs/${project.version}/reference/#gremlin-server[Gremlin Server] project is structured
+with Maven. This project demonstrates how to connect to Gremlin Server through Java using the
+link:http://tinkerpop.apache.org/docs/${project.version}/reference/#connecting-via-java[Gremlin Driver] that is
+distributed by TinkerPop.
+
+Prerequisites
+-------------
+
+* Java 8 Update 40+
+* link:https://maven.apache.org/[Maven 3.x]
+* Gremlin Server is link:http://archive.apache.org/dist/incubator/tinkerpop/[downloaded] and unpackaged
+
+Building and Running
+--------------------
+
+Start Gremlin Server in the directory it was unpackaged and specify usage of the "modern" graph configuration:
+
+[source,text]
+$ bin/gremlin-server.sh conf/gremlin-server-modern.yaml
+[INFO] GremlinServer -
+ \,,,/
+ (o o)
+-----oOOo-(3)-oOOo-----
+
+[INFO] GremlinServer - Configuring Gremlin Server from conf/gremlin-server-modern.yaml
+[INFO] MetricManager - Configured Metrics Slf4jReporter configured with interval=180000ms and loggerName=org.apache.tinkerpop.gremlin.server.Settings$Slf4jReporterMetrics
+[INFO] Graphs - Graph [graph] was successfully configured via [conf/tinkergraph-empty.properties].
+[INFO] ServerGremlinExecutor - Initialized Gremlin thread pool. Threads in pool named with pattern gremlin-*
+[INFO] ScriptEngines - Loaded gremlin-groovy ScriptEngine
+[INFO] GremlinExecutor - Initialized gremlin-groovy ScriptEngine with scripts/generate-modern.groovy
+[INFO] ServerGremlinExecutor - Initialized GremlinExecutor and configured ScriptEngines.
+[INFO] ServerGremlinExecutor - A GraphTraversalSource is now bound to [g] with graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]
+[INFO] OpLoader - Adding the standard OpProcessor.
+[INFO] OpLoader - Adding the control OpProcessor.
+[INFO] OpLoader - Adding the session OpProcessor.
+[INFO] GremlinServer - Executing start up LifeCycleHook
+[INFO] Logger$info - Loading 'modern' graph data.
+[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0
+[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0
+[INFO] GremlinServer$1 - Gremlin Server configured with worker thread pool of 1, gremlin pool of 8 and boss thread pool of 1.
+[INFO] GremlinServer$1 - Channel started at port 8182.
+
+Build and run this project as follows:
+
+[source,text]
+mvn clean package
--- End diff --
need to make sure that the Gremlin Server is not running, otherwise the unit test fails.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-tinkerpop pull request: TINKERPOP-1085 Added gremlin-arc...
Posted by pluradj <gi...@git.apache.org>.
Github user pluradj commented on a diff in the pull request:
https://github.com/apache/incubator-tinkerpop/pull/237#discussion_r53962273
--- Diff: gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/archetype-resources/README.asciidoc ---
@@ -0,0 +1,35 @@
+////
+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.
+////
+Simple TinkerPop Application
+============================
+
+This is a simple starter project that demonstrates how a basic TinkerPop project is structured with Maven. This project
+uses link:http://tinkerpop.apache.org/docs/${project.version}/reference/#tinkergraph-gremlin[TinkerGraph] as an
+embedded graph database, loads it with some data and then executes a shortest path calculation, printing the results.
+
+Prerequisites
+-------------
+
+* Java 8 Update 40+
+* link:https://maven.apache.org/[Maven 3.x]
+
+Building and Running
+--------------------
+
+[source,text]
+mvn clean package
--- End diff --
need to make sure that the Gremlin Server is not running, otherwise the unit test fails.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-tinkerpop pull request: TINKERPOP-1085 Added gremlin-arc...
Posted by pluradj <gi...@git.apache.org>.
Github user pluradj commented on a diff in the pull request:
https://github.com/apache/incubator-tinkerpop/pull/237#discussion_r53971453
--- Diff: gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/resources/gremlin-server.yaml ---
@@ -0,0 +1,45 @@
+# Licensed to the Apache Software Foundation (ASF) under one
--- End diff --
since `gremlin-server` is a `test` scope dependency, this should move over to `.../src/test/resources` in the generated project
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-tinkerpop pull request: TINKERPOP-1085 Added gremlin-arc...
Posted by pluradj <gi...@git.apache.org>.
Github user pluradj commented on a diff in the pull request:
https://github.com/apache/incubator-tinkerpop/pull/237#discussion_r53957947
--- Diff: CHANGELOG.asciidoc ---
@@ -26,6 +26,9 @@ image::https://raw.githubusercontent.com/apache/incubator-tinkerpop/master/docs/
TinkerPop 3.1.2 (NOT OFFICIALLY RELEASED YET)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* Added the `gremlin-archetype-driver` archetype that demonstrates
--- End diff --
no `gremlin-archetype-driver`. this line can be removed.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-tinkerpop pull request: TINKERPOP-1085 Added gremlin-arc...
Posted by okram <gi...@git.apache.org>.
Github user okram commented on the pull request:
https://github.com/apache/incubator-tinkerpop/pull/237#issuecomment-188286536
VOTE +1. When you merge can you publish fresh docs to 3.1.2-SNAPSHOT so I can get a better sense of the organization of things?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-tinkerpop pull request: TINKERPOP-1085 Added gremlin-arc...
Posted by pluradj <gi...@git.apache.org>.
Github user pluradj commented on a diff in the pull request:
https://github.com/apache/incubator-tinkerpop/pull/237#discussion_r53960519
--- Diff: docs/src/reference/gremlin-applications.asciidoc ---
@@ -1880,3 +1880,25 @@ The following shows the output for `HadoopGraph`:
----
describeGraph(HadoopGraph)
----
+
+[[gremlin-archetypes]]
+Gremlin Archetypes
+==================
+
+TinkerPop has a number of link:https://maven.apache.org/guides/introduction/introduction-to-archetypes.html[Maven archetypes],
+which provide example project templates to quickly get started with TinkerPop. The available archetypes are as follows:
+
+* `gremlin-archetype-server` - An example project that demonstrates the basic structure of a
+<<gremlin-server,Gremlin Server>> project, how to connect with the Gremlin Driver, and how to embed Gremlin Server in
+a testing framework.
+* `gremlin-archetype-tinkergraph` - A basic example of how to structure a TinkerPop project with Maven.
+
+You can use Maven to generate these example projects with a command like:
+
+[source,shell]
+$ mvn archetype:generate -DarchetypeGroupId=org.apache.tinkerpop -DarchetypeArtifactId=gremlin-archetype-server
+ -DarchetypeVersion=3.1.2-incubating -DgroupId=com.my -DartifactId=app
--- End diff --
Suggest adding `-Dversion=0.1 -DinteractiveMode=false`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-tinkerpop pull request: TINKERPOP-1085 Added gremlin-arc...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/incubator-tinkerpop/pull/237
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-tinkerpop pull request: TINKERPOP-1085 Added gremlin-arc...
Posted by pluradj <gi...@git.apache.org>.
Github user pluradj commented on a diff in the pull request:
https://github.com/apache/incubator-tinkerpop/pull/237#discussion_r53965692
--- Diff: gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/README.asciidoc ---
@@ -0,0 +1,67 @@
+////
+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.
+////
+Gremlin Server Application
+==========================
+
+This is a starter project that demonstrates how a basic
+link:http://tinkerpop.apache.org/docs/${project.version}/reference/#gremlin-server[Gremlin Server] project is structured
+with Maven. This project demonstrates how to connect to Gremlin Server through Java using the
+link:http://tinkerpop.apache.org/docs/${project.version}/reference/#connecting-via-java[Gremlin Driver] that is
+distributed by TinkerPop.
+
+Prerequisites
+-------------
+
+* Java 8 Update 40+
+* link:https://maven.apache.org/[Maven 3.x]
+* Gremlin Server is link:http://archive.apache.org/dist/incubator/tinkerpop/[downloaded] and unpackaged
+
+Building and Running
+--------------------
+
+Start Gremlin Server in the directory it was unpackaged and specify usage of the "modern" graph configuration:
+
+[source,text]
+$ bin/gremlin-server.sh conf/gremlin-server-modern.yaml
+[INFO] GremlinServer -
+ \,,,/
+ (o o)
+-----oOOo-(3)-oOOo-----
+
+[INFO] GremlinServer - Configuring Gremlin Server from conf/gremlin-server-modern.yaml
+[INFO] MetricManager - Configured Metrics Slf4jReporter configured with interval=180000ms and loggerName=org.apache.tinkerpop.gremlin.server.Settings$Slf4jReporterMetrics
+[INFO] Graphs - Graph [graph] was successfully configured via [conf/tinkergraph-empty.properties].
+[INFO] ServerGremlinExecutor - Initialized Gremlin thread pool. Threads in pool named with pattern gremlin-*
+[INFO] ScriptEngines - Loaded gremlin-groovy ScriptEngine
+[INFO] GremlinExecutor - Initialized gremlin-groovy ScriptEngine with scripts/generate-modern.groovy
+[INFO] ServerGremlinExecutor - Initialized GremlinExecutor and configured ScriptEngines.
+[INFO] ServerGremlinExecutor - A GraphTraversalSource is now bound to [g] with graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]
+[INFO] OpLoader - Adding the standard OpProcessor.
+[INFO] OpLoader - Adding the control OpProcessor.
+[INFO] OpLoader - Adding the session OpProcessor.
+[INFO] GremlinServer - Executing start up LifeCycleHook
+[INFO] Logger$info - Loading 'modern' graph data.
+[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0
+[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0
+[INFO] GremlinServer$1 - Gremlin Server configured with worker thread pool of 1, gremlin pool of 8 and boss thread pool of 1.
+[INFO] GremlinServer$1 - Channel started at port 8182.
+
+Build and run this project as follows:
+
+[source,text]
+mvn clean package
+mvn exec:java -Dexec.mainClass="${package}.App"
--- End diff --
if you add the `log4j` dependency, also include `-Dlog4j.configuration=file:conf/log4j.properties`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---