tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject [10/50] incubator-tinkerpop git commit: Made some adjustments based on pull request feedback.
Date Tue, 08 Mar 2016 19:37:13 GMT
Made some adjustments based on pull request feedback.

Fixed changelog to use the right name of the archetype. Better logging control/output for
the server archetype. Documentation improvements. Included log4j as a compile time dependency.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/68b16eb9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/68b16eb9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/68b16eb9

Branch: refs/heads/TINKERPOP-1096
Commit: 68b16eb90570c4ed4cd36ab9b93e650bddc568ae
Parents: bb3bf09
Author: Stephen Mallette <spmva@genoprime.com>
Authored: Wed Feb 24 13:54:30 2016 -0500
Committer: Stephen Mallette <spmva@genoprime.com>
Committed: Wed Feb 24 13:54:30 2016 -0500

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  2 +-
 .../src/reference/gremlin-applications.asciidoc |  2 +-
 .../META-INF/maven/archetype-metadata.xml       |  4 +-
 .../archetype-resources/README.asciidoc         | 10 +++--
 .../conf/log4j-test.properties                  | 21 +++++++++
 .../archetype-resources/conf/log4j.properties   |  2 +-
 .../main/resources/archetype-resources/pom.xml  | 13 +++---
 .../archetype-resources/src/main/java/App.java  | 11 ++++-
 .../src/main/resources/gremlin-server.yaml      | 45 --------------------
 .../src/test/resources/gremlin-server.yaml      | 45 ++++++++++++++++++++
 10 files changed, 93 insertions(+), 62 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/68b16eb9/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 67965cf..910d9b6 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,7 +26,7 @@ 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
+* Added the `gremlin-archetype-server` archetype that demonstrates
 * Added the `gremlin-archetype-tinkergraph` archetype that demonstrates a basic project that
uses TinkerGraph.
 * Added `gremlin-archetype` module to house TinkerPop "examples".
 * Fixed a bug where multiple "close" requests were being sent by the driver on `Client.close()`.

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/68b16eb9/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index 02bf1f0..06fe0cc 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -1897,7 +1897,7 @@ 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
+      -DarchetypeVersion=x.y.z -DgroupId=com.my -DartifactId=app -Dversion=0.1 -DinteractiveMode=false
 
 This command will generate a new Maven project in a directory called "app" with a `pom.xml`
specifying a `groupId` of
 `com.my`. Please see the `README.asciidoc` in the root of each generated project for information
on how to build and

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/68b16eb9/gremlin-archetype/gremlin-archetype-server/src/main/resources/META-INF/maven/archetype-metadata.xml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/META-INF/maven/archetype-metadata.xml
b/gremlin-archetype/gremlin-archetype-server/src/main/resources/META-INF/maven/archetype-metadata.xml
index a6c9d46..93d66a8 100644
--- a/gremlin-archetype/gremlin-archetype-server/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/gremlin-archetype/gremlin-archetype-server/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -37,10 +37,10 @@ limitations under the License.
             <directory>src/main/java</directory>
         </fileSet>
         <fileSet filtered="true" packaged="true">
-            <directory>src/main/resources</directory>
+            <directory>src/test/java</directory>
         </fileSet>
         <fileSet filtered="true" packaged="true">
-            <directory>src/test/java</directory>
+            <directory>src/test/resources</directory>
         </fileSet>
     </fileSets>
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/68b16eb9/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/README.asciidoc
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/README.asciidoc
b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/README.asciidoc
index 42f369d..fd543bc 100644
--- a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/README.asciidoc
+++ b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/README.asciidoc
@@ -33,6 +33,11 @@ Prerequisites
 Building and Running
 --------------------
 
+Build the project as follows:
+
+[source,text]
+mvn clean package
+
 Start Gremlin Server in the directory it was unpackaged and specify usage of the "modern"
graph configuration:
 
 [source,text]
