Last active
August 29, 2015 14:09
-
-
Save curtisallen/78c4fee5f87e88024f6e to your computer and use it in GitHub Desktop.
Partiton Graph
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\,,,/ | |
(o o) | |
-----oOOo-(_)-oOOo----- | |
gremlin> import com.pearson.atwood.dsl.* | |
gremlin> import com.pearson.atwood.dsl.util.* | |
gremlin> c = ConfigurationProvider.create(ConfigurationProvider.Env.DEV, ConfigurationProvider.WorkLoad.READ_HEAVY) | |
==>org.apache.commons.configuration.BaseConfiguration@41813449 | |
gremlin> g = TitanFactory.open(c) | |
==>titangraph[inmemory:[192.168.1.112]] | |
gremlin> mgmt = g.getManagementSystem() | |
==>com.thinkaurelius.titan.graphdb.database.management.ManagementSystem@442b24c5 | |
gremlin> mgmt.makePropertyKey("_partition").dataType(String.class).make() | |
==>_partition | |
gremlin> mgmt.commit() | |
==>null | |
gremlin> Schema.init(g) | |
==>null | |
gremlin> mgmt.containsRelationType("_partition") | |
==>true | |
gremlin> pga = new PartitionGraph(g, "_partition", "a") | |
==>partitiongraph[titangraph[inmemory:[192.168.1.112]]] | |
gremlin> vertexa = pga.addVertex(null) | |
==>v[256] | |
gremlin> vertexa.setProperty('courseId','123') | |
==>null | |
gremlin> g.commit() | |
==>null | |
gremlin> pga.V.map | |
09:03:07 WARN com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx - Query requires iterating over all vertices [(_partition = a)]. For better performance, use indexes | |
==>{courseId=123} | |
gremlin> pgb = new PartitionGraph(g, "_partition", "b") | |
==>partitiongraph[titangraph[inmemory:[192.168.1.112]]] | |
gremlin> vertexb = pgb.addVertex(null) | |
==>v[512] | |
gremlin> vertexb.setProperty('courseId','123') | |
Adding this property for key [courseId] and value [123] violates a uniqueness constraint [courseId] | |
Display stack trace? [yN] | |
gremlin> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\,,,/ | |
(o o) | |
-----oOOo-(_)-oOOo----- | |
gremlin> import com.pearson.atwood.dsl.* | |
gremlin> import com.pearson.atwood.dsl.util.* | |
gremlin> c = ConfigurationProvider.create(ConfigurationProvider.Env.DEV, ConfigurationProvider.WorkLoad.READ_HEAVY) | |
==>org.apache.commons.configuration.BaseConfiguration@41813449 | |
gremlin> g = TitanFactory.open(c) | |
==>titangraph[inmemory:[192.168.1.112]] | |
gremlin> pga = new PartitionGraph(g, "_partition", "a") | |
==>partitiongraph[titangraph[inmemory:[192.168.1.112]]] | |
gremlin> Schema.init(pga.getBaseGraph()) | |
==>null | |
gremlin> mgmta = pga.getBaseGraph().getManagementSystem() | |
==>com.thinkaurelius.titan.graphdb.database.management.ManagementSystem@43508da7 | |
gremlin> mgmta.makePropertyKey("_partition").dataType(String.class).make() | |
==>_partition | |
gremlin> mgmta.commit() | |
==>null | |
gremlin> mgmta = pga.getBaseGraph().getManagementSystem() | |
==>com.thinkaurelius.titan.graphdb.database.management.ManagementSystem@76645d71 | |
gremlin> mgmta.containsRelationType("_partition") | |
==>true | |
gremlin> pgb = new PartitionGraph(g, "_partition", "b") | |
==>partitiongraph[titangraph[inmemory:[192.168.1.112]]] | |
gremlin> vertexa = pga.addVertex(null) | |
==>v[256] | |
gremlin> vertexa.setProperty("courseId","123") | |
==>null | |
gremlin> pgb.getBaseGraph().commit() | |
==>null | |
gremlin> pga.getBaseGraph().commit() | |
==>null | |
gremlin> vertexb = pgb.addVertex(null) | |
==>v[768] | |
gremlin> vertexb.setProperty("courseId","123") | |
Adding this property for key [courseId] and value [123] violates a uniqueness constraint [courseId] | |
Display stack trace? [yN] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment