You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/09/15 18:31:21 UTC

[jira] [Commented] (TINKERPOP-1451) TinkerGraph persistence cannot handle a single file name as the graph location

    [ https://issues.apache.org/jira/browse/TINKERPOP-1451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15494163#comment-15494163 ] 

ASF GitHub Bot commented on TINKERPOP-1451:
-------------------------------------------

GitHub user spmallette opened a pull request:

    https://github.com/apache/tinkerpop/pull/423

    TINKERPOP-1451 TinkerGraph persistence cannot handle a single file name as the graph location

    https://issues.apache.org/jira/browse/TINKERPOP-1451
    
    works nicely now:
    
    ```text
    gremlin> configuration = new org.apache.commons.configuration.BaseConfiguration()
    ==>org.apache.commons.configuration.BaseConfiguration@18a3962d
    gremlin> configuration.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_LOCATION, 'test4.gryo')
    ==>null
    gremlin> configuration.setProperty(Graph.GRAPH, TinkerGraph.class.getName())
    ==>null
    gremlin> configuration.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_FORMAT, 'gryo')
    ==>null
    gremlin> graph = TinkerGraph.open(configuration)
    ==>tinkergraph[vertices:0 edges:0]
    gremlin> v = graph.addVertex('Person')
    ==>v[0]
    gremlin> v.property(list, 'age', 1)
    ==>vp[age->1]
    gremlin> v.property(list, 'age', 2)
    ==>vp[age->2]
    gremlin> v.properties()
    ==>vp[age->1]
    ==>vp[age->2]
    gremlin> graph.close()
    ==>null
    gremlin> configuration.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_DEFAULT_VERTEX_PROPERTY_CARDINALITY, VertexProperty.Cardinality.list.toString());
    ==>null
    gremlin> graph = TinkerGraph.open(configuration)
    ==>tinkergraph[vertices:1 edges:0]
    gremlin> graph.traversal().V().properties()
    ==>vp[age->1]
    ==>vp[age->2]
    ```
    
    VOTE +1

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/tinkerpop TINKERPOP-1451

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/tinkerpop/pull/423.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #423
    
----
commit 6a6b44d85a4e3e7f6e83778aab9fc21436ef6004
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-09-15T17:51:33Z

    TinkerGraph's would not save on close()
    
    if the path was just a file name. Tested "just a file name" manually and added a test for relative paths - didn't want to generate test data outside of our test directories. TINKERPOP-1451

commit b1579f38038e85842bb8699e4397b390e24a57c8
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-09-15T17:57:21Z

    Modified TinkerGraph IO test to use just the filename for the path
    
    Change my mind from the previous commit. Probably better to have the test for exactly what was failing.
    Changed my mind about

commit 2d57a32af554271c766ad4cfa0856b57b5806da7
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-09-15T18:08:31Z

    Added a test for persisting multi-properties in TinkerGraph
    
    Changed the test back to using a relative path in the data directory - didn't like it polluting the source control directories.

----


> TinkerGraph persistence cannot handle a single file name as the graph location
> ------------------------------------------------------------------------------
>
>                 Key: TINKERPOP-1451
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1451
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: tinkergraph
>    Affects Versions: 3.1.4
>            Reporter: Matthias Broecheler
>
> {code}
> gremlin> configuration = new org.apache.commons.configuration.BaseConfiguration()
> ==>org.apache.commons.configuration.BaseConfiguration@30331109
> gremlin> configuration.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_LOCATION, 'test.gryo')
> ==>null
> gremlin> configuration.setProperty(Graph.GRAPH, TinkerGraph.class.getName())
> ==>null
> gremlin> configuration.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_FORMAT, 'gryo')
> ==>null
> gremlin> graph = TinkerGraph.open(configuration)
> ==>tinkergraph[vertices:0 edges:0]
> gremlin> v = graph.addVertex('Person')
> ==>v[0]
> gremlin> v.property(list, 'age', 1)
> ==>vp[age->1]
> gremlin> v.property(list, 'age', 2)
> ==>vp[age->2]
> gremlin> v.properties()
> ==>vp[age->1]
> ==>vp[age->2]
> gremlin> graph.close()
> java.lang.NullPointerException
> Type ':help' or ':h' for help.
> Display stack trace? [yN]y
> java.lang.NullPointerException
> 	at org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph.saveGraph(TinkerGraph.java:302)
> 	at org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph.close(TinkerGraph.java:254)
> 	at org.apache.tinkerpop.gremlin.structure.Graph$close$1.call(Unknown Source)
> 	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
> 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
> 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
> 	at groovysh_evaluate.run(groovysh_evaluate:3)
> 	at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
> 	at org.codehaus.groovy.tools.shell.Interpreter.evaluate(Interpreter.groovy:70)
> 	at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:190)
> 	at org.apache.tinkerpop.gremlin.console.GremlinGroovysh.super$3$execute(GremlinGroovysh.groovy)
> 	at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:497)
> 	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
> 	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
> 	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1215)
> 	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:132)
> 	at org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:72)
> 	at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:122)
> 	at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:95)
> 	at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
> 	at sun.reflect.GeneratedMethodAccessor34.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:497)
> 	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
> 	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
> 	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1215)
> 	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:132)
> 	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:152)
> 	at org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:124)
> 	at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:59)
> 	at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:497)
> 	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
> 	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
> 	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1215)
> 	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:132)
> 	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:152)
> 	at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:83)
> 	at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
> 	at org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:152)
> 	at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
> 	at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:449)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)