You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by dk...@apache.org on 2015/06/05 22:17:54 UTC

[01/26] incubator-tinkerpop git commit: reimplemented AsciiDocs preprocessor (now we can use plugins in sample code snippets)

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/master 6796130a0 -> 821a0ed1e


reimplemented AsciiDocs preprocessor (now we can use plugins in sample code snippets)


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

Branch: refs/heads/master
Commit: f3c056f58fe13eae7b862272d9ff0d5072f549ad
Parents: 5760f16
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Fri May 29 03:27:30 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Fri May 29 03:27:30 2015 +0200

----------------------------------------------------------------------
 docs/preprocessor/preprocess.sh    | 40 ++++++++++++++++++++++---
 docs/preprocessor/processor.groovy | 52 +++++++++++++++++++++++----------
 2 files changed, 73 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f3c056f5/docs/preprocessor/preprocess.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/preprocess.sh b/docs/preprocessor/preprocess.sh
index 78c0f32..506f177 100755
--- a/docs/preprocessor/preprocess.sh
+++ b/docs/preprocessor/preprocess.sh
@@ -34,9 +34,27 @@ mkdir target/postprocess-asciidoc/tmp
 cp -R docs/{static,stylesheets} target/postprocess-asciidoc/
 
 TP_HOME=`pwd`
+CONSOLE_HOME=`readlink -f ${TP_HOME}/gremlin-console/target/apache-gremlin-console-*-standalone`
+TP_VERSION=$(cat pom.xml | grep -A1 '<artifactId>tinkerpop</artifactId>' | grep -Po '(?<=<version>).*(?=</version>)')
 
-cd target/postprocess-asciidoc/tmp
-ln -s ../../../data data
+# install Hadoop plugin
+hadoopPlugin=$(find . -name "HadoopGremlinPlugin.java")
+hadoopPluginName=`echo $hadoopPlugin | cut -d '/' -f2`
+hadoopPluginClass=`echo $hadoopPlugin | grep -Po '(?<=src/main/java/).*(?=\.java)' | tr '/' '.'`
+match=`grep -c "$hadoopPluginClass" ${CONSOLE_HOME}/ext/plugins.txt`
+if [ ! -z "${hadoopPluginName}" -a ! -d "${CONSOLE_HOME}/ext/${hadoopPluginName}" -a $match -eq 0 ]; then
+  rmHadoopPlugin=1
+  echo -e "\n${hadoopPluginClass}" >> "${CONSOLE_HOME}/ext/plugins.txt"
+  mkdir -p "${CONSOLE_HOME}/ext/${hadoopPluginName}/"{lib,plugin}
+  cp ${hadoopPluginName}/target/*${TP_VERSION}.jar "${CONSOLE_HOME}/ext/${hadoopPluginName}/lib"
+  cp ${hadoopPluginName}/target/*${TP_VERSION}.jar "${CONSOLE_HOME}/ext/${hadoopPluginName}/plugin"
+  libdir=`readlink -f ${hadoopPluginName}/target/*-standalone/lib/`
+  if [ -d "${libdir}" ]; then
+    cp ${libdir}/*.jar "${CONSOLE_HOME}/ext/${hadoopPluginName}/lib"
+    cp ${libdir}/*.jar "${CONSOLE_HOME}/ext/${hadoopPluginName}/plugin"
+  fi
+  rm -f "${CONSOLE_HOME}/ext/hadoop-gremlin"/*/slf4j-*.jar
+fi
 
 for input in $(find "${TP_HOME}/docs/src/" -name "*.asciidoc")
 do
@@ -44,8 +62,16 @@ do
   output="${TP_HOME}/target/postprocess-asciidoc/${name}"
   echo "${input} > ${output}"
   if [ $(grep -c '^\[gremlin' $input) -gt 0 ]; then
-    ${TP_HOME}/bin/gremlin.sh -e ${TP_HOME}/docs/preprocessor/processor.groovy $input > $output
-    ec=$?
+    pushd "${CONSOLE_HOME}" > /dev/null
+    bin/gremlin.sh -e ${TP_HOME}/docs/preprocessor/processor.groovy $input > $input.groovy
+    ec=${PIPESTATUS[0]}
+    if [ $ec -eq 0 ]; then
+      HADOOP_GREMLIN_LIBS=`pwd`/ext/hadoop-gremlin/lib bin/gremlin.sh $input.groovy | awk 'BEGIN {b=1} /\1IGNORE/ {b=!b} !/\1IGNORE/ {if(a&&b)print} /\1START/ {a=1}' | grep -v '^WARN ' | sed 's/^==>\x01//' > $output
+      ec=${PIPESTATUS[0]}
+      rm -f $input.groovy
+      popd > /dev/null
+    fi
+    rm -f $input.groovy
     if [ $ec -ne 0 ]; then
       popd > /dev/null
       exit $ec
@@ -55,4 +81,10 @@ do
   fi
 done
 
+if [ "{$rmHadoopPlugin}" == "1" ]; then
+  rm -rf "${CONSOLE_HOME}/ext/${hadoopPluginName}"
+  sed -e "/${hadoopClassName}/d" "${CONSOLE_HOME}/ext/plugins.txt" > "${CONSOLE_HOME}/ext/plugins.txt."
+  mv "${CONSOLE_HOME}/ext/plugins.txt." "${CONSOLE_HOME}/ext/plugins.txt"
+fi
+
 popd > /dev/null

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f3c056f5/docs/preprocessor/processor.groovy
----------------------------------------------------------------------
diff --git a/docs/preprocessor/processor.groovy b/docs/preprocessor/processor.groovy
index cff8fb9..a33c42a 100644
--- a/docs/preprocessor/processor.groovy
+++ b/docs/preprocessor/processor.groovy
@@ -40,15 +40,23 @@ def inCodeSection = false
 def engine
 def lineNumber = 0;
 def line = "";
+def plugins = []
 
 sanitize = { def codeLine ->
     codeLine.replaceAll(/\s*(\<\d+\>\s*)*\<\d+\>\s*$/, "").replaceAll(/\s*\/\/.*$/, "").trim()
 }
 
 format = { def codeLine ->
-    codeLine.replaceAll(/\s*((\s\<\d+\>\s*)*\s\<\d+\>)\s*$/, '   ////$1')
+    codeLine.replaceAll(/\s*((\s\<\d+\>\s*)*\s\<\d+\>)\s*$/, '   ////$1').replaceAll(/(\.\.\/){3}[^\/]+\//, "")
 }
 
+stringify = { def string ->
+    "\"\1" + string.replaceAll("\\\\", "\\\\\\\\").replaceAll(/"/, "\\\\\"").replaceAll(/\$/, "\\\\\\\$") + "\""
+}
+
+//println "try {"
+println stringify("START")
+
 new File(this.args[0]).withReader { reader ->
     try {
         while (skipNextRead || (line = reader.readLine()) != null) {
@@ -57,12 +65,13 @@ new File(this.args[0]).withReader { reader ->
             if (inCodeSection) {
                 inCodeSection = !line.equals(BLOCK_DELIMITER)
                 if (inCodeSection) {
-                    def script = new StringBuilder(header.toString())
+                    /*def script = new StringBuilder(header.toString())
                     imports.getCombinedImports().each { script.append("import ${it}\n") }
-                    imports.getCombinedStaticImports().each { script.append("import static ${it}\n") }
+                    imports.getCombinedStaticImports().each { script.append("import static ${it}\n") }*/
+                    def script = new StringBuilder()
                     def sanitizedLine = sanitize(line)
                     script.append(sanitizedLine)
-                    println STATEMENT_PREFIX + format(line)
+                    println stringify(STATEMENT_PREFIX + format(line))
                     if (!sanitizedLine.isEmpty() && sanitizedLine[-1] in STATEMENT_CONTINUATION_CHARACTERS) {
                         while (true) {
                             line = reader.readLine()
@@ -72,7 +81,7 @@ new File(this.args[0]).withReader { reader ->
                             }
                             sanitizedLine = sanitize(line)
                             script.append(sanitizedLine)
-                            println STATEMENT_CONTINUATION_PREFIX + format(line)
+                            println stringify(STATEMENT_CONTINUATION_PREFIX + format(line))
                         }
                     }
                     if (line.startsWith("import ")) {
@@ -82,8 +91,9 @@ new File(this.args[0]).withReader { reader ->
                             skipNextRead = false
                             inCodeSection = false
                         }
-                        def res = engine.eval(script.toString())
-
+                        //def res = engine.eval(script.toString())
+                        println script.toString()
+/*
                         if (res instanceof Map) {
                             res = res.entrySet()
                         }
@@ -98,9 +108,12 @@ new File(this.args[0]).withReader { reader ->
                         } else if (!line.isEmpty() && !line.startsWith("//")) {
                             println RESULT_PREFIX + (res ?: "null")
                         }
+*/
                     }
                 }
-                if (!inCodeSection) println BLOCK_DELIMITER
+                if (!inCodeSection) {
+                    println stringify(BLOCK_DELIMITER)
+                }
             } else {
                 if (line.startsWith("[gremlin-")) {
                     def parts = line.split(/,/, 2)
@@ -108,15 +121,20 @@ new File(this.args[0]).withReader { reader ->
                     def lang = parts[0].split(/-/, 2)[1].replaceAll(/\s*\]\s*$/, "")
                     def graph = graphString.isEmpty() ? TinkerGraph.open() : TinkerFactory."create${graphString}"()
                     def g = graph.traversal(standard())
-                    engine = ScriptEngineCache.get(lang)
-                    engine.put("graph", graph)
-                    engine.put("g", g)
-                    engine.put("marko", g.V().has("name", "marko").tryNext().orElse(null))
+                    println stringify("IGNORE")
+                    if (graphString.isEmpty()) {
+                        println "graph = TinkerGraph.open()"
+                    } else {
+                        println "graph = TinkerFactory.create${graphString}()"
+                    }
+                    println "g = graph.traversal(standard())"
+                    println "marko = g.V().has(\"name\", \"marko\").tryNext().orElse(null)"
+                    println stringify("IGNORE")
                     reader.readLine()
                     inCodeSection = true
-                    println "[source,${lang}]"
-                    println BLOCK_DELIMITER
-                } else println line
+                    println stringify("[source,${lang}]")
+                    println stringify(BLOCK_DELIMITER)
+                } else println stringify(line)
             }
         }
     } catch (final Throwable e) {
@@ -130,3 +148,7 @@ new File(this.args[0]).withReader { reader ->
     }
 }
 
+println "System.exit(0)"
+//println "} catch (Exception e) {"
+//println "  System.exit(1)"
+//println "}"


[13/26] incubator-tinkerpop git commit: a lot of work for the AsciiDocs preprocessor

Posted by dk...@apache.org.
a lot of work for the AsciiDocs preprocessor


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

Branch: refs/heads/master
Commit: 1a6015818cdd118e7d2ac29da57bac15de87e755
Parents: 774100e
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Wed Jun 3 01:51:19 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Wed Jun 3 01:51:19 2015 +0200

----------------------------------------------------------------------
 bin/process-docs.sh                      |  6 +--
 docs/preprocessor/install-plugins.groovy | 41 +++++++++++++++
 docs/preprocessor/install-plugins.sh     | 68 +++++++++++++++++++++++++
 docs/preprocessor/preprocess-file.sh     | 15 ++++--
 docs/preprocessor/preprocess.sh          | 64 ++++++++++++------------
 docs/preprocessor/processor.groovy       | 72 ++++++++++++---------------
 docs/preprocessor/uninstall-plugins.sh   | 36 ++++++++++++++
 7 files changed, 221 insertions(+), 81 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1a601581/bin/process-docs.sh
----------------------------------------------------------------------
diff --git a/bin/process-docs.sh b/bin/process-docs.sh
index 2876328..1a62ca2 100755
--- a/bin/process-docs.sh
+++ b/bin/process-docs.sh
@@ -19,9 +19,5 @@
 #
 
 pushd "$(dirname $0)/.." > /dev/null
-
-docs/preprocessor/preprocess.sh
-mvn process-resources -Dasciidoc
-docs/postprocessor/postprocess.sh
-
+docs/preprocessor/preprocess.sh && mvn process-resources -Dasciidoc && docs/postprocessor/postprocess.sh
 popd > /dev/null

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1a601581/docs/preprocessor/install-plugins.groovy
----------------------------------------------------------------------
diff --git a/docs/preprocessor/install-plugins.groovy b/docs/preprocessor/install-plugins.groovy
new file mode 100644
index 0000000..cc5b232
--- /dev/null
+++ b/docs/preprocessor/install-plugins.groovy
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+
+/**
+ * @author Daniel Kuppitz (http://gremlin.guru)
+ */
+import org.apache.tinkerpop.gremlin.groovy.plugin.Artifact
+import org.apache.tinkerpop.gremlin.groovy.util.DependencyGrabber
+
+installPlugin = { def artifact ->
+  def classLoader = new groovy.lang.GroovyClassLoader()
+  def extensionPath = System.getProperty("user.dir") + System.getProperty("file.separator") + "ext"
+  try {
+    System.err.print(" * ${artifact.getArtifact()} ... ")
+    new DependencyGrabber(classLoader, extensionPath).copyDependenciesToPath(artifact)
+    System.err.println("done")
+  } catch (Exception e) {
+    System.err.println("failed")
+    System.err.println()
+    System.err.println(e.getMessage())
+    e.printStackTrace()
+    System.exit(1)
+  }
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1a601581/docs/preprocessor/install-plugins.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/install-plugins.sh b/docs/preprocessor/install-plugins.sh
new file mode 100755
index 0000000..a9a6497
--- /dev/null
+++ b/docs/preprocessor/install-plugins.sh
@@ -0,0 +1,68 @@
+#!/bin/bash
+#
+#
+# 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.
+#
+
+CONSOLE_HOME=$1
+TP_VERSION=$2
+TMP_DIR=$3
+INSTALL_TEMPLATE="docs/preprocessor/install-plugins.groovy"
+INSTALL_FILE="${TMP_DIR}/install-plugins.groovy"
+
+plugins=("hadoop-gremlin" "neo4j-gremlin")
+pluginsCount=${#plugins[@]}
+
+i=0
+
+cp ${INSTALL_TEMPLATE} ${INSTALL_FILE}
+
+while [ ${i} -lt ${pluginsCount} ]; do
+  pluginName=${plugins[$i]}
+  className=""
+  for part in $(tr '-' '\n' <<< ${pluginName}); do
+    className="${className}$(tr '[:lower:]' '[:upper:]' <<< ${part:0:1})${part:1}"
+  done
+  pluginClassFile=$(find . -name "${className}Plugin.java")
+  pluginClass=`sed -e 's@.*src/main/java/@@' -e 's/\.java$//' <<< ${pluginClassFile} | tr '/' '.'`
+  installed=`grep -c "${pluginClass}" ${CONSOLE_HOME}/ext/plugins.txt`
+  if [ ${installed} -eq 0 ]; then
+    echo "installPlugin(new Artifact(\"org.apache.tinkerpop\", \"${pluginName}\", \"${TP_VERSION}\"))" >> ${INSTALL_FILE}
+    echo "${pluginName}" >> ${TMP_DIR}/plugins.dir
+    echo "${pluginClass}" >> ${TMP_DIR}/plugins.txt
+  else
+    echo " * skipping ${pluginName} (already installed)"
+  fi
+  ((i++))
+done
+
+echo "System.exit(0)" >> ${INSTALL_FILE}
+
+pushd ${CONSOLE_HOME} > /dev/null
+bin/gremlin.sh ${INSTALL_FILE} > /dev/null
+
+if [ ${PIPESTATUS[0]} -ne 0 ]; then
+  popd > /dev/null
+  exit 1
+fi
+
+if [ -f "${TMP_DIR}/plugins.txt" ]; then
+  cat ${TMP_DIR}/plugins.txt >> ${CONSOLE_HOME}/ext/plugins.txt
+fi
+
+popd > /dev/null

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1a601581/docs/preprocessor/preprocess-file.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/preprocess-file.sh b/docs/preprocessor/preprocess-file.sh
index 0bb621d..2bd66d3 100755
--- a/docs/preprocessor/preprocess-file.sh
+++ b/docs/preprocessor/preprocess-file.sh
@@ -26,20 +26,27 @@ input=$2
 name=`basename ${input}`
 output="${TP_HOME}/target/postprocess-asciidoc/${name}"
 
-echo "${input} > ${output}"
+echo
+echo " * source:   ${input}"
+echo "   target:   ${output}"
+echo -ne "   progress: initializing"
 
 if [ $(grep -c '^\[gremlin' ${input}) -gt 0 ]; then
   pushd "${CONSOLE_HOME}" > /dev/null
-  bin/gremlin.sh -e ${TP_HOME}/docs/preprocessor/processor.groovy ${input} > ${input}.groovy
+  bin/gremlin.sh -e ${TP_HOME}/docs/preprocessor/processor.groovy ${input} > ${input}.part2.groovy
+  cat ${input}.part2.groovy | grep -o '^pb([0-9][0-9]*' | tail -n1 | grep -o '[0-9]*' | xargs echo "TOTAL_LINES =" > ${input}.part1.groovy
+  cat ${input}.part?.groovy > ${input}.groovy && rm -f ${input}.part?.groovy
   ec=${PIPESTATUS[0]}
   if [ ${ec} -eq 0 ]; then
     HADOOP_GREMLIN_LIBS="${CONSOLE_HOME}/ext/hadoop-gremlin/lib" bin/gremlin.sh ${input}.groovy | awk 'BEGIN {b=1} /¶IGNORE/ {b=!b} !/¶IGNORE/ {if(a&&b)print} /¶START/ {a=1}' | grep -v '^WARN ' | sed 's/^==>¶//' > ${output}
     ec=${PIPESTATUS[0]}
-    rm -f ${input}.groovy
   fi
   rm -f ${input}.groovy
   popd > /dev/null
-  exit ${ec}
+  if [ ${ec} -ne 0 ]; then
+    exit 255
+  fi
 else
   cp ${input} ${output}
+  echo -ne "\r   progress: [====================================================================================================] 100%\n"
 fi

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1a601581/docs/preprocessor/preprocess.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/preprocess.sh b/docs/preprocessor/preprocess.sh
index 66f3367..18427a1 100755
--- a/docs/preprocessor/preprocess.sh
+++ b/docs/preprocessor/preprocess.sh
@@ -44,49 +44,47 @@ TP_HOME=`pwd`
 CONSOLE_HOME=`directory "${TP_HOME}/gremlin-console/target/apache-gremlin-console-*-standalone"`
 PLUGIN_DIR="${CONSOLE_HOME}/ext"
 TP_VERSION=$(cat pom.xml | grep -A1 '<artifactId>tinkerpop</artifactId>' | grep -o 'version>[^<]*' | grep -o '>.*' | grep -o '[^>]*')
-
-# install Hadoop plugin
-hadoopPlugin=$(find . -name "HadoopGremlinPlugin.java")
-hadoopPluginName=`echo ${hadoopPlugin} | cut -d '/' -f2`
-hadoopPluginClass=`echo ${hadoopPlugin} | sed -e 's@.*src/main/java/@@' -e 's/\.java$//' | tr '/' '.'`
-hadoopPluginDirectory="${PLUGIN_DIR}/${hadoopPluginName}"
-match=`grep -c "$hadoopPluginClass" ${PLUGIN_DIR}/plugins.txt`
+TMP_DIR="/tmp/tp-docs-preprocessor"
 
 trap cleanup INT
 
 function cleanup() {
-  # remove Hadoop plugin if it wasn't installed prior pre-processing
-  if [ "${rmHadoopPlugin}" == "1" ]; then
-    rm -rf "${PLUGIN_DIR}/${hadoopPluginName}"
-    sed -e "/${hadoopPluginClass}/d" "${PLUGIN_DIR}/plugins.txt" > "${PLUGIN_DIR}/plugins.txt."
-    mv "${PLUGIN_DIR}/plugins.txt." "${PLUGIN_DIR}/plugins.txt"
-  fi
+  echo -ne "\r\n\n"
+  docs/preprocessor/uninstall-plugins.sh "${CONSOLE_HOME}" "${TMP_DIR}"
   find "${TP_HOME}/docs/src/" -name "*.asciidoc.groovy" | xargs rm -f
+  rm -rf ${TMP_DIR}
 }
 
-if [ ! -z "${hadoopPluginName}" ] && [ ! -d "${hadoopPluginDirectory}" ] && [ ${match} -eq 0 ]; then
-  rmHadoopPlugin=1
-  echo -e "\n${hadoopPluginClass}" >> "${PLUGIN_DIR}/plugins.txt"
-  mkdir -p "${PLUGIN_DIR}/${hadoopPluginName}/"{lib,plugin}
-  cp ${hadoopPluginName}/target/*${TP_VERSION}.jar "${PLUGIN_DIR}/${hadoopPluginName}/plugin"
-  libdir=`directory "${hadoopPluginName}/target/*-standalone/lib/"`
-  if [ -d "${libdir}" ]; then
-    cp ${libdir}/*.jar "${PLUGIN_DIR}/${hadoopPluginName}/plugin"
-  fi
-  cp */target/*${TP_VERSION}.jar "${PLUGIN_DIR}/${hadoopPluginName}/lib"
-  for libdir in $(find . -name lib | grep -v ext); do
-    cp ${libdir}/*.jar "${PLUGIN_DIR}/${hadoopPluginName}/lib"
-  done
-  rm -f "${PLUGIN_DIR}/hadoop-gremlin"/plugin/slf4j-*.jar
-  echo "System.exit(0)" > "${PLUGIN_DIR}/${hadoopPluginName}/init.groovy"
-  ${CONSOLE_HOME}/bin/gremlin.sh "${PLUGIN_DIR}/${hadoopPluginName}/init.groovy" > /dev/null 2> /dev/null
-fi
+mkdir -p ${TMP_DIR}
 
-# copy Gremlin-Hadoop configuration files
-cp ${TP_HOME}/hadoop-gremlin/conf/* "${CONSOLE_HOME}/conf/"
+# install plugins
+echo
+echo "=========================="
+echo "+   Installing Plugins   +"
+echo "=========================="
+echo
+docs/preprocessor/install-plugins.sh "${CONSOLE_HOME}" "${TP_VERSION}" "${TMP_DIR}"
+
+if [ ${PIPESTATUS[0]} -ne 0 ]; then
+  cleanup
+  exit 1
+else
+  echo
+fi
 
 # process *.asciidoc files
-find "${TP_HOME}/docs/src/" -name "*.asciidoc" | xargs -n1 -P4 "${TP_HOME}/docs/preprocessor/preprocess-file.sh" "${CONSOLE_HOME}"
+echo
+echo "============================"
+echo "+   Processing AsciiDocs   +"
+echo "============================"
+find "${TP_HOME}/docs/src/" -name "*.asciidoc" | xargs -n1 ${TP_HOME}/docs/preprocessor/preprocess-file.sh "${CONSOLE_HOME}"
+
+if [ ${PIPESTATUS[1]} -ne 0 ]; then
+  cleanup
+  exit 1
+else
+  echo
+fi
 
 cleanup
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1a601581/docs/preprocessor/processor.groovy
----------------------------------------------------------------------
diff --git a/docs/preprocessor/processor.groovy b/docs/preprocessor/processor.groovy
index d4831d6..3c3b3b6 100644
--- a/docs/preprocessor/processor.groovy
+++ b/docs/preprocessor/processor.groovy
@@ -38,9 +38,8 @@ def imports = new org.apache.tinkerpop.gremlin.console.ConsoleImportCustomizerPr
 def skipNextRead = false
 def inCodeSection = false
 def engine
-def lineNumber = 0;
-def line = "";
-def plugins = []
+def lineNumber = 0
+def line = ""
 
 sanitize = { def codeLine ->
     codeLine.replaceAll(/\s*(\<\d+\>\s*)*\<\d+\>\s*$/, "").replaceAll(/\s*\/\/.*$/, "").trim()
@@ -50,11 +49,27 @@ format = { def codeLine ->
     codeLine.replaceAll(/\s*((\s\<\d+\>\s*)*\s\<\d+\>)\s*$/, '   ////$1').replaceAll(/(\.\.\/){3}[^\/]+\//, "")
 }
 
-stringify = { def string ->
-    "\"¶" + string.replaceAll("\\\\", "\\\\\\\\").replaceAll(/"/, "\\\\\"").replaceAll(/\$/, "\\\\\\\$") + "\""
+stringify = { def string, def lineNum = -1 ->
+    //def result = lineNum >= 0 ? "pb(${System.env['PREPROCESSOR_TOTAL_LINES']}, ${lineNum});" : ""
+    def result = lineNum >= 0 ? "pb(${lineNum});" : ""
+    "${result}\"¶" + string.replaceAll("\\\\", "\\\\\\\\").replaceAll(/"/, "\\\\\"").replaceAll(/\$/, "\\\\\\\$") + "\""
 }
 
-println stringify("START")
+println """pb = { def progress ->
+  def barLength = 100
+  def ratio = barLength / 100
+  def builder = new StringBuilder()
+  def percent = (int) ((progress / TOTAL_LINES) * 100)
+  def progressLength = (int) ((progress / TOTAL_LINES) * (100 * ratio))
+  builder.append('=' * progressLength)
+  if (progressLength < barLength) {
+    builder.append('>')
+    builder.append(' ' * (barLength - progressLength - 1))
+  }
+  System.err.print(String.format("\\r   progress: [%s] %s", builder, "\${percent}%"))
+}"""
+
+println stringify("START", 0)
 
 new File(this.args[0]).withReader { reader ->
     try {
@@ -64,13 +79,10 @@ new File(this.args[0]).withReader { reader ->
             if (inCodeSection) {
                 inCodeSection = !line.equals(BLOCK_DELIMITER)
                 if (inCodeSection) {
-                    /*def script = new StringBuilder(header.toString())
-                    imports.getCombinedImports().each { script.append("import ${it}\n") }
-                    imports.getCombinedStaticImports().each { script.append("import static ${it}\n") }*/
                     def script = new StringBuilder()
                     def sanitizedLine = sanitize(line)
                     script.append(sanitizedLine)
-                    println stringify(STATEMENT_PREFIX + format(line))
+                    println stringify(STATEMENT_PREFIX + format(line), lineNumber)
                     if (!sanitizedLine.isEmpty() && sanitizedLine[-1] in STATEMENT_CONTINUATION_CHARACTERS) {
                         while (true) {
                             line = reader.readLine()
@@ -80,38 +92,17 @@ new File(this.args[0]).withReader { reader ->
                             }
                             sanitizedLine = sanitize(line)
                             script.append(sanitizedLine)
-                            println stringify(STATEMENT_CONTINUATION_PREFIX + format(line))
+                            println stringify(STATEMENT_CONTINUATION_PREFIX + format(line), lineNumber)
                         }
                     }
-                    if (line.startsWith("import ")) {
-                        println "..."
-                    } else {
-                        if (line.equals(BLOCK_DELIMITER)) {
-                            skipNextRead = false
-                            inCodeSection = false
-                        }
-                        //def res = engine.eval(script.toString())
-                        println script.toString()
-/*
-                        if (res instanceof Map) {
-                            res = res.entrySet()
-                        }
-                        if (res instanceof Iterable) {
-                            res = res.iterator()
-                        }
-                        if (res instanceof Iterator) {
-                            while (res.hasNext()) {
-                                def current = res.next()
-                                println RESULT_PREFIX + (current ?: "null")
-                            }
-                        } else if (!line.isEmpty() && !line.startsWith("//")) {
-                            println RESULT_PREFIX + (res ?: "null")
-                        }
-*/
+                    if (line.equals(BLOCK_DELIMITER)) {
+                        skipNextRead = false
+                        inCodeSection = false
                     }
+                    println script.toString()
                 }
                 if (!inCodeSection) {
-                    println stringify(BLOCK_DELIMITER)
+                    println stringify(BLOCK_DELIMITER, lineNumber)
                 }
             } else {
                 if (line.startsWith("[gremlin-")) {
@@ -128,16 +119,19 @@ new File(this.args[0]).withReader { reader ->
                     }
                     println "g = graph.traversal(standard())"
                     println "marko = g.V().has(\"name\", \"marko\").tryNext().orElse(null)"
+                    println "f = new File('/tmp/neo4j')"
+                    println "if (f.exists()) f.deleteDir()"
                     println stringify("IGNORE")
                     reader.readLine()
                     inCodeSection = true
                     println stringify("[source,${lang}]")
                     println stringify(BLOCK_DELIMITER)
-                } else println stringify(line)
+                } else println stringify(line, lineNumber)
             }
         }
     } catch (final Throwable e) {
         try {
+            System.err.println()
             e.printStackTrace()
             throw new IllegalArgumentException("The script that failed:\n(${lineNumber}) ${line}");
         } catch (final Exception e1) {
@@ -147,4 +141,4 @@ new File(this.args[0]).withReader { reader ->
     }
 }
 
-println "System.exit(0)"
+println "System.err.println(); System.exit(0)"

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1a601581/docs/preprocessor/uninstall-plugins.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/uninstall-plugins.sh b/docs/preprocessor/uninstall-plugins.sh
new file mode 100755
index 0000000..6353fe5
--- /dev/null
+++ b/docs/preprocessor/uninstall-plugins.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+#
+#
+# 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.
+#
+
+CONSOLE_HOME=$1
+TMP_DIR=$2
+
+if [ -f "${TMP_DIR}/plugins.dir" ]; then
+  for pluginDirectory in $(cat ${TMP_DIR}/plugins.dir); do
+    rm -rf ${CONSOLE_HOME}/ext/${pluginDirectory}
+  done
+fi
+
+if [ -f "${TMP_DIR}/plugins.txt" ]; then
+  for className in $(cat ${TMP_DIR}/plugins.txt); do
+    sed -e "/${className}/d" ${CONSOLE_HOME}/ext/plugins.txt > ${CONSOLE_HOME}/ext/plugins.txt.
+    mv ${CONSOLE_HOME}/ext/plugins.txt. ${CONSOLE_HOME}/ext/plugins.txt
+  done
+fi


[05/26] incubator-tinkerpop git commit: attempt to make preprocessor OSX compatible

Posted by dk...@apache.org.
attempt to make preprocessor OSX compatible


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

Branch: refs/heads/master
Commit: 3fd4b4dfa8093d2a6173f2ba80926bb1a9282c8f
Parents: 01e61d2
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Sat May 30 00:15:07 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Sat May 30 00:15:07 2015 +0200

----------------------------------------------------------------------
 docs/preprocessor/preprocess-file.sh |  4 ++--
 docs/preprocessor/preprocess.sh      | 14 +++++++++++---
 2 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/3fd4b4df/docs/preprocessor/preprocess-file.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/preprocess-file.sh b/docs/preprocessor/preprocess-file.sh
index eb305bf..5dd21c8 100755
--- a/docs/preprocessor/preprocess-file.sh
+++ b/docs/preprocessor/preprocess-file.sh
@@ -20,9 +20,9 @@
 #
 
 TP_HOME=`pwd`
-CONSOLE_HOME=`readlink -f ${TP_HOME}/gremlin-console/target/apache-gremlin-console-*-standalone`
+CONSOLE_HOME=$1
 
-input=$1
+input=$2
 name=`basename ${input}`
 output="${TP_HOME}/target/postprocess-asciidoc/${name}"
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/3fd4b4df/docs/preprocessor/preprocess.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/preprocess.sh b/docs/preprocessor/preprocess.sh
index a793480..14ec7c7 100755
--- a/docs/preprocessor/preprocess.sh
+++ b/docs/preprocessor/preprocess.sh
@@ -27,13 +27,21 @@ if [ ! -f bin/gremlin.sh ]; then
   exit 1
 fi
 
+function directory {
+  d1=`pwd`
+  cd $1
+  d2=`pwd`
+  cd $d1
+  echo "$d2"
+}
+
 mkdir -p target/postprocess-asciidoc
 rm -rf target/postprocess-asciidoc/*
 mkdir target/postprocess-asciidoc/tmp
 cp -R docs/{static,stylesheets} target/postprocess-asciidoc/
 
 TP_HOME=`pwd`
-CONSOLE_HOME=`readlink -f ${TP_HOME}/gremlin-console/target/apache-gremlin-console-*-standalone`
+CONSOLE_HOME=`directory "${TP_HOME}/gremlin-console/target/apache-gremlin-console-*-standalone"`
 PLUGIN_DIR="${CONSOLE_HOME}/ext"
 TP_VERSION=$(cat pom.xml | grep -A1 '<artifactId>tinkerpop</artifactId>' | grep -Po '(?<=<version>).*(?=</version>)')
 
@@ -62,7 +70,7 @@ if [ ! -z "${hadoopPluginName}" -a ! -d "${hadoopPluginDirectory}" -a ${match} -
   mkdir -p "${PLUGIN_DIR}/${hadoopPluginName}/"{lib,plugin}
   #cp ${hadoopPluginName}/target/*${TP_VERSION}.jar "${PLUGIN_DIR}/${hadoopPluginName}/lib"
   cp ${hadoopPluginName}/target/*${TP_VERSION}.jar "${PLUGIN_DIR}/${hadoopPluginName}/plugin"
-  libdir=`readlink -f ${hadoopPluginName}/target/*-standalone/lib/`
+  libdir=`directory "${hadoopPluginName}/target/*-standalone/lib/"`
   if [ -d "${libdir}" ]; then
     #cp ${libdir}/*.jar "${PLUGIN_DIR}/${hadoopPluginName}/lib"
     cp ${libdir}/*.jar "${PLUGIN_DIR}/${hadoopPluginName}/plugin"
@@ -81,7 +89,7 @@ fi
 cp ${TP_HOME}/hadoop-gremlin/conf/* "${CONSOLE_HOME}/conf/"
 
 # process *.asciidoc files
-find "${TP_HOME}/docs/src/" -name "*.asciidoc" | xargs -n1 -P0 "${TP_HOME}/docs/preprocessor/preprocess-file.sh"
+find "${TP_HOME}/docs/src/" -name "*.asciidoc" | xargs -n1 -P0 "${TP_HOME}/docs/preprocessor/preprocess-file.sh" "${CONSOLE_HOME}"
 
 cleanup
 


[04/26] incubator-tinkerpop git commit: process all AsciiDoc files, not only implementations.asciidoc

Posted by dk...@apache.org.
process all AsciiDoc files, not only implementations.asciidoc


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

Branch: refs/heads/master
Commit: 01e61d28e93959f610df4a6cdd9d408bbe4258d0
Parents: 507495d
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Fri May 29 18:00:26 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Fri May 29 18:00:26 2015 +0200

----------------------------------------------------------------------
 docs/preprocessor/preprocess.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/01e61d28/docs/preprocessor/preprocess.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/preprocess.sh b/docs/preprocessor/preprocess.sh
index 76b5aec..a793480 100755
--- a/docs/preprocessor/preprocess.sh
+++ b/docs/preprocessor/preprocess.sh
@@ -81,8 +81,7 @@ fi
 cp ${TP_HOME}/hadoop-gremlin/conf/* "${CONSOLE_HOME}/conf/"
 
 # process *.asciidoc files
-#find "${TP_HOME}/docs/src/" -name "*.asciidoc" | xargs -n1 -P0 "${TP_HOME}/docs/preprocessor/preprocess-file.sh"
-find "${TP_HOME}/docs/src/" -name "implementations.asciidoc" | xargs -n1 -P0 "${TP_HOME}/docs/preprocessor/preprocess-file.sh"
+find "${TP_HOME}/docs/src/" -name "*.asciidoc" | xargs -n1 -P0 "${TP_HOME}/docs/preprocessor/preprocess-file.sh"
 
 cleanup
 


[11/26] incubator-tinkerpop git commit: Merge branch 'master' into preprocessor

Posted by dk...@apache.org.
Merge branch 'master' into preprocessor


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

Branch: refs/heads/master
Commit: 38a073356f66a551d18d6092bfebdde1754307ee
Parents: bb7d249 15d8da0
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Mon Jun 1 19:38:42 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Mon Jun 1 19:38:42 2015 +0200

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   8 +-
 README.asciidoc                                 |   3 +
 docs/src/gremlin-applications.asciidoc          |   2 +
 docs/src/implementations.asciidoc               | 171 ++++-
 docs/src/the-graph.asciidoc                     |  30 +-
 gremlin-console/src/assembly/distribution.xml   |   3 +-
 gremlin-console/src/assembly/standalone.xml     |   4 +
 gremlin-console/src/main/bin/gremlin.sh         |   2 +
 .../gremlin/console/GremlinGroovysh.groovy      |   2 +
 .../plugin/gremlin-server-integration.yaml      |   4 +-
 gremlin-core/pom.xml                            |   7 +
 .../traversal/dsl/graph/GraphTraversal.java     | 185 +++--
 .../traversal/lambda/FilterTraversal.java       |  52 --
 .../lambda/FilterTraverserTraversal.java        |  52 --
 .../traversal/lambda/FunctionTraverser.java     |  44 ++
 .../process/traversal/lambda/MapTraversal.java  |  52 --
 .../traversal/lambda/MapTraverserTraversal.java |  52 --
 .../traversal/lambda/PredicateTraverser.java    |  44 ++
 .../tinkerpop/gremlin/structure/Graph.java      |  53 ++
 .../tinkerpop/gremlin/structure/Vertex.java     |   6 +-
 .../structure/io/graphml/GraphMLReader.java     |  18 +-
 .../structure/io/graphson/GraphSONReader.java   |   4 +-
 .../io/graphson/LegacyGraphSONReader.java       |  21 +-
 .../gremlin/structure/io/gryo/GryoReader.java   |   4 +-
 .../gremlin/structure/util/Attachable.java      |  31 +-
 .../gremlin/structure/util/Comparators.java     |  26 +-
 .../gremlin/structure/util/ElementHelper.java   |  74 +-
 .../gremlin/structure/util/GraphFactory.java    |  14 +-
 .../structure/util/GraphVariableHelper.java     |   4 +-
 .../gremlin/structure/util/star/StarGraph.java  | 111 +++
 .../gremlin/util/iterator/IteratorUtils.java    |  13 +-
 .../apache/tinkerpop/gremlin/TestHelper.java    |  20 +
 .../gremlin/structure/util/ComparatorsTest.java | 111 +++
 .../structure/util/ElementHelperTest.java       |  83 ++-
 .../structure/util/GraphFactoryTest.java        | 323 +++++++++
 .../structure/util/GraphVariableHelperTest.java |  72 ++
 .../structure/util/StringFactoryTest.java       |  32 +
 .../structure/util/mockgraph-busted.yaml        |  20 +
 .../gremlin/structure/util/mockgraph.properties |  18 +
 .../gremlin/structure/util/mockgraph.xml        |  22 +
 .../gremlin/structure/util/mockgraph.yaml       |  19 +
 gremlin-driver/pom.xml                          |   6 -
 ...raphSONMessageSerializerGremlinV1d0Test.java | 267 ++++++++
 .../ser/GraphSONMessageSerializerV1d0Test.java  | 357 ++++++++++
 .../JsonMessageSerializerGremlinV1d0Test.java   | 267 --------
 .../ser/JsonMessageSerializerV1d0Test.java      | 354 ----------
 .../step/branch/GroovyChooseTest.groovy         |   9 +-
 .../gremlin/groovy/engine/GremlinExecutor.java  |  44 +-
 .../groovy/engine/GremlinExecutorTest.java      | 113 +++-
 .../groovy/engine/GremlinExecutorInit.groovy    |   5 +-
 .../apache/tinkerpop/gremlin/GraphProvider.java |   4 +-
 .../traversal/step/branch/ChooseTest.java       |  18 +-
 .../gremlin/structure/FeatureSupportTest.java   | 177 ++++-
 .../structure/GraphConstructionTest.java        |   4 +-
 .../tinkerpop/gremlin/structure/io/IoTest.java  |  18 +-
 .../process/computer/spark/SparkExecutor.java   |   9 +-
 .../gremlin/hadoop/structure/HadoopGraph.java   |   5 +
 .../groovy/plugin/HadoopGremlinPluginTest.java  |   5 +-
 neo4j-gremlin/pom.xml                           | 171 +++++
 .../neo4j/groovy/plugin/Neo4jGremlinPlugin.java |  58 ++
 .../step/sideEffect/CypherStartStep.java        |  54 ++
 .../step/sideEffect/Neo4jGraphStep.java         |  69 ++
 .../optimization/Neo4jGraphStepStrategy.java    |  70 ++
 .../neo4j/process/util/Neo4jCypherIterator.java |  64 ++
 .../gremlin/neo4j/structure/Neo4jEdge.java      | 132 ++++
 .../gremlin/neo4j/structure/Neo4jElement.java   |  79 +++
 .../gremlin/neo4j/structure/Neo4jGraph.java     | 549 +++++++++++++++
 .../neo4j/structure/Neo4jGraphVariables.java    | 176 +++++
 .../gremlin/neo4j/structure/Neo4jHelper.java    |  64 ++
 .../gremlin/neo4j/structure/Neo4jProperty.java  |  94 +++
 .../gremlin/neo4j/structure/Neo4jVertex.java    | 177 +++++
 .../neo4j/structure/Neo4jVertexProperty.java    | 121 ++++
 .../structure/trait/MultiMetaNeo4jTrait.java    | 282 ++++++++
 .../neo4j/structure/trait/Neo4jTrait.java       |  75 +++
 .../trait/NoMultiNoMetaNeo4jTrait.java          | 201 ++++++
 ...inkerpop.gremlin.groovy.plugin.GremlinPlugin |   1 +
 .../neo4j/AbstractNeo4jGraphProvider.java       | 158 +++++
 .../gremlin/neo4j/AbstractNeo4jGremlinTest.java |  50 ++
 .../neo4j/MultiMetaNeo4jGraphProvider.java      |  44 ++
 .../gremlin/neo4j/NativeNeo4jSuite.java         |  52 ++
 .../neo4j/NoMultiNoMetaNeo4jGraphProvider.java  |  47 ++
 .../MultiMetaNeo4jGraphProcessStandardTest.java |  36 +
 .../neo4j/process/NativeNeo4jCypherTest.java    | 125 ++++
 ...ultiNoMetaNeo4jGraphProcessStandardTest.java |  36 +
 ...MetaNeo4jGraphGroovyProcessStandardTest.java |  33 +
 ...MetaNeo4jGraphGroovyProcessStandardTest.java |  37 +
 .../MultiMetaNeo4jGraphNativeNeo4jTest.java     |  35 +
 ...ultiMetaNeo4jGraphStructureStandardTest.java |  35 +
 .../neo4j/structure/NativeNeo4jIndexTest.java   |  60 ++
 .../structure/NativeNeo4jStructureTest.java     | 669 +++++++++++++++++++
 .../NoMultiNoMetaNeo4jGraphNativeNeo4jTest.java |  35 +
 ...tiNoMetaNeo4jGraphStructureStandardTest.java |  35 +
 pom.xml                                         |  66 +-
 .../tinkergraph/structure/TinkerFactory.java    |   4 +-
 .../tinkergraph/structure/TinkerGraph.java      | 100 ++-
 .../tinkergraph/structure/TinkerVertex.java     |   5 -
 .../tinkergraph/TinkerGraphProvider.java        |  15 +
 97 files changed, 6494 insertions(+), 1098 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/38a07335/docs/src/implementations.asciidoc
----------------------------------------------------------------------


[15/26] incubator-tinkerpop git commit: removed dynamic code sample for Spark

Posted by dk...@apache.org.
removed dynamic code sample for Spark


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

Branch: refs/heads/master
Commit: 91c6d02fcc0fdb77181f3e08629e55760a1239d5
Parents: 62e4a1b
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Wed Jun 3 02:11:34 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Wed Jun 3 02:11:34 2015 +0200

----------------------------------------------------------------------
 docs/src/implementations.asciidoc | 8 --------
 1 file changed, 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/91c6d02f/docs/src/implementations.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/implementations.asciidoc b/docs/src/implementations.asciidoc
index 5c120d1..5cdc105 100644
--- a/docs/src/implementations.asciidoc
+++ b/docs/src/implementations.asciidoc
@@ -952,14 +952,6 @@ gremlin> g.V().out().out().values('name')
 ==>lop
 ==>ripple
 
-[gremlin-groovy]
-----
-graph = GraphFactory.open('conf/hadoop/hadoop-gryo.properties')
-g = graph.traversal(computer(SparkGraphComputer))
-g.V().count()
-g.V().out().out().values('name')
-----
-
 For using lambdas in Gremlin-Groovy, simply provide `:remote connect` a `TraversalSource` which leverages SparkGraphComputer.
 
 [source,test]


[20/26] incubator-tinkerpop git commit: OSX'ified grep in preprocess.sh

Posted by dk...@apache.org.
OSX'ified grep in preprocess.sh


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

Branch: refs/heads/master
Commit: cea173269f68678e45eeb9e5c39597b0a920513f
Parents: e7b5e19
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Fri Jun 5 00:50:30 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Fri Jun 5 00:50:30 2015 +0200

----------------------------------------------------------------------
 docs/preprocessor/preprocess.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cea17326/docs/preprocessor/preprocess.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/preprocess.sh b/docs/preprocessor/preprocess.sh
index 18427a1..4587b0e 100755
--- a/docs/preprocessor/preprocess.sh
+++ b/docs/preprocessor/preprocess.sh
@@ -43,7 +43,7 @@ cp -R docs/{static,stylesheets} target/postprocess-asciidoc/
 TP_HOME=`pwd`
 CONSOLE_HOME=`directory "${TP_HOME}/gremlin-console/target/apache-gremlin-console-*-standalone"`
 PLUGIN_DIR="${CONSOLE_HOME}/ext"
-TP_VERSION=$(cat pom.xml | grep -A1 '<artifactId>tinkerpop</artifactId>' | grep -o 'version>[^<]*' | grep -o '>.*' | grep -o '[^>]*')
+TP_VERSION=$(cat pom.xml | grep -A1 '<artifactId>tinkerpop</artifactId>' | grep -o 'version>[^<]*' | grep -o '>.*' | cut -d '>' -f2 | head -n1)
 TMP_DIR="/tmp/tp-docs-preprocessor"
 
 trap cleanup INT


[22/26] incubator-tinkerpop git commit: fixed another grep for OSX

Posted by dk...@apache.org.
fixed another grep for OSX


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

Branch: refs/heads/master
Commit: d8044446c84d3a4f6d20648dad23c87f492fd949
Parents: ec4e41c
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Fri Jun 5 18:10:14 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Fri Jun 5 18:10:14 2015 +0200

----------------------------------------------------------------------
 docs/preprocessor/preprocess-file.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d8044446/docs/preprocessor/preprocess-file.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/preprocess-file.sh b/docs/preprocessor/preprocess-file.sh
index 9b8abac..42e33c0 100755
--- a/docs/preprocessor/preprocess-file.sh
+++ b/docs/preprocessor/preprocess-file.sh
@@ -34,7 +34,7 @@ echo -ne "   progress: initializing"
 if [ $(grep -c '^\[gremlin' ${input}) -gt 0 ]; then
   pushd "${CONSOLE_HOME}" > /dev/null
   bin/gremlin.sh -e ${TP_HOME}/docs/preprocessor/processor.groovy ${input} > ${input}.part2.groovy
-  cat ${input}.part2.groovy | grep -o '^pb([0-9][0-9]*' | tail -n1 | grep -o '[0-9]*' | xargs echo "TOTAL_LINES =" > ${input}.part1.groovy
+  cat ${input}.part2.groovy | grep -o '^pb([0-9][0-9]*' | tail -n1 | cut -d '(' -f2 | xargs echo "TOTAL_LINES =" > ${input}.part1.groovy
   cat ${input}.part?.groovy > ${input}.groovy && rm -f ${input}.part?.groovy
   ec=${PIPESTATUS[0]}
   if [ ${ec} -eq 0 ]; then


[09/26] incubator-tinkerpop git commit: worked with @dkuppitz to get his preprocess.sh script working on MacOSX.

Posted by dk...@apache.org.
worked with @dkuppitz to get his preprocess.sh script working on MacOSX.


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

Branch: refs/heads/master
Commit: 130d94556e252bc7bb32247e9e3f7cdf362f7f2a
Parents: ec86c7c
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Jun 1 11:25:14 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Jun 1 11:25:14 2015 -0600

----------------------------------------------------------------------
 docs/preprocessor/preprocess-file.sh | 2 +-
 docs/preprocessor/preprocess.sh      | 2 +-
 docs/preprocessor/processor.groovy   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/130d9455/docs/preprocessor/preprocess-file.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/preprocess-file.sh b/docs/preprocessor/preprocess-file.sh
index 5dd21c8..0bb621d 100755
--- a/docs/preprocessor/preprocess-file.sh
+++ b/docs/preprocessor/preprocess-file.sh
@@ -33,7 +33,7 @@ if [ $(grep -c '^\[gremlin' ${input}) -gt 0 ]; then
   bin/gremlin.sh -e ${TP_HOME}/docs/preprocessor/processor.groovy ${input} > ${input}.groovy
   ec=${PIPESTATUS[0]}
   if [ ${ec} -eq 0 ]; then
-    HADOOP_GREMLIN_LIBS="${CONSOLE_HOME}/ext/hadoop-gremlin/lib" bin/gremlin.sh ${input}.groovy | awk 'BEGIN {b=1} /\1IGNORE/ {b=!b} !/\1IGNORE/ {if(a&&b)print} /\1START/ {a=1}' | grep -v '^WARN ' | sed 's/^==>\x01//' > ${output}
+    HADOOP_GREMLIN_LIBS="${CONSOLE_HOME}/ext/hadoop-gremlin/lib" bin/gremlin.sh ${input}.groovy | awk 'BEGIN {b=1} /¶IGNORE/ {b=!b} !/¶IGNORE/ {if(a&&b)print} /¶START/ {a=1}' | grep -v '^WARN ' | sed 's/^==>¶//' > ${output}
     ec=${PIPESTATUS[0]}
     rm -f ${input}.groovy
   fi

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/130d9455/docs/preprocessor/preprocess.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/preprocess.sh b/docs/preprocessor/preprocess.sh
index 5fc9463..66f3367 100755
--- a/docs/preprocessor/preprocess.sh
+++ b/docs/preprocessor/preprocess.sh
@@ -86,7 +86,7 @@ fi
 cp ${TP_HOME}/hadoop-gremlin/conf/* "${CONSOLE_HOME}/conf/"
 
 # process *.asciidoc files
-find "${TP_HOME}/docs/src/" -name "*.asciidoc" | xargs -n1 -P8 "${TP_HOME}/docs/preprocessor/preprocess-file.sh" "${CONSOLE_HOME}"
+find "${TP_HOME}/docs/src/" -name "*.asciidoc" | xargs -n1 -P4 "${TP_HOME}/docs/preprocessor/preprocess-file.sh" "${CONSOLE_HOME}"
 
 cleanup
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/130d9455/docs/preprocessor/processor.groovy
----------------------------------------------------------------------
diff --git a/docs/preprocessor/processor.groovy b/docs/preprocessor/processor.groovy
index a33c42a..37b88ab 100644
--- a/docs/preprocessor/processor.groovy
+++ b/docs/preprocessor/processor.groovy
@@ -51,7 +51,7 @@ format = { def codeLine ->
 }
 
 stringify = { def string ->
-    "\"\1" + string.replaceAll("\\\\", "\\\\\\\\").replaceAll(/"/, "\\\\\"").replaceAll(/\$/, "\\\\\\\$") + "\""
+    "\"¶" + string.replaceAll("\\\\", "\\\\\\\\").replaceAll(/"/, "\\\\\"").replaceAll(/\$/, "\\\\\\\$") + "\""
 }
 
 //println "try {"


[14/26] incubator-tinkerpop git commit: added dynamic code sample for Neo4j

Posted by dk...@apache.org.
added dynamic code sample for Neo4j


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

Branch: refs/heads/master
Commit: 62e4a1bd5a4eb4a2d1fc885463939e077a2f6687
Parents: 1a60158
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Wed Jun 3 01:51:53 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Wed Jun 3 01:51:53 2015 +0200

----------------------------------------------------------------------
 docs/src/implementations.asciidoc | 38 ++++++++++++++++++++++++++++++----
 1 file changed, 34 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/62e4a1bd/docs/src/implementations.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/implementations.asciidoc b/docs/src/implementations.asciidoc
index 2b01353..5c120d1 100644
--- a/docs/src/implementations.asciidoc
+++ b/docs/src/implementations.asciidoc
@@ -589,6 +589,20 @@ gremlin> g = graph.traversal(standard())
 gremlin> g.V().hasLabel('person').has('name','marko').values('name')
 ==>marko
 
+[gremlin-groovy]
+----
+graph = Neo4jGraph.open('/tmp/neo4j')
+graph.cypher("CREATE INDEX ON :person(name)")
+graph.tx().commit()  <1>
+graph.addVertex(label,'person','name','marko')
+graph.addVertex(label,'dog','name','puppy')
+g = graph.traversal(standard())
+g.V().hasLabel('person').has('name','marko').values('name')
+graph.close()
+----
+
+<1> schema mutations must happen in a different tx than graph mutations
+
 Below demonstrates the runtime benefits of indices and demonstrates how if there is no defined index (only vertex labels), a linear scan of the vertex-label partition is still faster than a linear scan of all vertices.
 
 [source,groovy]
@@ -613,6 +627,22 @@ gremlin> clock(1000){g.V().hasLabel('artist').has('name','Garcia').next()} <5>
 gremlin> clock(1000){g.V().has('name','Garcia').next()} <6>
 ==>0.6293959999999993
 
+[gremlin-groovy]
+----
+graph = Neo4jGraph.open('/tmp/neo4j')
+graph.cypher("CREATE INDEX ON :artist(name)") <1>
+graph.tx().commit()
+graph.io(graphml()).readGraph('data/grateful-dead.xml')
+g = graph.traversal(standard())
+clock(1000) {g.V().hasLabel('artist').has('name','Garcia').next()}  <2>
+clock(1000) {g.V().has('name','Garcia').next()} <3>
+graph.cypher("DROP INDEX ON :artist(name)") <4>
+g.tx().commit()
+clock(1000) {g.V().hasLabel('artist').has('name','Garcia').next()} <5>
+clock(1000) {g.V().has('name','Garcia').next()} <6>
+graph.close()
+----
+
 <1> Create an index for all artist vertices on their name property.
 <2> Find all artists whose name is Garcia which uses the pre-defined schema index.
 <3> Find all vertices whose name is Garcia which requires a linear scan of all the data in the graph.
@@ -731,7 +761,7 @@ gremlin>
 Properties Files
 ~~~~~~~~~~~~~~~~
 
-`HadoopGraph` makes heavy use of properties files which ultimately get turned into Apache configurations and Hadoop configurations. The example properties file presented below is located at `conf/hadoop-gryo.properties`.
+`HadoopGraph` makes heavy use of properties files which ultimately get turned into Apache configurations and Hadoop configurations. The example properties file presented below is located at `conf/hadoop/hadoop-gryo.properties`.
 
 [source,text]
 gremlin.graph=org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph
@@ -807,7 +837,7 @@ gremlin> g.V().group().by{it.value('name')[1]}.by('name').next()
 ----
 hdfs.copyFromLocal('data/tinkerpop-modern.kryo', 'tinkerpop-modern.kryo')
 hdfs.ls()
-graph = GraphFactory.open('conf/hadoop-gryo.properties')
+graph = GraphFactory.open('conf/hadoop/hadoop-gryo.properties')
 g = graph.traversal(standard())
 g.V().count()
 g.V().out().out().values('name')
@@ -871,7 +901,7 @@ INFO  org.apache.hadoop.mapred.JobClient  -  map 0% reduce 0%
 
 [gremlin-groovy]
 ----
-graph = GraphFactory.open('conf/hadoop-gryo.properties')
+graph = GraphFactory.open('conf/hadoop/hadoop-gryo.properties')
 g = graph.traversal(computer())
 g.V().count()
 g.V().out().out().values('name')
@@ -924,7 +954,7 @@ gremlin> g.V().out().out().values('name')
 
 [gremlin-groovy]
 ----
-graph = GraphFactory.open('conf/hadoop-gryo.properties')
+graph = GraphFactory.open('conf/hadoop/hadoop-gryo.properties')
 g = graph.traversal(computer(SparkGraphComputer))
 g.V().count()
 g.V().out().out().values('name')


[19/26] incubator-tinkerpop git commit: more work on preprocessor

Posted by dk...@apache.org.
more work on preprocessor


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

Branch: refs/heads/master
Commit: e7b5e1990a7f6724ce1417a7bb43e5d595082f28
Parents: 44b4949
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Thu Jun 4 02:45:50 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Thu Jun 4 02:45:50 2015 +0200

----------------------------------------------------------------------
 docs/preprocessor/preprocess-file.sh | 4 ++--
 docs/src/implementations.asciidoc    | 8 ++++++++
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/e7b5e199/docs/preprocessor/preprocess-file.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/preprocess-file.sh b/docs/preprocessor/preprocess-file.sh
index 2bd66d3..9b8abac 100755
--- a/docs/preprocessor/preprocess-file.sh
+++ b/docs/preprocessor/preprocess-file.sh
@@ -38,8 +38,8 @@ if [ $(grep -c '^\[gremlin' ${input}) -gt 0 ]; then
   cat ${input}.part?.groovy > ${input}.groovy && rm -f ${input}.part?.groovy
   ec=${PIPESTATUS[0]}
   if [ ${ec} -eq 0 ]; then
-    HADOOP_GREMLIN_LIBS="${CONSOLE_HOME}/ext/hadoop-gremlin/lib" bin/gremlin.sh ${input}.groovy | awk 'BEGIN {b=1} /¶IGNORE/ {b=!b} !/¶IGNORE/ {if(a&&b)print} /¶START/ {a=1}' | grep -v '^WARN ' | sed 's/^==>¶//' > ${output}
-    ec=${PIPESTATUS[0]}
+    cat ${input}.groovy | HADOOP_GREMLIN_LIBS="${CONSOLE_HOME}/ext/hadoop-gremlin/lib" bin/gremlin.sh | grep -v '^gremlin> ' | awk 'BEGIN {i=0} /^==>¶IGNORE$/ {i=!i} /^==>¶END$/ {p=0} !/^==>¶IGNORE$/ {if(!i&&p)print} /^==>¶START$/ {p=1}' | grep -v '^WARN ' | sed 's/^==>¶//' > ${output}
+    ec=${PIPESTATUS[1]}
   fi
   rm -f ${input}.groovy
   popd > /dev/null

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/e7b5e199/docs/src/implementations.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/implementations.asciidoc b/docs/src/implementations.asciidoc
index 138a981..37f53ae 100644
--- a/docs/src/implementations.asciidoc
+++ b/docs/src/implementations.asciidoc
@@ -882,6 +882,14 @@ gremlin> :remote connect tinkerpop.hadoop graph g
 gremlin> :> g.V().group().by{it.value('name')[1]}.by('name')
 ==>[a:[marko, vadas], e:[peter], i:[ripple], o:[lop, josh]]
 
+[gremlin-groovy]
+----
+graph = GraphFactory.open('conf/hadoop/hadoop-gryo.properties')
+g = graph.traversal(computer(SparkGraphComputer))
+:remote connect tinkerpop.hadoop graph g
+:> g.V().group().by{it.value('name')[1]}.by('name')
+----
+
 The `SparkGraphComputer` algorithm leverages Spark's caching abilities to reduce the amount of data shuffled across the wire on each iteration of the <<vertexprogram,`VertexProgram`>>. When the graph is loaded as a Spark RDD (Resilient Distributed Dataset) it is immediately cached as `graphRDD`. The `graphRDD` is a distributed adjacency list which encodes the vertex, its properties, and all its incident edges. On the first iteration, each vertex (in parallel) is passed through `VertexProgram.execute()`. This yields an output of the vertex's mutated state (i.e. updated compute keys -- `propertyX`) and its outgoing messages. This `viewOutgoingRDD` is then reduced to `viewIncomingRDD` where the outgoing messages are sent to their respective vertices. If a `MessageCombiner` exists for the vertex program, then messages are aggregated locally and globally to ultimately yield one incoming message for the vertex. This reduce sequence is the "message pass." If the vertex program does not ter
 minate on this iteration, then the `viewIncomingRDD` is joined with the cached `graphRDD` and the process continues. When there are no more iterations, there is a final join and the resultant RDD is stripped of its edges and messages. This `mapReduceRDD` is cached and is processed by each <<mapreduce,`MapReduce`>> job in the <<graphcomputer,`GraphComputer`>> computation.
 
 image::spark-algorithm.png[width=775]


[17/26] incubator-tinkerpop git commit: excluded servlet-api-2.5-6.1.14.jar from plugin directories

Posted by dk...@apache.org.
excluded servlet-api-2.5-6.1.14.jar from plugin directories


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

Branch: refs/heads/master
Commit: a08b06f71b057539c160b60f9cd9ff3deb0387be
Parents: a806bee
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Thu Jun 4 00:25:26 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Thu Jun 4 00:25:26 2015 +0200

----------------------------------------------------------------------
 .../groovy/util/DependencyGrabber.groovy        | 55 +++++++++++---------
 1 file changed, 30 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/a08b06f7/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/util/DependencyGrabber.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/util/DependencyGrabber.groovy b/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/util/DependencyGrabber.groovy
index 637162d..a90b4d4 100644
--- a/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/util/DependencyGrabber.groovy
+++ b/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/util/DependencyGrabber.groovy
@@ -18,9 +18,9 @@
  */
 package org.apache.tinkerpop.gremlin.groovy.util
 
-import org.apache.tinkerpop.gremlin.groovy.plugin.Artifact
 import groovy.grape.Grape
 import org.apache.commons.lang3.SystemUtils
+import org.apache.tinkerpop.gremlin.groovy.plugin.Artifact
 
 import java.nio.file.*
 import java.util.jar.JarFile
@@ -79,33 +79,38 @@ class DependencyGrabber {
         // if windows then the path contains a starting forward slash that prevents it from being
         // recognized by FileSystem - strip it off
         dependencyLocations.collect {
-                    def p = SystemUtils.IS_OS_WINDOWS ? it.path.substring(1) : it.path
-                    return fs.getPath(p)
-                }.findAll { !(it.fileName.toFile().name ==~ /(slf4j|logback\-classic)-.*\.jar/) }
-                .findAll { !filesAlreadyInPath.collect { it.getFileName().toString() }.contains(it.fileName.toFile().name)}
-                .each {
-                    def copying = targetPluginPath.resolve(it.fileName)
-                    Files.copy(it, copying, StandardCopyOption.REPLACE_EXISTING)
-                    println "Copying - $copying"
-                }
+            def p = SystemUtils.IS_OS_WINDOWS ? it.path.substring(1) : it.path
+            return fs.getPath(p)
+        }.findAll {
+            def name = it.fileName.toFile().name
+            !(name ==~ /(slf4j|logback\-classic)-.*\.jar/) && name != 'servlet-api-2.5-6.1.14.jar'
+        }.findAll {
+            !filesAlreadyInPath.collect { it.getFileName().toString() }.contains(it.fileName.toFile().name)
+        }.each {
+            def copying = targetPluginPath.resolve(it.fileName)
+            Files.copy(it, copying, StandardCopyOption.REPLACE_EXISTING)
+            println "Copying - $copying"
+        }
 
         dependencyLocations.collect {
-                    def p = SystemUtils.IS_OS_WINDOWS ? it.path.substring(1) : it.path
-                    return fs.getPath(p)
-                }.each {
-                    def copying = targetLibPath.resolve(it.fileName)
-                    Files.copy(it, copying, StandardCopyOption.REPLACE_EXISTING)
-                    println "Copying - $copying"
-                }
+            def p = SystemUtils.IS_OS_WINDOWS ? it.path.substring(1) : it.path
+            return fs.getPath(p)
+        }.each {
+            def copying = targetLibPath.resolve(it.fileName)
+            Files.copy(it, copying, StandardCopyOption.REPLACE_EXISTING)
+            println "Copying - $copying"
+        }
 
-        getAdditionalDependencies(targetPluginPath, artifact).collect { fs.getPath(it.path) }
-                .findAll { !(it.fileName.toFile().name ==~ /(slf4j|logback\-classic)-.*\.jar/) }
-                .findAll { !filesAlreadyInPath.collect { it.getFileName().toString() }.contains(it.fileName.toFile().name)}
-                .each {
-                    def copying = targetPluginPath.resolve(it.fileName)
-                    Files.copy(it, copying, StandardCopyOption.REPLACE_EXISTING)
-                    println "Copying - $copying"
-                }
+        getAdditionalDependencies(targetPluginPath, artifact).collect { fs.getPath(it.path) }.findAll {
+            def name = it.fileName.toFile().name
+            !(name ==~ /(slf4j|logback\-classic)-.*\.jar/) && name != 'servlet-api-2.5-6.1.14.jar'
+        }.findAll {
+            !filesAlreadyInPath.collect { it.getFileName().toString() }.contains(it.fileName.toFile().name)
+        }.each {
+            def copying = targetPluginPath.resolve(it.fileName)
+            Files.copy(it, copying, StandardCopyOption.REPLACE_EXISTING)
+            println "Copying - $copying"
+        }
 
         getAdditionalDependencies(targetLibPath, artifact).collect { fs.getPath(it.path) }.each {
             def copying = targetLibPath.resolve(it.fileName)


[18/26] incubator-tinkerpop git commit: removed static code samples and added dynamic Spark sample

Posted by dk...@apache.org.
removed static code samples and added dynamic Spark sample


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

Branch: refs/heads/master
Commit: 44b494914f6cebe8e5c774d89833c6ddbd9b6f8a
Parents: a08b06f
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Thu Jun 4 00:27:15 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Thu Jun 4 00:27:15 2015 +0200

----------------------------------------------------------------------
 docs/src/implementations.asciidoc | 117 +++++----------------------------
 1 file changed, 15 insertions(+), 102 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/44b49491/docs/src/implementations.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/implementations.asciidoc b/docs/src/implementations.asciidoc
index b25cf82..138a981 100644
--- a/docs/src/implementations.asciidoc
+++ b/docs/src/implementations.asciidoc
@@ -574,21 +574,6 @@ The Gremlin-Console session below demonstrates Neo4j indices. For more informati
 * Manipulating indices with link:http://docs.neo4j.org/chunked/stable/query-schema-index.html[Cypher].
 * Manipulating indices with the Neo4j link:http://docs.neo4j.org/chunked/stable/tutorials-java-embedded-new-index.html[Java API].
 
-[source,groovy]
-gremlin> graph = Neo4jGraph.open('/tmp/neo4j')
-==>neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]]
-gremlin> graph.cypher('CREATE INDEX ON :person(name)')
-gremlin> graph.tx().commit() // schema mutations must happen in a different tx than graph mutations
-==>null
-gremlin> graph.addVertex(label,'person','name','marko')
-==>v[0]
-gremlin> graph.addVertex(label,'dog','name','puppy')
-==>v[1]
-gremlin> g = graph.traversal(standard())
-==>graphtraversalsource[neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]], standard]
-gremlin> g.V().hasLabel('person').has('name','marko').values('name')
-==>marko
-
 [gremlin-groovy]
 ----
 graph = Neo4jGraph.open('/tmp/neo4j')
@@ -605,30 +590,6 @@ graph.close()
 
 Below demonstrates the runtime benefits of indices and demonstrates how if there is no defined index (only vertex labels), a linear scan of the vertex-label partition is still faster than a linear scan of all vertices.
 
-[source,groovy]
-gremlin> graph = Neo4jGraph.open('/tmp/neo4j')
-==>neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]]
-gremlin> g = graph.traversal(standard())
-==>graphtraversalsource[neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]], standard]
-gremlin> graph.io(graphml()).readGraph('data/grateful-dead.xml')
-==>null
-gremlin> graph.tx().commit()
-==>null
-gremlin> graph.cypher('CREATE INDEX ON :artist(name)') <1>
-gremlin> graph.tx().commit()
-==>null
-gremlin> clock(1000){g.V().hasLabel('artist').has('name','Garcia').iterate()}  <2>
-==>0.038828967
-gremlin> clock(1000){g.V().has('name','Garcia').iterate()} <3>
-==>0.6623919649999999
-gremlin> graph.cypher('DROP INDEX ON :artist(name)') <4>
-gremlin> g.tx().commit()
-==>null
-gremlin> clock(1000){g.V().hasLabel('artist').has('name','Garcia').iterate()} <5>
-==>0.29597517599999995
-gremlin> clock(1000){g.V().has('name','Garcia').iterate()} <6>
-==>0.6685323479999999
-
 [gremlin-groovy]
 ----
 graph = Neo4jGraph.open('/tmp/neo4j')
@@ -661,16 +622,14 @@ image::gremlin-loves-cypher.png[width=400]
 
 NeoTechnology are the creators of the graph pattern-match query language link:http://www.neo4j.org/learn/cypher[Cypher]. It is possible to leverage Cypher from within Gremlin by using the `Neo4jGraph.cypher()` graph traversal method.
 
-[source,groovy]
-gremlin> graph = Neo4jGraph.open('/tmp/neo4j')
-==>neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]]
-gremlin> graph.io(gryo()).readGraph('data/tinkerpop-modern.kryo')
-==>null
-gremlin> graph.cypher('MATCH (a {name:"marko"}) RETURN a')
-==>[a:v[0]]
-gremlin> graph.cypher('MATCH (a {name:"marko"}) RETURN a').select('a').out('knows').values('name')
-==>vadas
-==>josh
+[gremlin-groovy]
+----
+graph = Neo4jGraph.open('/tmp/neo4j')
+graph.io(gryo()).readGraph('data/tinkerpop-modern.kryo')
+graph.cypher('MATCH (a {name:"marko"}) RETURN a')
+graph.cypher('MATCH (a {name:"marko"}) RETURN a').select('a').out('knows').values('name')
+graph.close()
+----
 
 Thus, like <<match-step,`match()`>>-step in Gremlin, it is possible to do a declarative pattern match and then move back into imperative Gremlin.
 
@@ -817,26 +776,6 @@ image:hadoop-pipes.png[width=180,float=left] It is possible to execute OLTP oper
 
 CAUTION: OLTP operations on `HadoopGraph` are not efficient. They require linear scans to execute and are unreasonable for large graphs. In such large graph situations, make use of <<traversalvertexprogram,TraversalVertexProgram>> which is the OLAP implementation of the Gremlin language. Hadoop-Gremlin provides various `GraphComputer` implementations to execute OLAP computations over a `HadoopGraph`.
 
-[source,text]
-gremlin> hdfs.copyFromLocal('data/tinkerpop-modern-vertices.kryo', 'tinkerpop-modern-vertices.kryo')
-==>null
-gremlin> hdfs.ls()
-==>rw-r--r-- marko supergroup 1439 tinkerpop-modern-vertices.kryo
-gremlin> graph = GraphFactory.open('../../../hadoop-gremlin/conf/hadoop-gryo.properties')
-==>hadoopgraph[gryoinputformat->gryooutputformat]
-gremlin> g = graph.traversal(standard())
-==>graphtraversalsource[hadoopgraph[gryoinputformat->gryooutputformat], standard]
-gremlin> g.V().count()
-==>6
-gremlin> g.V().out().out().values('name')
-==>ripple
-==>lop
-gremlin> g.V().group().by{it.value('name')[1]}.by('name').next()
-==>a={marko=1, vadas=1}
-==>e={peter=1}
-==>i={ripple=1}
-==>o={lop=1, josh=1}
-
 [gremlin-groovy]
 ----
 hdfs.copyFromLocal('data/tinkerpop-modern.kryo', 'tinkerpop-modern.kryo')
@@ -878,31 +817,6 @@ WARNING: Giraph uses a large number of Hadoop counters. The default for Hadoop i
 
 WARNING: The maximum number of workers can be no larger than the number of map-slots in the Hadoop cluster minus 1. For example, if the Hadoop cluster has 4 map slots, then `giraph.maxWorkers` can not be larger than 3. One map-slot is reserved for the master compute node and all other slots can be allocated as workers to execute the VertexPrograms on the vertices of the graph.
 
-[source,text]
-gremlin> g = graph.traversal(computer()) // GiraphGraphComputer is the default graph computer when no class is specified
-==>graphtraversalsource[hadoopgraph[gryoinputformat->gryooutputformat], giraphgraphcomputer]
-gremlin> g.V().count()
-INFO  org.apache.tinkerpop.gremlin.hadoop.process.computer.giraph.GiraphGraphComputer  - HadoopGremlin(Giraph): TraversalVertexProgram[GraphStep(vertex), CountGlobalStep, ComputerResultStep]
-INFO  org.apache.hadoop.mapred.JobClient  - Running job: job_201407281259_0037
-INFO  org.apache.hadoop.mapred.JobClient  -  map 0% reduce 0%
-...
-INFO  org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph  - HadoopGremlin: CountGlobalMapReduce
-INFO  org.apache.hadoop.mapred.JobClient  - Running job: job_201407281259_0038
-INFO  org.apache.hadoop.mapred.JobClient  -  map 0% reduce 0%
-...
-==>6
-gremlin> g.V().out().out().values('name')
-INFO  org.apache.tinkerpop.gremlin.hadoop.process.computer.giraph.GiraphGraphComputer  - HadoopGremlin(Giraph): TraversalVertexProgram[GraphStep(vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex), PropertiesStep([name],value), ComputerResultStep]
-INFO  org.apache.hadoop.mapred.JobClient  - Running job: job_201407281259_0031
-INFO  org.apache.hadoop.mapred.JobClient  -  map 0% reduce 0%
-...
-INFO  org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph  - HadoopGremlin: TraverserMapReduce
-INFO  org.apache.hadoop.mapred.JobClient  - Running job: job_201407281259_0032
-INFO  org.apache.hadoop.mapred.JobClient  -  map 0% reduce 0%
-...
-==>ripple
-==>lop
-
 [gremlin-groovy]
 ----
 graph = GraphFactory.open('conf/hadoop/hadoop-gryo.properties')
@@ -947,14 +861,13 @@ SparkGraphComputer
 
 image:spark-logo.png[width=175,float=left] link:http://spark.apache.org[Spark] is an Apache Software Foundation project focused on general-purpose OLAP data processing. Spark provides a hybrid in-memory/disk-based distributed computing model that is similar to Hadoop's MapReduce model. Spark maintains a fluent function chaining DSL that is arguably easier for developers to work with than native Hadoop MapReduce. While Spark has a shorter startup time between "jobs" (a scatter/gather-step), the actual message passing algorithm (as designed by TinkerPop) is less efficient than that of Giraph. For small graphs, Spark will typically be much faster than Giraph, but as the graph becomes larger, the Hadoop MapReduce startup time incurred by Giraph will amortize as more time is spent passing messages (i.e. traversers) between the vertices of the graph.
 
-[source,text]
-gremlin> g = graph.traversal(computer(SparkGraphComputer))
-==>graphtraversalsource[hadoopgraph[gryoinputformat->gryooutputformat], sparkgraphcomputer]
-gremlin> g.V().count()
-==>6
-gremlin> g.V().out().out().values('name')
-==>lop
-==>ripple
+[gremlin-groovy]
+----
+graph = GraphFactory.open('conf/hadoop/hadoop-gryo.properties')
+g = graph.traversal(computer(SparkGraphComputer))
+g.V().count()
+g.V().out().out().values('name')
+----
 
 For using lambdas in Gremlin-Groovy, simply provide `:remote connect` a `TraversalSource` which leverages SparkGraphComputer.
 


[16/26] incubator-tinkerpop git commit: Merge branch 'master' into preprocessor

Posted by dk...@apache.org.
Merge branch 'master' into preprocessor


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

Branch: refs/heads/master
Commit: a806bee69f4e33a7f66543075846eb32262922e4
Parents: 91c6d02 89e02ed
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Wed Jun 3 19:26:41 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Wed Jun 3 19:26:41 2015 +0200

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   7 +-
 docs/src/implementations.asciidoc               |  32 +--
 docs/src/the-graph.asciidoc                     |   4 +-
 docs/src/the-traversal.asciidoc                 |  33 +--
 docs/static/images/aggregate-step.png           | Bin 110622 -> 97419 bytes
 docs/static/images/tinkerpop3.graffle           | 125 ++++++------
 .../gremlin/process/traversal/Scope.java        |  11 -
 .../traversal/dsl/graph/GraphTraversal.java     |  40 +---
 .../dsl/graph/GraphTraversalSource.java         |  13 +-
 .../gremlin/process/traversal/dsl/graph/__.java |  44 ++--
 .../traversal/lambda/FunctionTraverser.java     |   5 +
 .../traversal/lambda/PredicateTraverser.java    |   5 +
 .../process/traversal/step/Mutating.java        |  16 +-
 .../gremlin/process/traversal/step/Scoping.java |  31 +++
 .../process/traversal/step/filter/DropStep.java |  40 +---
 .../traversal/step/filter/WhereStep.java        |  30 ++-
 .../traversal/step/map/AddEdgeByPathStep.java   | 139 -------------
 .../process/traversal/step/map/AddEdgeStep.java | 126 +++++++-----
 .../traversal/step/map/AddVertexStartStep.java  |  42 ++--
 .../traversal/step/map/AddVertexStep.java       |  36 +---
 .../process/traversal/step/map/MapStep.java     |   4 +-
 .../traversal/step/map/SelectOneStep.java       |  15 +-
 .../process/traversal/step/map/SelectStep.java  |  29 ++-
 .../traversal/step/map/match/MatchStep.java     |  10 +
 .../step/sideEffect/AddPropertyStep.java        |  56 ++---
 .../step/util/event/CallbackRegistry.java       |  32 +++
 .../traversal/step/util/event/Event.java        |   2 +-
 .../step/util/event/ListCallbackRegistry.java   |  52 +++++
 .../strategy/decoration/ElementIdStrategy.java  |  20 +-
 .../strategy/decoration/EventStrategy.java      | 126 +++++++-----
 .../strategy/decoration/PartitionStrategy.java  |  30 +--
 .../strategy/decoration/SubgraphStrategy.java   |   2 -
 .../strategy/finalization/ScopingStrategy.java  |  12 +-
 .../structure/util/AbstractTransaction.java     |   4 +-
 .../structure/util/empty/EmptyGraph.java        | 157 ++++++++++++--
 .../gremlin/util/iterator/IteratorUtils.java    |  31 ++-
 .../step/map/AddEdgeByPathStepTest.java         |  47 -----
 .../traversal/step/map/AddEdgeStepTest.java     |  18 +-
 .../ElementIdStrategyTraverseTest.java          |  17 +-
 .../strategy/decoration/EventStrategyTest.java  |   3 +-
 .../PartitionStrategyTraverseTest.java          |  17 +-
 .../tinkerpop/gremlin/driver/Channelizer.java   |   4 +-
 .../apache/tinkerpop/gremlin/driver/Client.java |   4 +-
 .../tinkerpop/gremlin/driver/Cluster.java       |   2 +-
 .../tinkerpop/gremlin/driver/Connection.java    |   2 +-
 .../gremlin/driver/ConnectionPool.java          |   2 +-
 .../tinkerpop/gremlin/driver/Handler.java       |   2 +-
 .../apache/tinkerpop/gremlin/driver/Host.java   |   2 +-
 .../apache/tinkerpop/gremlin/driver/Result.java |   2 +-
 .../tinkerpop/gremlin/driver/ResultQueue.java   |   2 +-
 .../tinkerpop/gremlin/driver/ResultSet.java     |   2 +-
 .../tinkerpop/gremlin/driver/Settings.java      |   2 +-
 .../apache/tinkerpop/gremlin/driver/Tokens.java |   7 +-
 .../handler/NioGremlinRequestEncoder.java       |   2 +-
 .../handler/NioGremlinResponseDecoder.java      |   2 +-
 .../driver/handler/WebSocketClientHandler.java  |   2 +-
 .../handler/WebSocketGremlinRequestEncoder.java |   2 +-
 .../WebSocketGremlinResponseDecoder.java        |   2 +-
 .../gremlin/driver/message/RequestMessage.java  |   2 +-
 .../gremlin/driver/message/ResponseMessage.java |   2 +-
 .../gremlin/driver/message/ResponseResult.java  |   2 +-
 .../gremlin/driver/message/ResponseStatus.java  |   2 +-
 .../driver/message/ResponseStatusCode.java      |  16 +-
 .../AbstractGraphSONMessageSerializerV1d0.java  |   6 +-
 .../GraphSONMessageSerializerGremlinV1d0.java   |   2 +-
 .../ser/GraphSONMessageSerializerV1d0.java      |   2 +-
 .../driver/ser/GryoMessageSerializerV1d0.java   |   2 +-
 .../driver/ser/JsonBuilderGryoSerializer.java   |   2 +-
 .../tinkerpop/gremlin/driver/ser/SerTokens.java |   4 +-
 .../gremlin/driver/ser/Serializers.java         |   2 +-
 .../traversal/step/filter/GroovyHasTest.groovy  |  10 +
 .../traversal/step/map/GroovyAddEdgeTest.groovy |  16 +-
 .../traversal/step/map/GroovySelectTest.groovy  |  10 +
 .../gremlin/groovy/loaders/StepLoader.groovy    |  12 ++
 .../process/traversal/step/filter/HasTest.java  |  41 +++-
 .../traversal/step/filter/WhereTest.java        |   2 +-
 .../process/traversal/step/map/AddEdgeTest.java |  76 ++++++-
 .../process/traversal/step/map/SelectTest.java  |  44 +++-
 .../ElementIdStrategyProcessTest.java           |   8 +-
 .../decoration/EventStrategyProcessTest.java    | 202 ++++++++++++++++---
 .../PartitionStrategyProcessTest.java           |  17 +-
 hadoop-gremlin/pom.xml                          |   8 -
 .../neo4j/groovy/plugin/Neo4jGremlinPlugin.java |   2 +
 .../gremlin/neo4j/process/traversal/LabelP.java |  59 ++++++
 .../step/sideEffect/CypherStartStep.java        |  12 +-
 .../gremlin/neo4j/structure/Neo4jElement.java   |  13 +-
 .../gremlin/neo4j/structure/Neo4jGraph.java     |   8 +-
 .../neo4j/structure/Neo4jVertexProperty.java    |  23 +++
 .../structure/trait/MultiMetaNeo4jTrait.java    | 104 ++++++----
 .../trait/NoMultiNoMetaNeo4jTrait.java          |  45 ++---
 .../neo4j/MultiMetaNeo4jGraphProvider.java      |   6 +-
 .../neo4j/NoMultiNoMetaNeo4jGraphProvider.java  |   6 +-
 .../neo4j/structure/NativeNeo4jIndexTest.java   |  77 ++++++-
 .../structure/NativeNeo4jStructureTest.java     |  64 +++++-
 94 files changed, 1519 insertions(+), 896 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/a806bee6/docs/src/implementations.asciidoc
----------------------------------------------------------------------
diff --cc docs/src/implementations.asciidoc
index 5cdc105,7d94a4f..b25cf82
--- a/docs/src/implementations.asciidoc
+++ b/docs/src/implementations.asciidoc
@@@ -608,41 -594,27 +608,43 @@@ Below demonstrates the runtime benefit
  [source,groovy]
  gremlin> graph = Neo4jGraph.open('/tmp/neo4j')
  ==>neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]]
- gremlin> graph.cypher("CREATE INDEX ON :artist(name)") <1>
+ gremlin> g = graph.traversal(standard())
+ ==>graphtraversalsource[neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]], standard]
+ gremlin> graph.io(graphml()).readGraph('data/grateful-dead.xml')
+ ==>null
  gremlin> graph.tx().commit()
  ==>null
- gremlin> graph.io(graphml()).readGraph('data/grateful-dead.xml')
+ gremlin> graph.cypher('CREATE INDEX ON :artist(name)') <1>
+ gremlin> graph.tx().commit()
  ==>null
- gremlin> g = graph.traversal(standard())
- ==>graphtraversalsource[neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]], standard]
- gremlin> clock(1000){g.V().hasLabel('artist').has('name','Garcia').next()}  <2>
- ==>0.0585639999999997
- gremlin> clock(1000){g.V().has('name','Garcia').next()} <3>
- ==>0.6039889999999992
- gremlin> graph.cypher("DROP INDEX ON :artist(name)") <4>
+ gremlin> clock(1000){g.V().hasLabel('artist').has('name','Garcia').iterate()}  <2>
+ ==>0.038828967
+ gremlin> clock(1000){g.V().has('name','Garcia').iterate()} <3>
+ ==>0.6623919649999999
+ gremlin> graph.cypher('DROP INDEX ON :artist(name)') <4>
  gremlin> g.tx().commit()
  ==>null
- gremlin> clock(1000){g.V().hasLabel('artist').has('name','Garcia').next()} <5>
- ==>0.26470499999999936
- gremlin> clock(1000){g.V().has('name','Garcia').next()} <6>
- ==>0.6293959999999993
+ gremlin> clock(1000){g.V().hasLabel('artist').has('name','Garcia').iterate()} <5>
+ ==>0.29597517599999995
+ gremlin> clock(1000){g.V().has('name','Garcia').iterate()} <6>
+ ==>0.6685323479999999
  
 +[gremlin-groovy]
 +----
 +graph = Neo4jGraph.open('/tmp/neo4j')
 +graph.cypher("CREATE INDEX ON :artist(name)") <1>
 +graph.tx().commit()
 +graph.io(graphml()).readGraph('data/grateful-dead.xml')
 +g = graph.traversal(standard())
 +clock(1000) {g.V().hasLabel('artist').has('name','Garcia').next()}  <2>
 +clock(1000) {g.V().has('name','Garcia').next()} <3>
 +graph.cypher("DROP INDEX ON :artist(name)") <4>
 +g.tx().commit()
 +clock(1000) {g.V().hasLabel('artist').has('name','Garcia').next()} <5>
 +clock(1000) {g.V().has('name','Garcia').next()} <6>
 +graph.close()
 +----
 +
  <1> Create an index for all artist vertices on their name property.
  <2> Find all artists whose name is Garcia which uses the pre-defined schema index.
  <3> Find all vertices whose name is Garcia which requires a linear scan of all the data in the graph.


[23/26] incubator-tinkerpop git commit: replaced static code blocks with dynamic code blocks

Posted by dk...@apache.org.
replaced static code blocks with dynamic code blocks


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

Branch: refs/heads/master
Commit: 4487087fffb09eabe473603729023d0ce0a3a69a
Parents: d804444
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Fri Jun 5 20:45:14 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Fri Jun 5 20:45:14 2015 +0200

----------------------------------------------------------------------
 docs/src/gremlin-applications.asciidoc | 111 +++++++++++-----------------
 docs/src/implementations.asciidoc      |  81 +++++---------------
 docs/src/the-graph.asciidoc            |  28 ++-----
 docs/src/the-traversal.asciidoc        |  14 ++--
 4 files changed, 76 insertions(+), 158 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4487087f/docs/src/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/gremlin-applications.asciidoc b/docs/src/gremlin-applications.asciidoc
index ea3742a..70b6113 100644
--- a/docs/src/gremlin-applications.asciidoc
+++ b/docs/src/gremlin-applications.asciidoc
@@ -123,29 +123,12 @@ In addition to the standard commands of the link:http://groovy.codehaus.org/Groo
 
 Gremlin Console adds a special `max-iteration` preference that can be configured with the standard `:set` command from the Groovy Shell.  Use this setting to control the maximum number of results that the Console will display. Consider the following usage:
 
-[source, groovy]
-----
-gremlin> :set max-iteration 10
-gremlin> (0..200)
-==>0
-==>1
-==>2
-==>3
-==>4
-==>5
-==>6
-==>7
-==>8
-==>9
-...
-gremlin> :set max-iteration 5
-gremlin> (0..200)
-==>0
-==>1
-==>2
-==>3
-==>4
-...
+[gremlin-groovy]
+----
+:set max-iteration 10
+(0..200)
+:set max-iteration 5
+(0..200)
 ----
 
 If this setting is not present, the console will default the maximum to 100 results.
@@ -276,60 +259,38 @@ gremlin>
 
 The console has the notion of a "remote", which represents a place a script will be sent from the console to be evaluated elsewhere in some other context (e.g. Gremlin Server, Hadoop, etc.).  To create a remote in the console, do the following:
 
-[source,groovy]
+[gremlin-groovy]
 ----
-gremlin> :remote connect tinkerpop.server conf/remote.yaml
-==>Connected - localhost/127.0.0.1:8182
+:remote connect tinkerpop.server conf/remote.yaml
 ----
 
 The `:remote` command shown above displays the current status of the remote connection.  This command can also be used to configure a new connection and change other related settings.  To actually send a script to the server a different command is required:
 
-[source,groovy]
+[gremlin-groovy]
 ----
-gremlin> :> g.V().values('name')
-==>marko
-==>vadas
-==>lop
-==>josh
-==>ripple
-==>peter
-gremlin> :> g.V().has('name','marko').out('created').values('name')
-==>lop
-gremlin> :> g.E().label().groupCount()
-==>{created=4, knows=2}
-gremlin> result
-==>result{object={created=4, knows=2} class=java.lang.String}
-gremlin> :remote close
-==>Removed - gremlin server - [localhost/127.0.0.1:8182]
+:> g.V().values('name')
+:> g.V().has('name','marko').out('created').values('name')
+:> g.E().label().groupCount()
+result
+:remote close
 ----
 
 The `:>` command, which is a shorthand for `:submit`, sends the script to the server to execute there.  Results are wrapped in an `Result` object which is a just a holder for each individual result.  The `class` shows the data type for the containing value.  Note that the last script sent was supposed to return a `Map`, but its `class` is `java.lang.String`.  By default, the connection is configured to only return text results.  In other words, Gremlin Server is using `toString` to serialize all results back to the console.  This enables virtually any object on the server to be returned to the console, but it doesn't allow the opportunity to work with this data in any way in the console itself.  A different configuration of the `:remote` is required to get the results back as "objects":
 
-[source,groovy]
+[gremlin-groovy]
 ----
-gremlin> :remote connect tinkerpop.server conf/remote-objects.yaml <1>
-==>connected - localhost/127.0.0.1:8182
-gremlin> :remote list <2>
-==>0 - Gremlin Server - [localhost/127.0.0.1:8182]
-==>*1 - Gremlin Server - [localhost/127.0.0.1:8182]
-gremlin> :> g.E().label().groupCount() <3>
-==>[created:4, knows:2]
-gremlin> m = result[0].object <4>
-==>created=4
-==>knows=2
-gremlin> m.sort{it.value}
-==>knows=2
-==>created=4
-gremlin> script = """
-                  matthias = graph.addVertex('name','matthias')
-                  matthias.addEdge('co-creator',g.V().has('name','marko').next())
-                  """
-gremlin> :> @script   <5>
-==>e[14][12-co-creator->1]
-gremlin> :> g.V().has('name','matthias').out('co-creator').values('name')
-==>marko
-gremlin> :remote close
-==>Removed - gremlin server - [localhost/127.0.0.1:8182]
+:remote connect tinkerpop.server conf/remote-objects.yaml <1>
+:remote list <2>
+:> g.E().label().groupCount() <3>
+m = result[0].object <4>
+m.sort {it.value}
+script = """
+         matthias = graph.addVertex('name','matthias')
+         matthias.addEdge('co-creator',g.V().has('name','marko').next())
+         """
+:> @script   <5>
+:> g.V().has('name','matthias').out('co-creator').values('name')
+:remote close
 ----
 
 <1> This configuration file specifies that results should be deserialized back into an `Object` in the console with the caveat being that the server and console both know how to serialize and deserialize the result to be returned.
@@ -960,8 +921,10 @@ image:gremlin-sugar.png[width=120,float=left] In previous versions of Gremlin-Gr
 IMPORTANT: It is important that the sugar plugin is loaded in a Gremlin Console session prior to any manipulations of the respective TinkerPop3 objects as Groovy will cache unavailable methods and properties.
 
 [source,groovy]
+----
 gremlin> :plugin use tinkerpop.sugar
 ==>tinkerpop.sugar activated
+----
 
 Graph Traversal Methods
 ^^^^^^^^^^^^^^^^^^^^^^^
@@ -969,6 +932,7 @@ Graph Traversal Methods
 If a `GraphTraversal` property is unknown and there is a corresponding method with said name off of `GraphTraversal` then the property is assumed to be a method call. This enables the user to omit `( )` from the method name. However, if the property does not reference a `GraphTraversal` method, then it is assumed to be a call to `values(property)`.
 
 [source,groovy]
+----
 gremlin> g.V ////<1>
 ==>v[1]
 ==>v[2]
@@ -990,6 +954,7 @@ gremlin> g.V.outE.weight ////<3>
 ==>1.0
 ==>0.4
 ==>0.2
+----
 
 <1> There is no need for the parentheses in `g.V()`.
 <2> The traversal is interpreted as `g.V().values('name')`.
@@ -1001,6 +966,7 @@ Range Queries
 The `[x]` and `[x..y]` range operators in Groovy translate to `RangeStep` calls.
 
 [source,groovy]
+----
 gremlin> g.V[0..2]
 ==>v[1]
 ==>v[2]
@@ -1008,6 +974,7 @@ gremlin> g.V[0..<2]
 ==>v[1]
 gremlin> g.V[2]
 ==>v[3]
+----
 
 Logical Operators
 ^^^^^^^^^^^^^^^^^
@@ -1015,6 +982,7 @@ Logical Operators
 The `&` and `|` operator are overloaded in `SugarGremlinPlugin`. When used, they introduce the `AndStep.AndMarker` and `OrStep.OrStep` markers into the traversal. See <<and-step,`and()`>> and <<or-step,`or()`>> for more information.
 
 [source,groovy]
+----
 gremlin> g.V.has(outE('knows') & outE('created')).name ////<1>
 ==>marko
 gremlin> t = g.V.has(outE('knows') | inE('created')).name; null ////<2>
@@ -1027,6 +995,7 @@ gremlin> t
 ==>ripple
 gremlin> t.toString()
 ==>[TinkerGraphStep(vertex), HasTraversalStep([OrStep([[VertexStep(OUT,[knows],edge)], [VertexStep(IN,[created],edge)]])]), PropertiesStep([name],value)]
+----
 
 <1> Introducing the `AndStep` with the `&` operator.
 <2> Introducing the `OrStep` with the `|` operator.
@@ -1037,11 +1006,12 @@ Comparators
 Unfortunately, Groovy does not support comparator overloading -- `>`, `<=`, `==`, etc. However, the `Compare` enums are available as methods in `SugarGremlinPlugin`.
 
 [source,groovy]
-gremlin> g.V.has(outE('created').count.gt(1) | __.age.lt(30)).name ////<1>
+----
+gremlin> g.V.has(outE('created').count.gt(1l) | __.age.lt(30)).name ////<1>
 ==>marko
 ==>vadas
 ==>josh
-gremlin> t = g.V.has(outE('created').count.gt(1) | __.age.lt(30) & outE('knows')).name; null ////<2>
+gremlin> t = g.V.has(outE('created').count.gt(1l) | __.age.lt(30) & outE('knows')).name; null ////<2>
 ==>null
 gremlin> t.toString()
 ==>[GraphStep(vertex), HasTraversalStep([VertexStep(OUT,[created],edge), CountStep, IsStep(gt,1), OrMarker, PropertiesStep([age],value), IsStep(lt,30), AndMarker, VertexStep(OUT,[knows],edge)]), PropertiesStep([name],value)]
@@ -1050,6 +1020,7 @@ gremlin> t
 ==>josh
 gremlin> t.toString()
 ==>[TinkerGraphStep(vertex), HasTraversalStep([OrStep([[VertexStep(OUT,[created],edge), CountStep, IsStep(gt,1)], [AndStep([[PropertiesStep([age],value), IsStep(lt,30)], [VertexStep(OUT,[knows],edge)]])]])]), PropertiesStep([name],value)]
+----
 
 <1> Using `gt(x)` in place of `is(gt,x)`.
 <2> A complex and/or chain with `IsStep` substitutions.
@@ -1060,6 +1031,9 @@ Traverser Methods
 It is rare that a user will ever interact with a `Traverser` directly. However, if they do, some method redirects exist to make it easy.
 
 [source,groovy]
+----
+
+
 gremlin> g.V().map{it.get().value('name')}  // conventional
 ==>marko
 ==>vadas
@@ -1074,6 +1048,7 @@ gremlin> g.V.map{it.name}  // sugar
 ==>josh
 ==>ripple
 ==>peter
+----
 
 [[utilities-plugin]]
 Utilities Plugin

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4487087f/docs/src/implementations.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/implementations.asciidoc b/docs/src/implementations.asciidoc
index 37f53ae..3c624e4 100644
--- a/docs/src/implementations.asciidoc
+++ b/docs/src/implementations.asciidoc
@@ -827,33 +827,16 @@ g.V().out().out().values('name')
 
 IMPORTANT: The examples above do not use lambdas (i.e. closures in Gremlin-Groovy). This makes the traversal serializable and thus, able to be distributed to all machines in the Hadoop cluster. If a lambda is required in a traversal, then the traversal must be sent as a `String` and compiled locally at each machine in the cluster. The following example demonstrates the `:remote` command which allows for submitting Gremlin traversals as a `String`.
 
-[source,text]
-gremlin> graph = GraphFactory.open('../../../hadoop-gremlin/conf/hadoop-gryo.properties')
-==>hadoopgraph[gryoinputformat->gryooutputformat]
-gremlin> :remote connect tinkerpop.hadoop graph
-==>useTraversalSource=graphtraversalsource[hadoopgraph[gryoinputformat->gryooutputformat], giraphgraphcomputer]
-==>useSugar=false
-gremlin> :> g.V().group().by{it.value('name')[1]}.by('name')
-INFO  org.apache.tinkerpop.gremlin.hadoop.process.computer.giraph.GiraphGraphComputer  - HadoopGremlin(Giraph): TraversalVertexProgram[GraphStep(vertex), GroupStep(lambda,value(name)), ComputerResultStep]
-INFO  org.apache.hadoop.mapred.JobClient  - Running job: job_201407281259_0039
-INFO  org.apache.hadoop.mapred.JobClient  -  map 0% reduce 0%
-...
-INFO  org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph  - HadoopGremlin: GroupMapReduce[~reducing]
-INFO  org.apache.hadoop.mapred.JobClient  - Running job: job_201407281259_0040
-INFO  org.apache.hadoop.mapred.JobClient  -  map 0% reduce 0%
-...
-==>[a:[marko, vadas], e:[peter], i:[ripple], o:[lop, josh]]
-gremlin> result
-==>result[hadoopgraph[gryoinputformat->gryooutputformat],memory[size:1]]
-gremlin> result.memory.runtime
-==>20356
-gremlin> result.memory.keys()
-==>~reducing
-gremlin> result.memory.get('~reducing')
-==>a={marko=1, vadas=1}
-==>e={peter=1}
-==>i={ripple=1}
-==>o={lop=1, josh=1}
+[gremlin-groovy]
+----
+graph = GraphFactory.open('conf/hadoop/hadoop-gryo.properties')
+:remote connect tinkerpop.hadoop graph
+:> g.V().group().by{it.value('name')[1]}.by('name')
+result
+result.memory.runtime
+result.memory.keys()
+result.memory.get('~reducing')
+----
 
 [[sparkgraphcomputer]]
 SparkGraphComputer
@@ -871,17 +854,6 @@ g.V().out().out().values('name')
 
 For using lambdas in Gremlin-Groovy, simply provide `:remote connect` a `TraversalSource` which leverages SparkGraphComputer.
 
-[source,test]
-gremlin> graph = GraphFactory.open('../../../hadoop-gremlin/conf/hadoop-gryo.properties')
-==>hadoopgraph[gryoinputformat->gryooutputformat]
-gremlin> g = graph.traversal(computer(SparkGraphComputer))
-==>graphtraversalsource[hadoopgraph[gryoinputformat->gryooutputformat], sparkgraphcomputer]
-gremlin> :remote connect tinkerpop.hadoop graph g
-==>useTraversalSource=graphtraversalsource[hadoopgraph[gryoinputformat->gryooutputformat], sparkgraphcomputer]
-==>useSugar=false
-gremlin> :> g.V().group().by{it.value('name')[1]}.by('name')
-==>[a:[marko, vadas], e:[peter], i:[ripple], o:[lop, josh]]
-
 [gremlin-groovy]
 ----
 graph = GraphFactory.open('conf/hadoop/hadoop-gryo.properties')
@@ -1026,29 +998,16 @@ Interacting with HDFS
 
 The distributed file system of Hadoop is called link:http://en.wikipedia.org/wiki/Apache_Hadoop#Hadoop_distributed_file_system[HDFS]. The results of any OLAP operation are stored in HDFS accessible via `hdfs`.
 
-[source,text]
-gremlin> :remote connect tinkerpop.hadoop ../../../hadoop-gremlin/conf/hadoop-gryo.properties
-==>hadoopgraph[gryoinputformat->gryooutputformat]
-gremlin> :> g.V().group().by{it.value('name')[1]}.by('name')
-...
-==>[a:[marko, vadas], e:[peter], i:[ripple], o:[lop, josh]]
-gremlin> hdfs.ls()
-==>rwxr-xr-x marko supergroup 0 (D) output
-==>rw-r--r-- marko supergroup 1439 tinkerpop-modern-vertices.kryo
-gremlin> hdfs.ls('output')
-==>rwxr-xr-x marko supergroup 0 (D) a
-gremlin> hdfs.ls('output/a')
-==>rw-r--r-- marko supergroup 0 _SUCCESS
-==>rwxr-xr-x marko supergroup 0 (D) _logs
-==>rw-r--r-- marko supergroup 140 part-r-00000
-==>rw-r--r-- marko supergroup 1109 part-r-00001
-==>rw-r--r-- marko supergroup 140 part-r-00002
-==>rw-r--r-- marko supergroup 468 part-r-00003
-gremlin> hdfs.head('output/a',ObjectWritable.class)
-==>a	{marko=1, vadas=1}
-==>e	{peter=1}
-==>i	{ripple=1}
-==>o	{lop=1, josh=1}
+[gremlin-groovy]
+----
+graph = GraphFactory.open('conf/hadoop/hadoop-gryo.properties')
+:remote connect tinkerpop.hadoop graph
+:> g.V().group().by{it.value('name')[1]}.by('name')
+hdfs.ls()
+hdfs.ls('output')
+hdfs.ls('output/a')
+hdfs.head('output/a',ObjectWritable.class)
+----
 
 A list of the HDFS methods available are itemized below. Note that these methods are also available for the 'local' variable:
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4487087f/docs/src/the-graph.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/the-graph.asciidoc b/docs/src/the-graph.asciidoc
index a7e86d2..8c5cbc9 100644
--- a/docs/src/the-graph.asciidoc
+++ b/docs/src/the-graph.asciidoc
@@ -30,22 +30,10 @@ A `Feature` implementation describes the capabilities of a `Graph` instance. Thi
 
 The following example in the Gremlin Console shows how to print all the features of a `Graph`:
 
-[source,groovy]
+[gremlin-groovy]
 ----
-gremlin> graph = TinkerGraph.open()
-==>tinkergraph[vertices:0 edges:0]
-gremlin> graph.features()
-==>FEATURES
-> GraphFeatures
->-- Persistence: false
->-- ThreadedTransactions: false
->-- Computer: true
->-- Transactions: false
-> VariableFeatures
->-- Variables: true
->-- IntegerArrayValues: true
->-- BooleanValues: true
-...
+graph = TinkerGraph.open()
+graph.features()
 ----
 
 A common pattern for using features is to check their support prior to performing an operation:
@@ -227,12 +215,12 @@ gremlin> graph.tx().commit()
 
 The `Transaction` object also exposes a method for executing automatic transaction retries:
 
-[source,groovy]
+[gremlin-groovy]
 ----
-gremlin> graph.tx().submit {it.addVertex("name","josh")}.retry(10)
-==>v[2]
-gremlin> graph.tx().submit {it.addVertex("name","daniel")}.exponentialBackoff(10)
-==>v[3]
+graph = Neo4jGraph.open('/tmp/neo4j')
+graph.tx().submit {it.addVertex("name","josh")}.retry(10)
+graph.tx().submit {it.addVertex("name","daniel")}.exponentialBackoff(10)
+graph.close()
 ----
 
 As shown above, the `submit` method takes a `Function<Graph, R>` which is the unit of work to execute and possibly retry on failure.  The method returns a `Transaction.Workload` object which has a number of default methods for common retry strategies.  It is also possible to supply a custom retry function if a default one does not suit the required purpose.

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4487087f/docs/src/the-traversal.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/the-traversal.asciidoc b/docs/src/the-traversal.asciidoc
index 2ec129d..ca573a9 100644
--- a/docs/src/the-traversal.asciidoc
+++ b/docs/src/the-traversal.asciidoc
@@ -1676,16 +1676,12 @@ g.V('42a')
 
 Other `Graph` implementations, such as Neo4j, generate element identifiers automatically and cannot be assigned.  As a helper, `ElementIdStrategy` can be used to make identifier assignment possible by using vertex and edge indicies under the hood.
 
-[source,groovy]
+[gremlin-groovy]
 ----
-gremlin> graph = Neo4jGraph.open('/tmp/neo4j')
-==>neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]]
-gremlin> strategy = ElementIdStrategy.build().create()
-==>ElementIdStrategy
-gremlin> g = GraphTraversalSource.build().with(strategy).create(graph)
-==>graphtraversalsource[neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]], standard]
-gremlin> g.addV(id, '42a').id()
-==>42a
+graph = Neo4jGraph.open('/tmp/neo4j')
+strategy = ElementIdStrategy.build().create()
+g = GraphTraversalSource.build().with(strategy).create(graph)
+g.addV(id, '42a').id()
 ----
 
 IMPORTANT: The key that is used to store the assigned identifier should be indexed in the underlying graph database. If it is not indexed, then lookups for the elements that use these identifiers will perform a linear scan.


[25/26] incubator-tinkerpop git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-tinkerpop

Posted by dk...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-tinkerpop


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

Branch: refs/heads/master
Commit: 1eeaaa7e72cd0637abd2e851f1c67be03aa1c4dc
Parents: 056e875 2b47438
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Fri Jun 5 21:07:11 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Fri Jun 5 21:07:11 2015 +0200

----------------------------------------------------------------------
 .../finalization/LazyBarrierStrategy.java       | 74 ++++++++++++++++++++
 .../step/sideEffect/CypherStartStep.java        |  7 ++
 2 files changed, 81 insertions(+)
----------------------------------------------------------------------



[24/26] incubator-tinkerpop git commit: Merge branch 'master' into preprocessor

Posted by dk...@apache.org.
Merge branch 'master' into preprocessor


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

Branch: refs/heads/master
Commit: 056e875227c445e3f90d78cb46c0ba92349dc44c
Parents: 4487087 a7966d1
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Fri Jun 5 20:45:48 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Fri Jun 5 20:45:48 2015 +0200

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   7 +
 README.asciidoc                                 |  21 +-
 docs/src/gremlin-applications.asciidoc          |  21 +-
 .../traversal/dsl/graph/GraphTraversal.java     |  18 +-
 .../gremlin/process/traversal/dsl/graph/__.java |   4 +
 .../gremlin/process/traversal/step/Scoping.java |  22 ++-
 .../traversal/step/filter/WhereStep.java        |  19 +-
 .../process/traversal/step/map/AddEdgeStep.java |  11 ++
 .../traversal/step/map/RangeLocalStep.java      |  79 +++++---
 .../traversal/step/map/SelectOneStep.java       |   9 +-
 .../process/traversal/step/map/SelectStep.java  |  10 +-
 .../traversal/step/map/TailLocalStep.java       |  15 +-
 .../traversal/step/map/match/MatchStep.java     |  15 +-
 .../step/util/CollectingBarrierStep.java        |  22 ++-
 .../traversal/step/util/NoOpBarrierStep.java    |   4 +
 .../strategy/finalization/ScopingStrategy.java  |  15 +-
 .../process/traversal/util/TraversalHelper.java |  23 ++-
 .../apache/tinkerpop/gremlin/util/TimeUtil.java |  16 ++
 gremlin-driver/pom.xml                          |   2 +-
 .../tinkerpop/gremlin/driver/Channelizer.java   |  18 +-
 .../tinkerpop/gremlin/driver/Settings.java      |   1 +
 .../step/filter/GroovyRangeTest.groovy          |  47 ++++-
 .../gremlin/server/AbstractChannelizer.java     | 107 +++++-----
 .../tinkerpop/gremlin/server/Channelizer.java   |  11 +-
 .../tinkerpop/gremlin/server/GremlinServer.java | 117 ++++-------
 .../tinkerpop/gremlin/server/Settings.java      |  52 +++--
 .../gremlin/server/channel/HttpChannelizer.java |  17 +-
 .../gremlin/server/channel/NioChannelizer.java  |  14 +-
 .../server/channel/WebSocketChannelizer.java    |  14 +-
 .../server/util/ServerGremlinExecutor.java      | 167 ++++++++++++++++
 .../gremlin/server/util/ThreadFactoryUtil.java  |  35 ++++
 .../tinkerpop/gremlin/server/GraphsTest.java    |   7 +-
 .../server/GremlinServerIntegrateTest.java      |  17 ++
 .../traversal/step/filter/RangeTest.java        | 195 ++++++++++++++++++-
 34 files changed, 869 insertions(+), 283 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/056e8752/docs/src/gremlin-applications.asciidoc
----------------------------------------------------------------------


[12/26] incubator-tinkerpop git commit: Merge branch 'master' into preprocessor

Posted by dk...@apache.org.
Merge branch 'master' into preprocessor


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

Branch: refs/heads/master
Commit: 774100e2de0e6f42e197912935071ed9f2a54b62
Parents: 38a0733 4a0bf78
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Mon Jun 1 22:27:41 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Mon Jun 1 22:27:41 2015 +0200

----------------------------------------------------------------------
 .../peerpressure/ClusterCountMapReduce.java     |  2 +-
 .../ClusterPopulationMapReduce.java             |  2 +-
 .../peerpressure/PeerPressureVertexProgram.java |  2 +-
 .../ranking/pagerank/PageRankMapReduce.java     |  2 +-
 .../ranking/pagerank/PageRankVertexProgram.java |  2 +-
 .../traversal/TraversalVertexProgram.java       |  4 +-
 .../dsl/graph/GraphTraversalSource.java         |  2 +-
 .../engine/ComputerTraversalEngine.java         |  2 +-
 .../engine/StandardTraversalEngine.java         |  2 +-
 .../strategy/decoration/ElementIdStrategy.java  |  2 +-
 .../strategy/decoration/EventStrategy.java      |  2 +-
 .../strategy/decoration/PartitionStrategy.java  |  2 +-
 .../strategy/decoration/SubgraphStrategy.java   |  2 +-
 .../tinkerpop/gremlin/structure/Vertex.java     | 25 ++++---
 .../gremlin/structure/io/GraphMigrator.java     |  3 +
 .../tinkerpop/gremlin/structure/io/IoCore.java  |  3 +
 .../gremlin/structure/io/graphml/GraphMLIo.java |  6 +-
 .../structure/io/graphml/GraphMLMapper.java     |  6 +-
 .../structure/io/graphml/GraphMLReader.java     |  2 +-
 .../structure/io/graphml/GraphMLTokens.java     |  4 +-
 .../structure/io/graphml/GraphMLWriter.java     |  2 +-
 .../io/graphml/GraphMLWriterHelper.java         |  7 +-
 .../structure/io/graphson/GraphSONIo.java       |  6 +-
 .../structure/io/graphson/GraphSONModule.java   |  2 +-
 .../structure/io/graphson/GraphSONReader.java   |  9 ++-
 .../io/graphson/GraphSONSerializers.java        | 14 ++--
 .../structure/io/graphson/GraphSONVersion.java  |  2 +-
 .../structure/io/graphson/GraphSONWriter.java   |  2 +-
 .../io/graphson/LegacyGraphSONReader.java       | 73 ++++++++++----------
 .../structure/io/gryo/EntrySerializer.java      |  2 +-
 .../gremlin/structure/io/gryo/GryoIo.java       |  6 +-
 .../gremlin/structure/io/gryo/GryoMapper.java   |  2 +-
 .../gremlin/structure/io/gryo/GryoPool.java     |  2 +-
 .../gremlin/structure/io/gryo/GryoReader.java   |  4 +-
 .../structure/io/gryo/GryoSerializers.java      | 12 ++--
 .../gremlin/structure/io/gryo/GryoWriter.java   |  4 +-
 .../structure/io/gryo/URISerializer.java        |  2 +-
 .../structure/io/gryo/UUIDSerializer.java       |  2 +-
 .../io/gryo/VertexByteArrayInputStream.java     |  2 +-
 .../structure/io/gryo/VertexTerminator.java     |  2 +-
 .../gremlin/structure/io/GraphMigratorTest.java | 32 +++++++++
 .../gremlin/structure/io/IoCoreTest.java        | 53 ++++++++++++++
 .../tinkerpop/gremlin/driver/Cluster.java       |  2 +-
 .../gremlin/driver/message/ResponseMessage.java |  2 +-
 .../gremlin/groovy/engine/GremlinExecutor.java  |  2 +-
 .../algorithm/generator/CommunityGenerator.java |  2 +-
 .../generator/DistributionGenerator.java        |  2 +-
 47 files changed, 216 insertions(+), 113 deletions(-)
----------------------------------------------------------------------



[21/26] incubator-tinkerpop git commit: added support for multi-line strings in code samples

Posted by dk...@apache.org.
added support for multi-line strings in code samples


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

Branch: refs/heads/master
Commit: ec4e41c19aa9d20987832f3dc8c34ce85ba5287b
Parents: cea1732
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Fri Jun 5 16:40:42 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Fri Jun 5 16:40:42 2015 +0200

----------------------------------------------------------------------
 docs/preprocessor/processor.groovy | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/ec4e41c1/docs/preprocessor/processor.groovy