@@ -60,8 +65,7 @@ $ bin/gremlin-server.sh  conf/gremlin-server-modern.yaml
 [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:
+Run this project as follows:
 
 [source,text]
-mvn clean package
-mvn exec:java -Dexec.mainClass="${package}.App"
\ No newline at end of file
+mvn exec:java -Dexec.mainClass="${package}.App" -Dlog4j.configuration=file:conf/log4j.properties
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/68b16eb9/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/conf/log4j-test.properties
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/conf/log4j-test.properties
b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/conf/log4j-test.properties
new file mode 100644
index 0000000..ef436fe
--- /dev/null
+++ b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/conf/log4j-test.properties
@@ -0,0 +1,21 @@
+# 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.
+
+log4j.rootLogger=WARN, stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=[%p] %C - %m%n
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/68b16eb9/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/conf/log4j.properties
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/conf/log4j.properties
b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/conf/log4j.properties
index ef436fe..2b58359 100644
--- a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/conf/log4j.properties
+++ b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/conf/log4j.properties
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-log4j.rootLogger=WARN, stdout
+log4j.rootLogger=INFO, stdout
 log4j.appender.stdout=org.apache.log4j.ConsoleAppender
 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
 log4j.appender.stdout.layout.ConversionPattern=[%p] %C - %m%n
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/68b16eb9/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/pom.xml
b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/pom.xml
index 5c47aea..ca29604 100644
--- a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/pom.xml
+++ b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/pom.xml
@@ -35,15 +35,14 @@ limitations under the License.
             <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>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tinkerpop</groupId>
+            <artifactId>gremlin-server</artifactId>
+            <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
@@ -71,7 +70,7 @@ limitations under the License.
                 <version>2.17</version>
                 <configuration>
                     <systemPropertyVariables>
-                        <log4j.configuration>file:conf/log4j.properties</log4j.configuration>
+                        <log4j.configuration>file:conf/log4j-test.properties</log4j.configuration>
                     </systemPropertyVariables>
                 </configuration>
             </plugin>

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/68b16eb9/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/App.java
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/App.java
b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/App.java
index d1761c7..1e111e3 100644
--- a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/App.java
+++ b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/App.java
@@ -19,17 +19,24 @@
 package ${package};
 
 import org.apache.tinkerpop.gremlin.driver.Result;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class App {
+    private static final Logger logger = LoggerFactory.getLogger(App.class);
 
     public static void main(String[] args) throws Exception {
         Service service = Service.getInstance();
         try {
-            service.findCreatorsOfSoftware("lop").iterator().forEachRemaining(r -> System.out.println(r));
+            logger.info("Sending request....");
+
+            // should print marko, josh and peter to the logs
+            service.findCreatorsOfSoftware("lop").iterator().forEachRemaining(r -> logger.info(String.format("
 - %s", r)));
         } catch (Exception ex) {
-            ex.printStackTrace();
+            logger.error("Could not execute traversal", ex);
         } finally {
             service.close();
+            logger.info("Service closed and resources released");
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/68b16eb9/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/resources/gremlin-server.yaml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/resources/gremlin-server.yaml
b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/resources/gremlin-server.yaml
deleted file mode 100644
index 5744d29..0000000
--- a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/resources/gremlin-server.yaml
+++ /dev/null
@@ -1,45 +0,0 @@
-# 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.
-
-host: localhost
-port: 8182
-threadPoolWorker: 1
-gremlinPool: 8
-scriptEvaluationTimeout: 30000
-serializedResponseTimeout: 30000
-graphs: {
-  graph: conf/tinkergraph-empty.properties}
-plugins:
-  - tinkerpop.tinkergraph
-scriptEngines: {
-  gremlin-groovy: {
-    imports: [java.lang.Math],
-    staticImports: [java.lang.Math.PI],
-    scripts: [scripts/generate-modern.groovy]}}
-serializers:
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config:
{ useMapperFromGraph: graph }}       # application/vnd.gremlin-v1.0+gryo
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config:
{ serializeResultToString: true }}   # application/vnd.gremlin-v1.0+gryo-stringd
-metrics: {
-  slf4jReporter: {enabled: true, interval: 180000}}
-strictTransactionManagement: false
-threadPoolBoss: 1
-maxInitialLineLength: 4096
-maxHeaderSize: 8192
-maxChunkSize: 8192
-maxContentLength: 65536
-maxAccumulationBufferComponents: 1024
-resultIterationBatchSize: 64

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/68b16eb9/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml
b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml
new file mode 100644
index 0000000..5744d29
--- /dev/null
+++ b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml
@@ -0,0 +1,45 @@
+# 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.
+
+host: localhost
+port: 8182
+threadPoolWorker: 1
+gremlinPool: 8
+scriptEvaluationTimeout: 30000
+serializedResponseTimeout: 30000
+graphs: {
+  graph: conf/tinkergraph-empty.properties}
+plugins:
+  - tinkerpop.tinkergraph
+scriptEngines: {
+  gremlin-groovy: {
+    imports: [java.lang.Math],
+    staticImports: [java.lang.Math.PI],
+    scripts: [scripts/generate-modern.groovy]}}
+serializers:
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config:
{ useMapperFromGraph: graph }}       # application/vnd.gremlin-v1.0+gryo
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config:
{ serializeResultToString: true }}   # application/vnd.gremlin-v1.0+gryo-stringd
+metrics: {
+  slf4jReporter: {enabled: true, interval: 180000}}
+strictTransactionManagement: false
+threadPoolBoss: 1
+maxInitialLineLength: 4096
+maxHeaderSize: 8192
+maxChunkSize: 8192
+maxContentLength: 65536
+maxAccumulationBufferComponents: 1024
+resultIterationBatchSize: 64


Mime
View raw message