Last active
December 21, 2015 11:09
-
-
Save zcox/6297023 to your computer and use it in GitHub Desktop.
Multiple threads all using the same RexsterGraph instance, each one creates a new vertex then sets many properties on it. Runs against Titan Server (Cassandra) 0.3.2. Exceptions ensue.
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
| [info] Running com.pongr.RexsterGraphTest | |
| 2013-08-21 13:52:45,721 DEBUG com.pongr.RexsterGraphTest$ - First | |
| 2013-08-21 13:52:46,744 DEBUG com.pongr.RexsterGraphTest$ - Started 2 threads, waiting for them to finish... | |
| 2013-08-21 13:52:46,982 DEBUG c.pongr.CreateVertexAndSetProperties - Starting vertex 1 using graph rexstergraph[http://localhost:8182/graphs/graph[titangraph[embeddedcassandra:null]]]... | |
| 2013-08-21 13:52:46,982 DEBUG c.pongr.CreateVertexAndSetProperties - Starting vertex 2 using graph rexstergraph[http://localhost:8182/graphs/graph[titangraph[embeddedcassandra:null]]]... | |
| 2013-08-21 13:52:48,117 DEBUG c.pongr.CreateVertexAndSetProperties - Created v[4] with id 2 | |
| 2013-08-21 13:52:48,117 DEBUG c.pongr.CreateVertexAndSetProperties - Created v[8] with id 1 | |
| [error] (Thread-2) java.lang.RuntimeException: Server returned HTTP response code: 500 for URL: http://localhost:8182/graphs/graph/vertices/4 | |
| java.lang.RuntimeException: Server returned HTTP response code: 500 for URL: http://localhost:8182/graphs/graph/vertices/4 | |
| at com.tinkerpop.blueprints.impls.rexster.RestHelper.post(RestHelper.java:157) | |
| at com.tinkerpop.blueprints.impls.rexster.RestHelper.postResultObject(RestHelper.java:55) | |
| at com.tinkerpop.blueprints.impls.rexster.RexsterElement.setProperty(RexsterElement.java:90) | |
| at com.tinkerpop.blueprints.impls.rexster.RexsterVertex.setProperty(RexsterVertex.java:19) | |
| at com.pongr.CreateVertexAndSetProperties.run(RexsterGraphTest.scala:13) | |
| at java.lang.Thread.run(Thread.java:679) | |
| Caused by: java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:8182/graphs/graph/vertices/4 | |
| at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1403) | |
| at com.tinkerpop.blueprints.impls.rexster.RestHelper.post(RestHelper.java:154) | |
| at com.tinkerpop.blueprints.impls.rexster.RestHelper.postResultObject(RestHelper.java:55) | |
| at com.tinkerpop.blueprints.impls.rexster.RexsterElement.setProperty(RexsterElement.java:90) | |
| at com.tinkerpop.blueprints.impls.rexster.RexsterVertex.setProperty(RexsterVertex.java:19) | |
| at com.pongr.CreateVertexAndSetProperties.run(RexsterGraphTest.scala:13) | |
| at java.lang.Thread.run(Thread.java:679) | |
| 2013-08-21 13:52:49,869 DEBUG c.pongr.CreateVertexAndSetProperties - Finished vertex 1 |
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
| package com.pongr | |
| import grizzled.slf4j.Logging | |
| import com.tinkerpop.blueprints.Graph | |
| import com.tinkerpop.blueprints.impls.rexster.RexsterGraph | |
| import java.util.concurrent.CountDownLatch | |
| class CreateVertexAndSetProperties(g: Graph, latch: CountDownLatch, id: String, propetyCount: Int) extends Runnable with Logging { | |
| override def run() { | |
| debug("Starting vertex %s using graph %s..." format (id, g)) | |
| val v = g.addVertex(null) | |
| debug("Created %s with id %s" format (v, id)) | |
| v.setProperty("vertexId", id) | |
| for (i <- 1 to propetyCount) v.setProperty("key" + i, "value" + i) | |
| latch.countDown() | |
| debug("Finished vertex %s" format id) | |
| } | |
| } | |
| object RexsterGraphTest extends App with Logging { | |
| debug("First") | |
| Thread.sleep(1000) //let the logging systems warm up | |
| //val g = new RexsterGraph("http://localhost:8182/graphs/graph") | |
| def g2() = new RexsterGraph("http://localhost:8182/graphs/graph") | |
| val threadCount = 2 | |
| val latch = new CountDownLatch(threadCount) | |
| (1 to threadCount).map(id => new CreateVertexAndSetProperties(g2(), latch, id.toString, 10)).foreach(new Thread(_).start()) | |
| debug("Started %d threads, waiting for them to finish..." format threadCount) | |
| latch.await() | |
| debug("Finished") | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment