代码之家  ›  专栏  ›  技术社区  ›  Srinath Ganesh

修补程序pop3>Gremlin Server>Check Graph lib是否已安装

  •  1
  • Srinath Ganesh  · 技术社区  · 6 年前

    在Gremlin服务器中,我像这样安装NEO4J库

    bin/gremlin-server.sh -i org.apache.tinkerpop neo4j-gremlin x.y.z

    有没有办法弄清楚这个库是否已经安装了?


    长话短说:

    我正在模拟存在网络问题的情况,因此在运行此操作之前,我将禁用网络连接。

    脚本:

    #!/bin/bash
    echo "PING PING PING PING PING"
    bin/gremlin-server.sh -i org.apache.tinkerpop neo4j-gremlin x.y.z
    
    if [ $? -eq 0 ]
    then
      echo "Successfully Successfully Successfully Successfully"
    else
      echo "FAILED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    fi
    

    网络关闭时的结果

    PING PING PING PING PING
    Redirecting to 'install org.apache.tinkerpop neo4j-gremlin 3.3.1' (-i will be removed in a future release)
    Installing dependency org.apache.tinkerpop neo4j-gremlin 3.3.1
    Could not install the dependency: Error grabbing Grapes -- [unresolved dependency: org.apache.tinkerpop#neo4j-gremlin;3.3.1: not found]
    java.lang.RuntimeException: Error grabbing Grapes -- [unresolved dependency: org.apache.tinkerpop#neo4j-gremlin;3.3.1: not found]
        at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
        at groovy.grape.GrapeIvy.getDependencies(GrapeIvy.groovy:424)
        at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
        at groovy.grape.GrapeIvy.resolve(GrapeIvy.groovy:571)
        at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
        at groovy.grape.GrapeIvy.resolve(GrapeIvy.groovy:534)
        at groovy.grape.Grape.resolve(Grape.java:202)
        at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
        at org.apache.tinkerpop.gremlin.groovy.util.DependencyGrabber.copyDependenciesToPath(DependencyGrabber.groovy:110)
        at org.apache.tinkerpop.gremlin.server.util.GremlinServerInstall.main(GremlinServerInstall.java:38)
    Successfully Successfully Successfully Successfully
    

    为了检查BASH退出代码是否运行良好,我这样做了。

    cd wrongfolder
    if [ $? -eq 0 ]
    then
      echo "Successfully Successfully Successfully Successfully"
    else
      echo "FAILED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    fi
    

    输出

    PING PING PING PING PING
    /install.sh: line 5: cd: wrongfolder: No such file or directory
    FAILED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    

    所以 exit codes 工作很好,但不知怎么的,对克里姆林来说,它不起作用

    1 回复  |  直到 6 年前
        1
  •  1
  •   stephen mallette    6 年前

    我只是看了一下密码。加载插件的实用程序似乎没有产生错误代码,而是只打印错误并正常退出。所以,你所看到的是预料之中的。

    我添加了一个可用于3.2.10、3.3.4和3.4.0的修复程序:

    https://github.com/apache/tinkerpop/commit/2d315e828149a132ecabf406af91acc3caec064c

    我认为除了解析当前生成的输出之外,没有解决方法来确定成功或失败。