Re: [Neo4j] Exceptions in Neo4j Server
Hi, I´d love to provide you more information, but i run the server in production and just randomly get these errors. Cheers, Dario Am 09.08.11 17:18 schrieb Jim Webber unter j...@neotechnology.com: Hi Dario, It's hard to know if it's expected behaviour unless you share a bit more context. What were you doing (in JUnit tests or curl commands) to produce these? Jim On 9 Aug 2011, at 14:35, Dario Rexin wrote: Hi, I just attached a hoptoad appender to my logger in the Neo4j Server and am getting some internal neo exceptions besides the ones I’m getting from my unmanaged extensions. I would like to know, why they happen and if it’s a known behaviour. Here are the exceptions: java.net.SocketTimeoutException Read timed out -2SocketInputStream.java → socketRead0 129 SocketInputStream.java → read 382 ByteArrayBuffer.java → readFrom 107 StreamEndPoint.java → fill 198 SocketConnector.java → fill 290 HttpParser.java → parseNext 212 HttpParser.java → parseAvailable 404 HttpConnection.java → handle 228 SocketConnector.java → run 582 QueuedThreadPool.java → run java.net.SocketException Socket closed 162 SocketInputStream.java →?read 382 ByteArrayBuffer.java →?readFrom 107 StreamEndPoint.java →?fill 198 SocketConnector.java →?fill 290 HttpParser.java →?parseNext 212 HttpParser.java →?parseAvailable 404 HttpConnection.java →?handle 228 SocketConnector.java →?run 582 QueuedThreadPool.java →?run Cheers, Dario ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] Exceptions in Neo4j Server
Hi, I just attached a hoptoad appender to my logger in the Neo4j Server and am getting some internal neo exceptions besides the ones I’m getting from my unmanaged extensions. I would like to know, why they happen and if it’s a known behaviour. Here are the exceptions: java.net.SocketTimeoutException Read timed out -2SocketInputStream.java → socketRead0 129 SocketInputStream.java → read 382 ByteArrayBuffer.java → readFrom 107 StreamEndPoint.java → fill 198 SocketConnector.java → fill 290 HttpParser.java → parseNext 212 HttpParser.java → parseAvailable 404 HttpConnection.java → handle 228 SocketConnector.java → run 582 QueuedThreadPool.java → run java.net.SocketException Socket closed 162 SocketInputStream.java →?read 382 ByteArrayBuffer.java →?readFrom 107 StreamEndPoint.java →?fill 198 SocketConnector.java →?fill 290 HttpParser.java →?parseNext 212 HttpParser.java →?parseAvailable 404 HttpConnection.java →?handle 228 SocketConnector.java →?run 582 QueuedThreadPool.java →?run Cheers, Dario ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] BatchInserter with Lucene Index
Hi all, Recently i tried import a huge dataset into neo using the BatchInserter. I also used the BatchInserterIndex. The import itself went very well and i was able to read from the graph, but when i tried to insert something i always got an error saying that no new transaction could be created. Here’s how I used the index: // provider is a LuceneBatchInserterIndexProvider BatchInserterIndex urnIndex = provider.nodeIndex(urn, MapUtil.stringMap( type, exact )); for (Map.EntryString, Long entry : nodes.entrySet()) { MapString, Object props = MapUtil.map(urn, entry.getKey()); urnIndex.add(entry.getValue(), props); } I also called shutdown() on the provider and the BatchInserter afterwards. Is there anything i am missing? Cheers, Dario ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Find 2nd degree friends in order of mutual friend
Hi Fajar, You can do that by writing either server plugins, or unmanaged extensions. Here is how: http://docs.neo4j.org/chunked/milestone/server-plugins.html http://docs.neo4j.org/chunked/milestone/server-unmanaged-extensions.html Cheers, Dario Am 22.06.11 15:22 schrieb Fajar Maulana Firdaus unter faja...@gmail.com: I have been reading a little bit about gremlin, I think it is really great. However is it possible to get similar result using REST API? regards, On Fri, Jun 17, 2011 at 8:31 PM, Marko Rodriguez okramma...@gmail.comwrote: Hi, In Gremlin (http://gremlin.tinkerpop.com), friends of a friend (FOAF) who are not my friends: x = [] as Set g.v(1).out('friend').aggregate(x).out('friend').except(x) - x is a Set to save intermediate friend vertices to to exclude (except) from the final step. - g is your graph (e.g. g = new Neo4jGraph('/tmp/graph')) - g.v(1) will grab vertex 1 by its id If you give me some particular things you want to say, I can provide you the Gremlin code to do it. Thanks, Marko. http://markorodriguez.com On Jun 17, 2011, at 7:08 AM, faja...@gmail.com wrote: Oh thank you, As I mentioned, I am new to neo4j. So a little sample code would be very useful in my learning process. :) My current state is that I managed to add few nodes, and add friend relationship between several nodes. User - friend - other node. Friend is relationship I don't have a very big node number so I think your suggested approach will work. Fajar Sent from my BlackBerry® smartphone from Sinyal Bagus XL, Nyambung Teruuusss...! -Original Message- From: Peter Neubauer peter.neuba...@neotechnology.com Sender: user-boun...@lists.neo4j.org Date: Fri, 17 Jun 2011 14:12:48 To: Neo4j user discussionsuser@lists.neo4j.org Reply-To: Neo4j user discussions user@lists.neo4j.org Subject: Re: [Neo4j] Find 2nd degree friends in order of mutual friend Hi Fajar, this is a depth 2 traversal from the person in question. While exhaustively traversing his friends, you increase the group count as for each FOAF you get on the second step. However, we have seen edge cases with supernodes where in a social network, persons can have 50K friends. There, you might use heuristics or indexing approaches to make this very fast. If you have some more details, I could write down the query in Gremlin or Cypher (http://docs.neo4j.org/chunked/snapshot/cypher-query-lang.html ), but in principle, it would be like https://github.com/tinkerpop/gremlin/wiki (actually using 3 steps, I think we could get it down to 2) for Gremlin. In neo4j, if things are not cached, only the parts the data that are needed for this traversal wil be loaded from disk, so you don't need to hold all the graph in cache for this, since it is a data-local operation. HTH Cheers, /peter neubauer GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - Your high performance graph database. http://startupbootcamp.org/- Öresund - Innovation happens HERE. http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Fri, Jun 17, 2011 at 1:33 PM, Fajar Maulana Firdaus faja...@gmail.com wrote: Hi all, I am new to neo4j and excited to know more about graph database. First of all, could anyone please help me to figure out the documentation about the query or rest client? Then, back to my question, I want to find 2nd degree friends but ordered by number of mutual friend. I understand that if I have all data in memory, I could've traverse the graph to 2nd level, and keep counter for each nodes in 2nd level. So in away its like finding all paths from start node to all second degree friend, but if we do that, it would be inefficient. Does anyone have any idea how to do this with neo4j? Thank you, Fajarmf ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Neo Server slow on frequent requests
Hi Tobias, Here's the thread dump you asked for. Thank you for taking a look at this. Cheers, Dario Am 12.04.11 22:16 schrieb Tobias Ivarsson unter tobias.ivars...@neotechnology.com: Hi Dario, Looking at that picture it is indeed clear that a number of threads are waiting for something. What is not shown is the more important information about *what* they are waiting for. I would love to get information like that in order to investigate the cause of the performance problem you are seeing. If you could send a thread dump instead of a screenshot that would be a lot more useful, since that would contain information about contention that I could actually analyze. The easiest way to get a thread dump is by sending the SIGQUIT signal (kill -3) to the JVM process running Neo4j. Cheers, Tobias On Tue, Apr 12, 2011 at 6:35 PM, Dario Rexin dario.re...@xing.com wrote: Hi all, Due to huge performance issues with some of our neo queries I profiled my calls on the neo server. The profiling shows, that up to 85% of the time the threads are waiting for other threads. I don¹t understand what¹s going on there. Hopefully someone with a deeper knowledge can help me. Am I doing something wrong, or is it normal, that most of the time the threads are blocking each other? Her is a screenshot, showing the results of my profiling: http://i.imgur.com/eIfam.jpg Thanks in advice, Dario ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Dario Rexin Junior Manager Engineering dario.re...@xing.com XING AG Gaensemarkt 43, 20354 Hamburg, Germany Commercial Reg. (Registergericht): Amtsgericht Hamburg, HRB 98807 Exec. Board (Vorstand): Dr. Stefan Groß-Selbeck (Vorsitzender), Ingo Chu, Dr. Helmut Becker, Jens Pape Chairman of the Supervisory Board (Aufsichtsratsvorsitzender): Dr. Neil Sunderland Please join my network on XING: https://www.xing.com/profile/Dario_Rexin This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden and may be unlawful. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Neo Server slow on frequent requests
Hey, Somehow my attached files always get deleted. Heres the dump: https://gist.github.com/917199 Cheers, Dario Am 13.04.11 10:30 schrieb Dario Rexin unter dario.re...@xing.com: Hi Tobias, Here's the thread dump you asked for. Thank you for taking a look at this. Cheers, Dario Am 12.04.11 22:16 schrieb Tobias Ivarsson unter tobias.ivars...@neotechnology.com: Hi Dario, Looking at that picture it is indeed clear that a number of threads are waiting for something. What is not shown is the more important information about *what* they are waiting for. I would love to get information like that in order to investigate the cause of the performance problem you are seeing. If you could send a thread dump instead of a screenshot that would be a lot more useful, since that would contain information about contention that I could actually analyze. The easiest way to get a thread dump is by sending the SIGQUIT signal (kill -3) to the JVM process running Neo4j. Cheers, Tobias On Tue, Apr 12, 2011 at 6:35 PM, Dario Rexin dario.re...@xing.com wrote: Hi all, Due to huge performance issues with some of our neo queries I profiled my calls on the neo server. The profiling shows, that up to 85% of the time the threads are waiting for other threads. I don¹t understand what¹s going on there. Hopefully someone with a deeper knowledge can help me. Am I doing something wrong, or is it normal, that most of the time the threads are blocking each other? Her is a screenshot, showing the results of my profiling: http://i.imgur.com/eIfam.jpg Thanks in advice, Dario ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Dario Rexin Junior Manager Engineering dario.re...@xing.com XING AG Gaensemarkt 43, 20354 Hamburg, Germany Commercial Reg. (Registergericht): Amtsgericht Hamburg, HRB 98807 Exec. Board (Vorstand): Dr. Stefan Groß-Selbeck (Vorsitzender), Ingo Chu, Dr. Helmut Becker, Jens Pape Chairman of the Supervisory Board (Aufsichtsratsvorsitzender): Dr. Neil Sunderland Please join my network on XING: https://www.xing.com/profile/Dario_Rexin This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden and may be unlawful. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Neo Server slow on frequent requests
Hi Tobias, I was already sending requests to the server in the last dump. Here is another, hopefully this one is more helpful. The longer I request data, the longer it takes for the server to answer. After some time it frequently freezes for up to several seconds without answering to any of the requests. https://gist.github.com/917283 Cheers, Dario Am 13.04.11 11:14 schrieb Tobias Ivarsson unter tobias.ivars...@neotechnology.com: Hi Dario, This dump looks perfectly fine, the expected threads are there, but they are all idle waiting for work. When I asked for a thread dump, I wanted one from when the server was under load and you experienced problems. Sorry for not being clear about that. Cheers, Tobias On Wed, Apr 13, 2011 at 10:34 AM, Dario Rexin dario.re...@xing.com wrote: Hey, Somehow my attached files always get deleted. Heres the dump: https://gist.github.com/917199 Cheers, Dario Am 13.04.11 10:30 schrieb Dario Rexin unter dario.re...@xing.com: Hi Tobias, Here's the thread dump you asked for. Thank you for taking a look at this. Cheers, Dario Am 12.04.11 22:16 schrieb Tobias Ivarsson unter tobias.ivars...@neotechnology.com: Hi Dario, Looking at that picture it is indeed clear that a number of threads are waiting for something. What is not shown is the more important information about *what* they are waiting for. I would love to get information like that in order to investigate the cause of the performance problem you are seeing. If you could send a thread dump instead of a screenshot that would be a lot more useful, since that would contain information about contention that I could actually analyze. The easiest way to get a thread dump is by sending the SIGQUIT signal (kill -3) to the JVM process running Neo4j. Cheers, Tobias On Tue, Apr 12, 2011 at 6:35 PM, Dario Rexin dario.re...@xing.com wrote: Hi all, Due to huge performance issues with some of our neo queries I profiled my calls on the neo server. The profiling shows, that up to 85% of the time the threads are waiting for other threads. I don¹t understand what¹s going on there. Hopefully someone with a deeper knowledge can help me. Am I doing something wrong, or is it normal, that most of the time the threads are blocking each other? Her is a screenshot, showing the results of my profiling: http://i.imgur.com/eIfam.jpg Thanks in advice, Dario ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Dario Rexin Junior Manager Engineering dario.re...@xing.com XING AG Gaensemarkt 43, 20354 Hamburg, Germany Commercial Reg. (Registergericht): Amtsgericht Hamburg, HRB 98807 Exec. Board (Vorstand): Dr. Stefan Groß-Selbeck (Vorsitzender), Ingo Chu, Dr. Helmut Becker, Jens Pape Chairman of the Supervisory Board (Aufsichtsratsvorsitzender): Dr. Neil Sunderland Please join my network on XING: https://www.xing.com/profile/Dario_Rexin This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden and may be unlawful. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Dario Rexin Junior Manager Engineering dario.re...@xing.com XING AG Gaensemarkt 43, 20354 Hamburg, Germany Commercial Reg. (Registergericht): Amtsgericht Hamburg, HRB 98807 Exec. Board (Vorstand): Dr. Stefan Groß-Selbeck (Vorsitzender), Ingo Chu, Dr. Helmut Becker, Jens Pape Chairman of the Supervisory Board (Aufsichtsratsvorsitzender): Dr. Neil Sunderland Please join my network on XING: https://www.xing.com/profile/Dario_Rexin This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden and may be unlawful. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] Neo Server slow on frequent requests
Hi all, Due to huge performance issues with some of our neo queries I profiled my calls on the neo server. The profiling shows, that up to 85% of the time the threads are waiting for other threads. I don’t understand what’s going on there. Hopefully someone with a deeper knowledge can help me. Am I doing something wrong, or is it normal, that most of the time the threads are blocking each other? Her is a screenshot, showing the results of my profiling: http://i.imgur.com/eIfam.jpg Thanks in advice, Dario ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] Getting JSON for a Representation in an unmanaged extension
Hello, I am currently working an an unamanged extension for the neo4j rest server. I want to provide an HTML response which includes the JSON String of a Representation. How can I get the OutputFormat for MediaType.APPLICATION_JSON in a method with @Produces(MediaType.TEXT_HTML)? Thanks in advice for your help. Cheers, Dario ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Getting JSON for a Representation in an unmanaged extension
Hi, thank you very much. The server injection worked quiet well. Am 06.04.11 14:31 schrieb Michael Hunger unter michael.hun...@neotechnology.com: I think the output format (repository) is also added to jerseys injection facilities. so you might try to get it injected with @Context OutputFormat, but I don't know if that works. Otherwise you might perhaps create your own instance of RepresentationFormatRepository with an injected server. (and use its server.getExtensionManager) (or in the worst case have ResourceConfig injected and iterate through its getSingletons to find the OutputFormatProvider.) Cheers Michael from NeoServletContainer, protected void configure(WebConfig wc, ResourceConfig rc, WebApplication wa) { super.configure(wc, rc, wa); SetObject singletons = rc.getSingletons(); singletons.add( new DatabaseProvider( server.getDatabase() ) ); singletons.add( new GraphDatabaseServiceProvider( server.getDatabase().graph ) ); singletons.add( new NeoServerProvider( server ) ); singletons.add( new ConfigurationProvider( server.getConfiguration() ) ); if(server.getDatabase().rrdDb() != null) { singletons.add( new RrdDbProvider( server.getDatabase().rrdDb() ) ); } RepresentationFormatRepository repository = new RepresentationFormatRepository(server.getExtensionManager()); singletons.add( new InputFormatProvider( repository ) ); singletons.add( new OutputFormatProvider( repository ) ); } Am 06.04.2011 um 13:42 schrieb Dario Rexin: Hello, I am currently working an an unamanged extension for the neo4j rest server. I want to provide an HTML response which includes the JSON String of a Representation. How can I get the OutputFormat for MediaType.APPLICATION_JSON in a method with @Produces(MediaType.TEXT_HTML)? Thanks in advice for your help. Cheers, Dario ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] Constructing an evaluator that only takes specific nodes from a path
Hello, we are trying to construct an Evaluator that will select only one node from the middle of a path and include it in the result. We do have a specific path we are looking for and the endNode is stored in 'end'. Now what we would like to do is have an Evaluator like this: import org.neo4j.graphdb.traversal. Evaluator; new Evaluator(){ @Override public Evaluation evaluate(org.neo4j.graphdb.Path path) { if(path.length() 3) { return Evaluation.EXCLUDE_AND_PRUNE; } else if (path.length() == 2) { return Evaluation.INCLUDE_AND_CONTINUE; } else if (path.length() 2){ return Evaluation.EXCLUDE_AND_CONTINUE; } else { return path.endNode().getId() == end.getId() ? Evaluation.EXCLUDE_AND_PRUNE : Evaluation.DROP_PATH_AND_PRUNE; } } } The decision on whether to accept or drop a path is based on wether we have reached the endNode. That's why we would like to use something like DROP_PATH_AND_PRUNE, which doesn't exist. What are we missing? Any help appreciated! Thanks, Stephan and Dario ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Constructing an evaluator that only takes specific nodes from a path
Hi Peter, yes that would be not to include the path in the result set. On 07.04.2011, at 07:01, Peter Neubauer peter.neuba...@neotechnology.com wrote: Dario, I am not quite sure I understand what you mean by drop is that not to include the path into the result or prune or something else? Do you have a concrete example of this, maybe a simple toy graph test with toy information? Cheers, /peter neubauer GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - Your high performance graph database. http://startupbootcamp.org/- Öresund - Innovation happens HERE. http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Wed, Apr 6, 2011 at 6:35 PM, Dario Rexin dario.re...@xing.com wrote: Hello, we are trying to construct an Evaluator that will select only one node from the middle of a path and include it in the result. We do have a specific path we are looking for and the endNode is stored in 'end'. Now what we would like to do is have an Evaluator like this: import org.neo4j.graphdb.traversal. Evaluator; new Evaluator(){ @Override public Evaluation evaluate(org.neo4j.graphdb.Path path) { if(path.length() 3) { return Evaluation.EXCLUDE_AND_PRUNE; } else if (path.length() == 2) { return Evaluation.INCLUDE_AND_CONTINUE; } else if (path.length() 2){ return Evaluation.EXCLUDE_AND_CONTINUE; } else { return path.endNode().getId() == end.getId() ? Evaluation.EXCLUDE_AND_PRUNE : Evaluation.DROP_PATH_AND_PRUNE; } } } The decision on whether to accept or drop a path is based on wether we have reached the endNode. That's why we would like to use something like DROP_PATH_AND_PRUNE, which doesn't exist. What are we missing? Any help appreciated! Thanks, Stephan and Dario ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user