----------------------------------------------------------------------
diff --git a/docs/preprocessor/processor.groovy b/docs/preprocessor/processor.groovy
index 3c3b3b6..00d41d2 100644
--- a/docs/preprocessor/processor.groovy
+++ b/docs/preprocessor/processor.groovy
@@ -83,14 +83,21 @@ new File(this.args[0]).withReader { reader ->
                     def sanitizedLine = sanitize(line)
                     script.append(sanitizedLine)
                     println stringify(STATEMENT_PREFIX + format(line), lineNumber)
-                    if (!sanitizedLine.isEmpty() && sanitizedLine[-1] in STATEMENT_CONTINUATION_CHARACTERS) {
-                        while (true) {
+                    if (!sanitizedLine.isEmpty() && (sanitizedLine[-1] in STATEMENT_CONTINUATION_CHARACTERS || line.split('"""', -1).size() % 2 == 0)) {
+                        def inMultiLineString = line.split('"""', -1).size() % 2 == 0
+                        def run = true
+                        while (run) {
                             line = reader.readLine()
-                            if (!line.startsWith(" ") && !line.startsWith("}") && !line.startsWith(")") || line.equals(BLOCK_DELIMITER)) {
+                            if (inMultiLineString) {
+                                if (line.split('"""', -1).size() % 2 == 0) {
+                                    run = false
+                                }
+                            } else if (!line.startsWith(" ") && !line.startsWith("}") && !line.startsWith(")") || line.equals(BLOCK_DELIMITER)) {
                                 skipNextRead = true
                                 break
                             }
                             sanitizedLine = sanitize(line)
+                            if (inMultiLineString) script.append("\n")
                             script.append(sanitizedLine)
                             println stringify(STATEMENT_CONTINUATION_PREFIX + format(line), lineNumber)
                         }
@@ -121,6 +128,7 @@ new File(this.args[0]).withReader { reader ->
                     println "marko = g.V().has(\"name\", \"marko\").tryNext().orElse(null)"
                     println "f = new File('/tmp/neo4j')"
                     println "if (f.exists()) f.deleteDir()"
+                    println ":set max-iteration 100"
                     println stringify("IGNORE")
                     reader.readLine()
                     inCodeSection = true


[10/26] incubator-tinkerpop git commit: removed unnecessary code

Posted by dk...@apache.org.
removed unnecessary code


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

Branch: refs/heads/master
Commit: bb7d24936d430dee6c6153dccd7880f515a16db7
Parents: 130d945
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Mon Jun 1 19:38:19 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Mon Jun 1 19:38:19 2015 +0200

----------------------------------------------------------------------
 docs/preprocessor/processor.groovy | 4 ----
 1 file changed, 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb7d2493/docs/preprocessor/processor.groovy
----------------------------------------------------------------------
diff --git a/docs/preprocessor/processor.groovy b/docs/preprocessor/processor.groovy
index 37b88ab..d4831d6 100644
--- a/docs/preprocessor/processor.groovy
+++ b/docs/preprocessor/processor.groovy
@@ -54,7 +54,6 @@ stringify = { def string ->
     "\"¶" + string.replaceAll("\\\\", "\\\\\\\\").replaceAll(/"/, "\\\\\"").replaceAll(/\$/, "\\\\\\\$") + "\""
 }
 
-//println "try {"
 println stringify("START")
 
 new File(this.args[0]).withReader { reader ->
@@ -149,6 +148,3 @@ new File(this.args[0]).withReader { reader ->
 }
 
 println "System.exit(0)"
-//println "} catch (Exception e) {"
-//println "  System.exit(1)"
-//println "}"


[02/26] incubator-tinkerpop git commit: process AsciiDoc files in parallel

Posted by dk...@apache.org.
process AsciiDoc files in parallel


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

Branch: refs/heads/master
Commit: 1faaaf3ffccc9f57a46a8e53befae421fd55298f
Parents: f3c056f
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Fri May 29 17:57:17 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Fri May 29 17:57:17 2015 +0200

----------------------------------------------------------------------
 docs/preprocessor/preprocess-file.sh | 45 +++++++++++++++++
 docs/preprocessor/preprocess.sh      | 81 +++++++++++++++----------------
 2 files changed, 85 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1faaaf3f/docs/preprocessor/preprocess-file.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/preprocess-file.sh b/docs/preprocessor/preprocess-file.sh
new file mode 100755
index 0000000..eb305bf
--- /dev/null
+++ b/docs/preprocessor/preprocess-file.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+#
+#
+# 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.
+#
+
+TP_HOME=`pwd`
+CONSOLE_HOME=`readlink -f ${TP_HOME}/gremlin-console/target/apache-gremlin-console-*-standalone`
+
+input=$1
+name=`basename ${input}`
+output="${TP_HOME}/target/postprocess-asciidoc/${name}"
+
+echo "${input} > ${output}"
+
+if [ $(grep -c '^\[gremlin' ${input}) -gt 0 ]; then
+  pushd "${CONSOLE_HOME}" > /dev/null
+  bin/gremlin.sh -e ${TP_HOME}/docs/preprocessor/processor.groovy ${input} > ${input}.groovy
+  ec=${PIPESTATUS[0]}
+  if [ ${ec} -eq 0 ]; then
+    HADOOP_GREMLIN_LIBS="${CONSOLE_HOME}/ext/hadoop-gremlin/lib" bin/gremlin.sh ${input}.groovy | awk 'BEGIN {b=1} /\1IGNORE/ {b=!b} !/\1IGNORE/ {if(a&&b)print} /\1START/ {a=1}' | grep -v '^WARN ' | sed 's/^==>\x01//' > ${output}
+    ec=${PIPESTATUS[0]}
+    rm -f ${input}.groovy
+  fi
+  rm -f ${input}.groovy
+  popd > /dev/null
+  exit ${ec}
+else
+  cp ${input} ${output}
+fi

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1faaaf3f/docs/preprocessor/preprocess.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/preprocess.sh b/docs/preprocessor/preprocess.sh
index 506f177..76b5aec 100755
--- a/docs/preprocessor/preprocess.sh
+++ b/docs/preprocessor/preprocess.sh
@@ -28,63 +28,62 @@ if [ ! -f bin/gremlin.sh ]; then
 fi
 
 mkdir -p target/postprocess-asciidoc
-
 rm -rf target/postprocess-asciidoc/*
 mkdir target/postprocess-asciidoc/tmp
 cp -R docs/{static,stylesheets} target/postprocess-asciidoc/
 
 TP_HOME=`pwd`
 CONSOLE_HOME=`readlink -f ${TP_HOME}/gremlin-console/target/apache-gremlin-console-*-standalone`
+PLUGIN_DIR="${CONSOLE_HOME}/ext"
 TP_VERSION=$(cat pom.xml | grep -A1 '<artifactId>tinkerpop</artifactId>' | grep -Po '(?<=<version>).*(?=</version>)')
 
 # install Hadoop plugin
 hadoopPlugin=$(find . -name "HadoopGremlinPlugin.java")
-hadoopPluginName=`echo $hadoopPlugin | cut -d '/' -f2`
-hadoopPluginClass=`echo $hadoopPlugin | grep -Po '(?<=src/main/java/).*(?=\.java)' | tr '/' '.'`
-match=`grep -c "$hadoopPluginClass" ${CONSOLE_HOME}/ext/plugins.txt`
-if [ ! -z "${hadoopPluginName}" -a ! -d "${CONSOLE_HOME}/ext/${hadoopPluginName}" -a $match -eq 0 ]; then
+hadoopPluginName=`echo ${hadoopPlugin} | cut -d '/' -f2`
+hadoopPluginClass=`echo ${hadoopPlugin} | grep -Po '(?<=src/main/java/).*(?=\.java)' | tr '/' '.'`
+hadoopPluginDirectory="${PLUGIN_DIR}/${hadoopPluginName}"
+match=`grep -c "$hadoopPluginClass" ${PLUGIN_DIR}/plugins.txt`
+
+trap cleanup INT
+
+function cleanup() {
+  # remove Hadoop plugin if it wasn't installed prior pre-processing
+  if [ "${rmHadoopPlugin}" == "1" ]; then
+    rm -rf "${PLUGIN_DIR}/${hadoopPluginName}"
+    sed -e "/${hadoopPluginClass}/d" "${PLUGIN_DIR}/plugins.txt" > "${PLUGIN_DIR}/plugins.txt."
+    mv "${PLUGIN_DIR}/plugins.txt." "${PLUGIN_DIR}/plugins.txt"
+  fi
+  find "${TP_HOME}/docs/src/" -name "*.asciidoc.groovy" | xargs rm -f
+}
+
+if [ ! -z "${hadoopPluginName}" -a ! -d "${hadoopPluginDirectory}" -a ${match} -eq 0 ]; then
   rmHadoopPlugin=1
-  echo -e "\n${hadoopPluginClass}" >> "${CONSOLE_HOME}/ext/plugins.txt"
-  mkdir -p "${CONSOLE_HOME}/ext/${hadoopPluginName}/"{lib,plugin}
-  cp ${hadoopPluginName}/target/*${TP_VERSION}.jar "${CONSOLE_HOME}/ext/${hadoopPluginName}/lib"
-  cp ${hadoopPluginName}/target/*${TP_VERSION}.jar "${CONSOLE_HOME}/ext/${hadoopPluginName}/plugin"
+  echo -e "\n${hadoopPluginClass}" >> "${PLUGIN_DIR}/plugins.txt"
+  mkdir -p "${PLUGIN_DIR}/${hadoopPluginName}/"{lib,plugin}
+  #cp ${hadoopPluginName}/target/*${TP_VERSION}.jar "${PLUGIN_DIR}/${hadoopPluginName}/lib"
+  cp ${hadoopPluginName}/target/*${TP_VERSION}.jar "${PLUGIN_DIR}/${hadoopPluginName}/plugin"
   libdir=`readlink -f ${hadoopPluginName}/target/*-standalone/lib/`
   if [ -d "${libdir}" ]; then
-    cp ${libdir}/*.jar "${CONSOLE_HOME}/ext/${hadoopPluginName}/lib"
-    cp ${libdir}/*.jar "${CONSOLE_HOME}/ext/${hadoopPluginName}/plugin"
+    #cp ${libdir}/*.jar "${PLUGIN_DIR}/${hadoopPluginName}/lib"
+    cp ${libdir}/*.jar "${PLUGIN_DIR}/${hadoopPluginName}/plugin"
   fi
-  rm -f "${CONSOLE_HOME}/ext/hadoop-gremlin"/*/slf4j-*.jar
+  cp */target/*${TP_VERSION}.jar "${PLUGIN_DIR}/${hadoopPluginName}/lib"
+  for libdir in $(find . -name lib | grep -v ext); do
+    cp ${libdir}/*.jar "${PLUGIN_DIR}/${hadoopPluginName}/lib"
+  done
+  #rm -f "${PLUGIN_DIR}/hadoop-gremlin"/*/slf4j-*.jar
+  rm -f "${PLUGIN_DIR}/hadoop-gremlin"/plugin/slf4j-*.jar
+  echo "System.exit(0)" > "${PLUGIN_DIR}/${hadoopPluginName}/init.groovy"
+  ${CONSOLE_HOME}/bin/gremlin.sh "${PLUGIN_DIR}/${hadoopPluginName}/init.groovy" > /dev/null 2> /dev/null
 fi
 
-for input in $(find "${TP_HOME}/docs/src/" -name "*.asciidoc")
-do
-  name=`basename $input`
-  output="${TP_HOME}/target/postprocess-asciidoc/${name}"
-  echo "${input} > ${output}"
-  if [ $(grep -c '^\[gremlin' $input) -gt 0 ]; then
-    pushd "${CONSOLE_HOME}" > /dev/null
-    bin/gremlin.sh -e ${TP_HOME}/docs/preprocessor/processor.groovy $input > $input.groovy
-    ec=${PIPESTATUS[0]}
-    if [ $ec -eq 0 ]; then
-      HADOOP_GREMLIN_LIBS=`pwd`/ext/hadoop-gremlin/lib bin/gremlin.sh $input.groovy | awk 'BEGIN {b=1} /\1IGNORE/ {b=!b} !/\1IGNORE/ {if(a&&b)print} /\1START/ {a=1}' | grep -v '^WARN ' | sed 's/^==>\x01//' > $output
-      ec=${PIPESTATUS[0]}
-      rm -f $input.groovy
-      popd > /dev/null
-    fi
-    rm -f $input.groovy
-    if [ $ec -ne 0 ]; then
-      popd > /dev/null
-      exit $ec
-    fi
-  else
-    cp $input $output
-  fi
-done
+# copy Gremlin-Hadoop configuration files
+cp ${TP_HOME}/hadoop-gremlin/conf/* "${CONSOLE_HOME}/conf/"
 
-if [ "{$rmHadoopPlugin}" == "1" ]; then
-  rm -rf "${CONSOLE_HOME}/ext/${hadoopPluginName}"
-  sed -e "/${hadoopClassName}/d" "${CONSOLE_HOME}/ext/plugins.txt" > "${CONSOLE_HOME}/ext/plugins.txt."
-  mv "${CONSOLE_HOME}/ext/plugins.txt." "${CONSOLE_HOME}/ext/plugins.txt"
-fi
+# process *.asciidoc files
+#find "${TP_HOME}/docs/src/" -name "*.asciidoc" | xargs -n1 -P0 "${TP_HOME}/docs/preprocessor/preprocess-file.sh"
+find "${TP_HOME}/docs/src/" -name "implementations.asciidoc" | xargs -n1 -P0 "${TP_HOME}/docs/preprocessor/preprocess-file.sh"
+
+cleanup
 
 popd > /dev/null


[03/26] incubator-tinkerpop git commit: added a few pre-processable Gremlin-Hadoop samples. The old samples are still in as a reference.

Posted by dk...@apache.org.
added a few pre-processable Gremlin-Hadoop samples. The old samples are still in as a reference.


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

Branch: refs/heads/master
Commit: 507495df7515816984e8579fcf7e12492440f948
Parents: 1faaaf3
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Fri May 29 17:59:24 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Fri May 29 17:59:24 2015 +0200

----------------------------------------------------------------------
 docs/src/implementations.asciidoc | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/507495df/docs/src/implementations.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/implementations.asciidoc b/docs/src/implementations.asciidoc
index eb643e3..633531e 100644
--- a/docs/src/implementations.asciidoc
+++ b/docs/src/implementations.asciidoc
@@ -571,7 +571,7 @@ gremlin.graph=org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph
 gremlin.hadoop.graphInputFormat=org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.GryoInputFormat
 gremlin.hadoop.graphOutputFormat=org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.GryoOutputFormat
 gremlin.hadoop.jarsInDistributedCache=true
-gremlin.hadoop.inputLocation=tinkerpop-modern-vertices.kryo
+gremlin.hadoop.inputLocation=tinkerpop-modern.kryo
 gremlin.hadoop.outputLocation=output
 #####################################
 # GiraphGraphComputer Configuration #
@@ -636,6 +636,17 @@ gremlin> g.V().group().by{it.value('name')[1]}.by('name').next()
 ==>i={ripple=1}
 ==>o={lop=1, josh=1}
 
+[gremlin-groovy]
+----
+hdfs.copyFromLocal('data/tinkerpop-modern.kryo', 'tinkerpop-modern.kryo')
+hdfs.ls()
+graph = GraphFactory.open('conf/hadoop-gryo.properties')
+g = graph.traversal(standard())
+g.V().count()
+g.V().out().out().values('name')
+g.V().group().by{it.value('name')[1]}.by('name').next()
+----
+
 OLAP Hadoop-Gremlin
 ~~~~~~~~~~~~~~~~~~~
 
@@ -691,6 +702,14 @@ INFO  org.apache.hadoop.mapred.JobClient  -  map 0% reduce 0%
 ==>ripple
 ==>lop
 
+[gremlin-groovy]
+----
+graph = GraphFactory.open('conf/hadoop-gryo.properties')
+g = graph.traversal(computer())
+g.V().count()
+g.V().out().out().values('name')
+----
+
 IMPORTANT: The examples above do not use lambdas (i.e. closures in Gremlin-Groovy). This makes the traversal serializable and thus, able to be distributed to all machines in the Hadoop cluster. If a lambda is required in a traversal, then the traversal must be sent as a `String` and compiled locally at each machine in the cluster. The following example demonstrates the `:remote` command which allows for submitting Gremlin traversals as a `String`.
 
 [source,text]
@@ -736,6 +755,14 @@ gremlin> g.V().out().out().values('name')
 ==>lop
 ==>ripple
 
+[gremlin-groovy]
+----
+graph = GraphFactory.open('conf/hadoop-gryo.properties')
+g = graph.traversal(computer(SparkGraphComputer))
+g.V().count()
+g.V().out().out().values('name')
+----
+
 For using lambdas in Gremlin-Groovy, simply provide `:remote connect` a `TraversalSource` which leverages SparkGraphComputer.
 
 [source,test]


[26/26] incubator-tinkerpop git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-tinkerpop

Posted by dk...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-tinkerpop


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

Branch: refs/heads/master
Commit: 821a0ed1e3ea27737e51355510b4247bc40f0059
Parents: 1eeaaa7 6796130
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Fri Jun 5 22:17:19 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Fri Jun 5 22:17:19 2015 +0200

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../finalization/LazyBarrierStrategy.java       | 46 ++++++++++++++++++--
 .../AbstractImportCustomizerProvider.java       | 13 ++++--
 3 files changed, 52 insertions(+), 8 deletions(-)
----------------------------------------------------------------------



[07/26] incubator-tinkerpop git commit: different syntax for and-conditions in if-statement (to make it work on OSX)

Posted by dk...@apache.org.
different syntax for and-conditions in if-statement (to make it work on OSX)


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

Branch: refs/heads/master
Commit: ab91eb293e779b743935fd8de95dda0e52344cd5
Parents: eb72528
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Sat May 30 01:05:43 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Sat May 30 01:05:43 2015 +0200

----------------------------------------------------------------------
 docs/preprocessor/preprocess.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/ab91eb29/docs/preprocessor/preprocess.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/preprocess.sh b/docs/preprocessor/preprocess.sh
index ef2ef8f..c83f512 100755
--- a/docs/preprocessor/preprocess.sh
+++ b/docs/preprocessor/preprocess.sh
@@ -64,7 +64,7 @@ function cleanup() {
   find "${TP_HOME}/docs/src/" -name "*.asciidoc.groovy" | xargs rm -f
 }
 
-if [ ! -z "${hadoopPluginName}" -a ! -d "${hadoopPluginDirectory}" -a ${match} -eq 0 ]; then
+if [ ! -z "${hadoopPluginName}" ] && [ ! -d "${hadoopPluginDirectory}" ] && [ ${match} -eq 0 ]; then
   rmHadoopPlugin=1
   echo -e "\n${hadoopPluginClass}" >> "${PLUGIN_DIR}/plugins.txt"
   mkdir -p "${PLUGIN_DIR}/${hadoopPluginName}/"{lib,plugin}


[08/26] incubator-tinkerpop git commit: more adjustments for OSX

Posted by dk...@apache.org.
more adjustments for OSX


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

Branch: refs/heads/master
Commit: ec86c7c2feceeb408807efc4f6545ec85bd25a58
Parents: ab91eb2
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Sat May 30 01:21:05 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Sat May 30 01:21:05 2015 +0200

----------------------------------------------------------------------
 docs/preprocessor/preprocess.sh | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/ec86c7c2/docs/preprocessor/preprocess.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/preprocess.sh b/docs/preprocessor/preprocess.sh
index c83f512..5fc9463 100755
--- a/docs/preprocessor/preprocess.sh
+++ b/docs/preprocessor/preprocess.sh
@@ -43,12 +43,12 @@ cp -R docs/{static,stylesheets} target/postprocess-asciidoc/
 TP_HOME=`pwd`
 CONSOLE_HOME=`directory "${TP_HOME}/gremlin-console/target/apache-gremlin-console-*-standalone"`
 PLUGIN_DIR="${CONSOLE_HOME}/ext"
-TP_VERSION=$(cat pom.xml | grep -A1 '<artifactId>tinkerpop</artifactId>' | grep -Po '(?<=<version>).*(?=</version>)')
+TP_VERSION=$(cat pom.xml | grep -A1 '<artifactId>tinkerpop</artifactId>' | grep -o 'version>[^<]*' | grep -o '>.*' | grep -o '[^>]*')
 
 # install Hadoop plugin
 hadoopPlugin=$(find . -name "HadoopGremlinPlugin.java")
 hadoopPluginName=`echo ${hadoopPlugin} | cut -d '/' -f2`
-hadoopPluginClass=`echo ${hadoopPlugin} | grep -Po '(?<=src/main/java/).*(?=\.java)' | tr '/' '.'`
+hadoopPluginClass=`echo ${hadoopPlugin} | sed -e 's@.*src/main/java/@@' -e 's/\.java$//' | tr '/' '.'`
 hadoopPluginDirectory="${PLUGIN_DIR}/${hadoopPluginName}"
 match=`grep -c "$hadoopPluginClass" ${PLUGIN_DIR}/plugins.txt`
 
@@ -68,18 +68,15 @@ if [ ! -z "${hadoopPluginName}" ] && [ ! -d "${hadoopPluginDirectory}" ] && [ ${
   rmHadoopPlugin=1
   echo -e "\n${hadoopPluginClass}" >> "${PLUGIN_DIR}/plugins.txt"
   mkdir -p "${PLUGIN_DIR}/${hadoopPluginName}/"{lib,plugin}
-  #cp ${hadoopPluginName}/target/*${TP_VERSION}.jar "${PLUGIN_DIR}/${hadoopPluginName}/lib"
   cp ${hadoopPluginName}/target/*${TP_VERSION}.jar "${PLUGIN_DIR}/${hadoopPluginName}/plugin"
   libdir=`directory "${hadoopPluginName}/target/*-standalone/lib/"`
   if [ -d "${libdir}" ]; then
-    #cp ${libdir}/*.jar "${PLUGIN_DIR}/${hadoopPluginName}/lib"
     cp ${libdir}/*.jar "${PLUGIN_DIR}/${hadoopPluginName}/plugin"
   fi
   cp */target/*${TP_VERSION}.jar "${PLUGIN_DIR}/${hadoopPluginName}/lib"
   for libdir in $(find . -name lib | grep -v ext); do
     cp ${libdir}/*.jar "${PLUGIN_DIR}/${hadoopPluginName}/lib"
   done
-  #rm -f "${PLUGIN_DIR}/hadoop-gremlin"/*/slf4j-*.jar
   rm -f "${PLUGIN_DIR}/hadoop-gremlin"/plugin/slf4j-*.jar
   echo "System.exit(0)" > "${PLUGIN_DIR}/${hadoopPluginName}/init.groovy"
   ${CONSOLE_HOME}/bin/gremlin.sh "${PLUGIN_DIR}/${hadoopPluginName}/init.groovy" > /dev/null 2> /dev/null


[06/26] incubator-tinkerpop git commit: fixed number of parallel processes (to make it work on OSX)

Posted by dk...@apache.org.
fixed number of parallel processes (to make it work on OSX)


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

Branch: refs/heads/master
Commit: eb725284055949b77cf450049cdc3da5d2f3bbdf
Parents: 3fd4b4d
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Sat May 30 00:59:08 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Sat May 30 00:59:08 2015 +0200

----------------------------------------------------------------------
 docs/preprocessor/preprocess.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/eb725284/docs/preprocessor/preprocess.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/preprocess.sh b/docs/preprocessor/preprocess.sh
index 14ec7c7..ef2ef8f 100755
--- a/docs/preprocessor/preprocess.sh
+++ b/docs/preprocessor/preprocess.sh
@@ -89,7 +89,7 @@ fi
 cp ${TP_HOME}/hadoop-gremlin/conf/* "${CONSOLE_HOME}/conf/"
 
 # process *.asciidoc files
-find "${TP_HOME}/docs/src/" -name "*.asciidoc" | xargs -n1 -P0 "${TP_HOME}/docs/preprocessor/preprocess-file.sh" "${CONSOLE_HOME}"
+find "${TP_HOME}/docs/src/" -name "*.asciidoc" | xargs -n1 -P8 "${TP_HOME}/docs/preprocessor/preprocess-file.sh" "${CONSOLE_HOME}"
 
 cleanup