Re: [Cassandra Resource] Create Update Sling Resource
Hi, From the results published at [1]. Reversing the order shows up that the create time is quite variable and probably not a function of the number of nodes within a collection, but probably a function the activity and buffering within the Cassandra layer. Reverse the order and the first 200 items written will have the lowest latency. Delete shows no difference in latency between 1K and 100M child nodes. That result is very encouraging, it means that performance is related the IO speed of the disks underneath Cassandra and not a function of the volume of data within Cassandra or the number of items within a collection. I think we have enough information, next is to implement access control. I'll start a new thread for that. Create Add 1 child node to a collection of 100M child nodes takes 26ms Add 1 child node to a collection of 10M child nodes takes 135ms Add 1 child node to a collection of 1M child nodes takes 109ms Add 1 child node to a collection of 100K child nodes takes 259ms Add 1 child node to a collection of 10K child nodes takes 225ms Add 1 child node to a collection of 1K child nodes takes 101ms Update Update 1 child node to a collection of 100M child nodes takes 44ms Update 1 child node to a collection of 10M child nodes takes 84ms Update 1 child node to a collection of 1M child nodes takes 258ms Update 1 child node to a collection of 100K child nodes takes 116ms Update 1 child node to a collection of 10K child nodes takes 231ms Update 1 child node to a collection of 1K child nodes takes 113ms Delete Delete 1 child node to a collection of 100M child nodes takes 17ms Delete 1 child node to a collection of 10M child nodes takes 11ms Delete 1 child node to a collection of 1M child nodes takes 7ms Delete 1 child node to a collection of 100K child nodes takes 7ms Delete 1 child node to a collection of 10K child nodes takes 6ms Delete 1 child node to a collection of 1K child nodes takes 7ms On 12 September 2013 05:06, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, Once you look at the results, let me know whether you want new tests run results. Also please advice how to proceed further. On Wed, Sep 11, 2013 at 7:59 PM, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, I attached the results.zip file to the JIRA which has the latest results as your expectation. I added new set of nodes in reverse order F, E ..A. But here I came across in a issue (which I didn't came up last time, may be due to my heap size), that hector fails to execute batches around 300-500.. So in my case batch size is 600. I googled for the issue (me.prettyprint.hector.api.exceptions.HectorException: All host pools marked down. Retry burden pushed out to client) and the solution was reduce the batch size. Hence I ran the test for each node separately. Hence In new results zip file each node has its own report file. I categorized them in two 3 main folders so that you can easily locate the results. i.,e folders _create, _update , _delete .. On Wed, Sep 11, 2013 at 1:58 PM, Ian Boston i...@tfd.co.uk wrote: Hi, Could you re-run the tests for create in the reverse order, largest collection first. The reason for this is in the detail of the tests adding resources to collection E (10M child nodes) is flat until half way through and then starts to rise which makes me thing there might be something else going on on the machine of the create mechanism. I would like to rule out that Cassandra is caching writes and the speed of update bears no correlation to collection size, but is a function of sustained load. I would also like to rule out any possibility that another OS level process started to hog resources in the latter part of your tests. The results do look comparatively flat all the way up 100M items in a collection. Once we have done this we can move on to providing access control, on items. Best Regards Ian On 11 September 2013 03:37, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, Sorry the delay, I found my self some battery problems with my laptop. I believe this is what you asked for. Here I added new 100 collections i.e 1a,3a,5a etc in each old collections and did CUD. Please advice what I should do next. CREATE [RESULT] Average Latency Under Node A(1K) = 11 (ms) [RESULT] Average Latency Under Node B(10K) = 9 (ms) [RESULT] Average Latency Under Node C(100K) = 13 (ms) [RESULT] Average Latency Under Node D(1M) = 23 (ms) [RESULT] Average Latency Under Node E(10M) = 110 (ms) [RESULT] Average Latency Under Node F(100M) = 306 (ms) [FIRST RUN] #TOTAL CALLS = 600 Total Average Latency = 79 (ms) UPDATE [RESULT] Average Latency Under Node A(1K) = 9 (ms) [RESULT] Average Latency Under Node B(10K) = 8 (ms) [RESULT] Average Latency Under Node C(100K) = 9 (ms) [RESULT] Average Latency Under Node D(1M) = 17 (ms) [RESULT] Average Latency Under Node E(10M) = 20 (ms) [RESULT] Average Latency
Re: [Cassandra Resource] Create Update Sling Resource
Hi, Could you re-run the tests for create in the reverse order, largest collection first. The reason for this is in the detail of the tests adding resources to collection E (10M child nodes) is flat until half way through and then starts to rise which makes me thing there might be something else going on on the machine of the create mechanism. I would like to rule out that Cassandra is caching writes and the speed of update bears no correlation to collection size, but is a function of sustained load. I would also like to rule out any possibility that another OS level process started to hog resources in the latter part of your tests. The results do look comparatively flat all the way up 100M items in a collection. Once we have done this we can move on to providing access control, on items. Best Regards Ian On 11 September 2013 03:37, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, Sorry the delay, I found my self some battery problems with my laptop. I believe this is what you asked for. Here I added new 100 collections i.e 1a,3a,5a etc in each old collections and did CUD. Please advice what I should do next. CREATE [RESULT] Average Latency Under Node A(1K) = 11 (ms) [RESULT] Average Latency Under Node B(10K) = 9 (ms) [RESULT] Average Latency Under Node C(100K) = 13 (ms) [RESULT] Average Latency Under Node D(1M) = 23 (ms) [RESULT] Average Latency Under Node E(10M) = 110 (ms) [RESULT] Average Latency Under Node F(100M) = 306 (ms) [FIRST RUN] #TOTAL CALLS = 600 Total Average Latency = 79 (ms) UPDATE [RESULT] Average Latency Under Node A(1K) = 9 (ms) [RESULT] Average Latency Under Node B(10K) = 8 (ms) [RESULT] Average Latency Under Node C(100K) = 9 (ms) [RESULT] Average Latency Under Node D(1M) = 17 (ms) [RESULT] Average Latency Under Node E(10M) = 20 (ms) [RESULT] Average Latency Under Node F(100M) = 26 (ms) [FIRST RUN] #TOTAL CALLS = 600 Total Average Latency = 15 (ms) DELETE [RESULT] Average Latency Under Node A(1K) = 12 (ms) [RESULT] Average Latency Under Node B(10K) = 12 (ms) [RESULT] Average Latency Under Node C(100K) = 11 (ms) [RESULT] Average Latency Under Node C(100K) = 14 (ms) [RESULT] Average Latency Under Node C(100K) = 19 (ms) [RESULT] Average Latency Under Node C(100K) = 16 (ms) [FIRST RUN] #TOTAL CALLS = 600 Total Average Latency = 14 (ms) On Tue, Sep 10, 2013 at 5:25 PM, Ian Boston i...@tfd.co.uk wrote: Are they pre-populated with different numbers of items, or are they empty when the test starts ? If they are empty and created by the test, can you run the test on the collections used in the read tests so we get an idea how long it takes to add 100 items to each of those collections. Thanks Ian On 10 September 2013 12:25, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, Those are newly added collections. On Tue, Sep 10, 2013 at 12:00 PM, Ian Boston i...@tfd.co.uk wrote: Hi Dishara, Great, thanks. What do the LA, MA, and SA stand for ? Best regards Ian On Tuesday, September 10, 2013, Dishara Wijewardana wrote: Hi Ian Also commited the 3 new test classes for CUD to google code repo. On Tue, Sep 10, 2013 at 10:30 AM, Dishara Wijewardana ddwijeward...@gmail.com javascript:; wrote: Hi Ian, Finally was able to fix ;-). Had to debug along with the path and fix some other issues also in Cassandra Provider impl. I have updated the JIRA with the new reports of CUD. (I ran them one after the other respectively) In brief as follows. CREATE Average Latency Under Node LA = 165 (ms) Average Latency Under Node MA = 203 (ms) Average Latency Under Node SA = 256 (ms) #TOTAL CALLS = 300 Total Average Latency = 208 (ms) UPDATE Average Latency Under Node LA = 36 (ms) Average Latency Under Node MA = 29 (ms) Average Latency Under Node SA = 25 (ms) #TOTAL CALLS = 300 Total Average Latency = 30 (ms) DELETE Average Latency Under Node LA = 20 (ms) Average Latency Under Node MA = 19 (ms) Average Latency Under Node SA = 19 (ms) #TOTAL CALLS = 300 Total Average Latency = 19 (ms) On Mon, Sep 9, 2013 at 5:47 PM, Ian Boston i...@tfd.co.uk wrote: Hi The CassandraImpl needs to return something suitable to represent /content/cassandra/p For the moment, if the column family p does exist, return a new type of read only resource, eg CassandraColumnFamilyResource. Ian On 9 September 2013 13:02, Dishara Wijewardana ddwijeward...@gmail.com wrote: On Mon, Sep 9, 2013 at 2:09 PM, Ian Boston i...@tfd.co.uk wrote: Hi, The call to processCreate a few lines earlier should have created the resource so that the subsequent call to getResource returned the new resource into newResource. If you look through the calls the create operation is called in
Re: [Cassandra Resource] Create Update Sling Resource
Hi Ian, I attached the results.zip file to the JIRA which has the latest results as your expectation. I added new set of nodes in reverse order F, E ..A. But here I came across in a issue (which I didn't came up last time, may be due to my heap size), that hector fails to execute batches around 300-500.. So in my case batch size is 600. I googled for the issue (me.prettyprint.hector.api.exceptions.HectorException: All host pools marked down. Retry burden pushed out to client) and the solution was reduce the batch size. Hence I ran the test for each node separately. Hence In new results zip file each node has its own report file. I categorized them in two 3 main folders so that you can easily locate the results. i.,e folders _create, _update , _delete .. On Wed, Sep 11, 2013 at 1:58 PM, Ian Boston i...@tfd.co.uk wrote: Hi, Could you re-run the tests for create in the reverse order, largest collection first. The reason for this is in the detail of the tests adding resources to collection E (10M child nodes) is flat until half way through and then starts to rise which makes me thing there might be something else going on on the machine of the create mechanism. I would like to rule out that Cassandra is caching writes and the speed of update bears no correlation to collection size, but is a function of sustained load. I would also like to rule out any possibility that another OS level process started to hog resources in the latter part of your tests. The results do look comparatively flat all the way up 100M items in a collection. Once we have done this we can move on to providing access control, on items. Best Regards Ian On 11 September 2013 03:37, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, Sorry the delay, I found my self some battery problems with my laptop. I believe this is what you asked for. Here I added new 100 collections i.e 1a,3a,5a etc in each old collections and did CUD. Please advice what I should do next. CREATE [RESULT] Average Latency Under Node A(1K) = 11 (ms) [RESULT] Average Latency Under Node B(10K) = 9 (ms) [RESULT] Average Latency Under Node C(100K) = 13 (ms) [RESULT] Average Latency Under Node D(1M) = 23 (ms) [RESULT] Average Latency Under Node E(10M) = 110 (ms) [RESULT] Average Latency Under Node F(100M) = 306 (ms) [FIRST RUN] #TOTAL CALLS = 600 Total Average Latency = 79 (ms) UPDATE [RESULT] Average Latency Under Node A(1K) = 9 (ms) [RESULT] Average Latency Under Node B(10K) = 8 (ms) [RESULT] Average Latency Under Node C(100K) = 9 (ms) [RESULT] Average Latency Under Node D(1M) = 17 (ms) [RESULT] Average Latency Under Node E(10M) = 20 (ms) [RESULT] Average Latency Under Node F(100M) = 26 (ms) [FIRST RUN] #TOTAL CALLS = 600 Total Average Latency = 15 (ms) DELETE [RESULT] Average Latency Under Node A(1K) = 12 (ms) [RESULT] Average Latency Under Node B(10K) = 12 (ms) [RESULT] Average Latency Under Node C(100K) = 11 (ms) [RESULT] Average Latency Under Node C(100K) = 14 (ms) [RESULT] Average Latency Under Node C(100K) = 19 (ms) [RESULT] Average Latency Under Node C(100K) = 16 (ms) [FIRST RUN] #TOTAL CALLS = 600 Total Average Latency = 14 (ms) On Tue, Sep 10, 2013 at 5:25 PM, Ian Boston i...@tfd.co.uk wrote: Are they pre-populated with different numbers of items, or are they empty when the test starts ? If they are empty and created by the test, can you run the test on the collections used in the read tests so we get an idea how long it takes to add 100 items to each of those collections. Thanks Ian On 10 September 2013 12:25, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, Those are newly added collections. On Tue, Sep 10, 2013 at 12:00 PM, Ian Boston i...@tfd.co.uk wrote: Hi Dishara, Great, thanks. What do the LA, MA, and SA stand for ? Best regards Ian On Tuesday, September 10, 2013, Dishara Wijewardana wrote: Hi Ian Also commited the 3 new test classes for CUD to google code repo. On Tue, Sep 10, 2013 at 10:30 AM, Dishara Wijewardana ddwijeward...@gmail.com javascript:; wrote: Hi Ian, Finally was able to fix ;-). Had to debug along with the path and fix some other issues also in Cassandra Provider impl. I have updated the JIRA with the new reports of CUD. (I ran them one after the other respectively) In brief as follows. CREATE Average Latency Under Node LA = 165 (ms) Average Latency Under Node MA = 203 (ms) Average Latency Under Node SA = 256 (ms) #TOTAL CALLS = 300 Total Average Latency = 208 (ms) UPDATE Average Latency Under Node LA = 36 (ms) Average Latency Under Node MA = 29 (ms) Average Latency Under Node SA = 25 (ms) #TOTAL CALLS = 300 Total Average Latency = 30 (ms) DELETE Average Latency Under Node LA = 20
Re: [Cassandra Resource] Create Update Sling Resource
Hi Ian, Once you look at the results, let me know whether you want new tests run results. Also please advice how to proceed further. On Wed, Sep 11, 2013 at 7:59 PM, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, I attached the results.zip file to the JIRA which has the latest results as your expectation. I added new set of nodes in reverse order F, E ..A. But here I came across in a issue (which I didn't came up last time, may be due to my heap size), that hector fails to execute batches around 300-500.. So in my case batch size is 600. I googled for the issue (me.prettyprint.hector.api.exceptions.HectorException: All host pools marked down. Retry burden pushed out to client) and the solution was reduce the batch size. Hence I ran the test for each node separately. Hence In new results zip file each node has its own report file. I categorized them in two 3 main folders so that you can easily locate the results. i.,e folders _create, _update , _delete .. On Wed, Sep 11, 2013 at 1:58 PM, Ian Boston i...@tfd.co.uk wrote: Hi, Could you re-run the tests for create in the reverse order, largest collection first. The reason for this is in the detail of the tests adding resources to collection E (10M child nodes) is flat until half way through and then starts to rise which makes me thing there might be something else going on on the machine of the create mechanism. I would like to rule out that Cassandra is caching writes and the speed of update bears no correlation to collection size, but is a function of sustained load. I would also like to rule out any possibility that another OS level process started to hog resources in the latter part of your tests. The results do look comparatively flat all the way up 100M items in a collection. Once we have done this we can move on to providing access control, on items. Best Regards Ian On 11 September 2013 03:37, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, Sorry the delay, I found my self some battery problems with my laptop. I believe this is what you asked for. Here I added new 100 collections i.e 1a,3a,5a etc in each old collections and did CUD. Please advice what I should do next. CREATE [RESULT] Average Latency Under Node A(1K) = 11 (ms) [RESULT] Average Latency Under Node B(10K) = 9 (ms) [RESULT] Average Latency Under Node C(100K) = 13 (ms) [RESULT] Average Latency Under Node D(1M) = 23 (ms) [RESULT] Average Latency Under Node E(10M) = 110 (ms) [RESULT] Average Latency Under Node F(100M) = 306 (ms) [FIRST RUN] #TOTAL CALLS = 600 Total Average Latency = 79 (ms) UPDATE [RESULT] Average Latency Under Node A(1K) = 9 (ms) [RESULT] Average Latency Under Node B(10K) = 8 (ms) [RESULT] Average Latency Under Node C(100K) = 9 (ms) [RESULT] Average Latency Under Node D(1M) = 17 (ms) [RESULT] Average Latency Under Node E(10M) = 20 (ms) [RESULT] Average Latency Under Node F(100M) = 26 (ms) [FIRST RUN] #TOTAL CALLS = 600 Total Average Latency = 15 (ms) DELETE [RESULT] Average Latency Under Node A(1K) = 12 (ms) [RESULT] Average Latency Under Node B(10K) = 12 (ms) [RESULT] Average Latency Under Node C(100K) = 11 (ms) [RESULT] Average Latency Under Node C(100K) = 14 (ms) [RESULT] Average Latency Under Node C(100K) = 19 (ms) [RESULT] Average Latency Under Node C(100K) = 16 (ms) [FIRST RUN] #TOTAL CALLS = 600 Total Average Latency = 14 (ms) On Tue, Sep 10, 2013 at 5:25 PM, Ian Boston i...@tfd.co.uk wrote: Are they pre-populated with different numbers of items, or are they empty when the test starts ? If they are empty and created by the test, can you run the test on the collections used in the read tests so we get an idea how long it takes to add 100 items to each of those collections. Thanks Ian On 10 September 2013 12:25, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, Those are newly added collections. On Tue, Sep 10, 2013 at 12:00 PM, Ian Boston i...@tfd.co.uk wrote: Hi Dishara, Great, thanks. What do the LA, MA, and SA stand for ? Best regards Ian On Tuesday, September 10, 2013, Dishara Wijewardana wrote: Hi Ian Also commited the 3 new test classes for CUD to google code repo. On Tue, Sep 10, 2013 at 10:30 AM, Dishara Wijewardana ddwijeward...@gmail.com javascript:; wrote: Hi Ian, Finally was able to fix ;-). Had to debug along with the path and fix some other issues also in Cassandra Provider impl. I have updated the JIRA with the new reports of CUD. (I ran them one after the other respectively) In brief as follows. CREATE Average Latency Under Node LA = 165 (ms) Average Latency Under Node MA = 203 (ms) Average Latency Under Node SA = 256 (ms) #TOTAL CALLS = 300 Total Average Latency = 208 (ms) UPDATE Average Latency
Re: [Cassandra Resource] Create Update Sling Resource
Hi Dishara, Great, thanks. What do the LA, MA, and SA stand for ? Best regards Ian On Tuesday, September 10, 2013, Dishara Wijewardana wrote: Hi Ian Also commited the 3 new test classes for CUD to google code repo. On Tue, Sep 10, 2013 at 10:30 AM, Dishara Wijewardana ddwijeward...@gmail.com javascript:; wrote: Hi Ian, Finally was able to fix ;-). Had to debug along with the path and fix some other issues also in Cassandra Provider impl. I have updated the JIRA with the new reports of CUD. (I ran them one after the other respectively) In brief as follows. CREATE Average Latency Under Node LA = 165 (ms) Average Latency Under Node MA = 203 (ms) Average Latency Under Node SA = 256 (ms) #TOTAL CALLS = 300 Total Average Latency = 208 (ms) UPDATE Average Latency Under Node LA = 36 (ms) Average Latency Under Node MA = 29 (ms) Average Latency Under Node SA = 25 (ms) #TOTAL CALLS = 300 Total Average Latency = 30 (ms) DELETE Average Latency Under Node LA = 20 (ms) Average Latency Under Node MA = 19 (ms) Average Latency Under Node SA = 19 (ms) #TOTAL CALLS = 300 Total Average Latency = 19 (ms) On Mon, Sep 9, 2013 at 5:47 PM, Ian Boston i...@tfd.co.uk wrote: Hi The CassandraImpl needs to return something suitable to represent /content/cassandra/p For the moment, if the column family p does exist, return a new type of read only resource, eg CassandraColumnFamilyResource. Ian On 9 September 2013 13:02, Dishara Wijewardana ddwijeward...@gmail.com wrote: On Mon, Sep 9, 2013 at 2:09 PM, Ian Boston i...@tfd.co.uk wrote: Hi, The call to processCreate a few lines earlier should have created the resource so that the subsequent call to getResource returned the new resource into newResource. If you look through the calls the create operation is called in org.apache.sling.servlets.post.impl.operations.AbstractCreateOperation.deepGetOrCreateNode(ResourceResolver, String, MapString, RequestProperty, ListModification, VersioningConfiguration) Line 533 resource = resolver.create(resource, name, props); Stick a breakpoint at that line and see, if its called, and if the resource resolver calls your code. Hi Ian, Yes it calls the create method. As I see the issue is the commit not getting called and hence resolver cannot get the created resource. So I thought of commit on the fly @create method to verify that. But we have a problem here. When I try to create /content/cassandra/p/c node, as you exactly mentioned before, it tries to create /content/cassandra/p node. In Cassandra Impl, there cannot be a node like /content/cassandra/p and hence returns NULL as earlier and still create fails. Because p is the column family (the model which we agreed and implemented). So what is the best approach to overcome this. BTW: Its Ok that there is a newResource.adaptTo(Node.class) as the result is checked for Null a moment later. You do not need to support adaptTo(Node.class), which is a special case for Jcr. Best Regards Ian On 9 September 2013 06:05, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, I debug the servlet from line to line and locate the NPE that causes this -- Thanks /Dishara
Re: [Cassandra Resource] Create Update Sling Resource
Hi Ian, Those are newly added collections. On Tue, Sep 10, 2013 at 12:00 PM, Ian Boston i...@tfd.co.uk wrote: Hi Dishara, Great, thanks. What do the LA, MA, and SA stand for ? Best regards Ian On Tuesday, September 10, 2013, Dishara Wijewardana wrote: Hi Ian Also commited the 3 new test classes for CUD to google code repo. On Tue, Sep 10, 2013 at 10:30 AM, Dishara Wijewardana ddwijeward...@gmail.com javascript:; wrote: Hi Ian, Finally was able to fix ;-). Had to debug along with the path and fix some other issues also in Cassandra Provider impl. I have updated the JIRA with the new reports of CUD. (I ran them one after the other respectively) In brief as follows. CREATE Average Latency Under Node LA = 165 (ms) Average Latency Under Node MA = 203 (ms) Average Latency Under Node SA = 256 (ms) #TOTAL CALLS = 300 Total Average Latency = 208 (ms) UPDATE Average Latency Under Node LA = 36 (ms) Average Latency Under Node MA = 29 (ms) Average Latency Under Node SA = 25 (ms) #TOTAL CALLS = 300 Total Average Latency = 30 (ms) DELETE Average Latency Under Node LA = 20 (ms) Average Latency Under Node MA = 19 (ms) Average Latency Under Node SA = 19 (ms) #TOTAL CALLS = 300 Total Average Latency = 19 (ms) On Mon, Sep 9, 2013 at 5:47 PM, Ian Boston i...@tfd.co.uk wrote: Hi The CassandraImpl needs to return something suitable to represent /content/cassandra/p For the moment, if the column family p does exist, return a new type of read only resource, eg CassandraColumnFamilyResource. Ian On 9 September 2013 13:02, Dishara Wijewardana ddwijeward...@gmail.com wrote: On Mon, Sep 9, 2013 at 2:09 PM, Ian Boston i...@tfd.co.uk wrote: Hi, The call to processCreate a few lines earlier should have created the resource so that the subsequent call to getResource returned the new resource into newResource. If you look through the calls the create operation is called in org.apache.sling.servlets.post.impl.operations.AbstractCreateOperation.deepGetOrCreateNode(ResourceResolver, String, MapString, RequestProperty, ListModification, VersioningConfiguration) Line 533 resource = resolver.create(resource, name, props); Stick a breakpoint at that line and see, if its called, and if the resource resolver calls your code. Hi Ian, Yes it calls the create method. As I see the issue is the commit not getting called and hence resolver cannot get the created resource. So I thought of commit on the fly @create method to verify that. But we have a problem here. When I try to create /content/cassandra/p/c node, as you exactly mentioned before, it tries to create /content/cassandra/p node. In Cassandra Impl, there cannot be a node like /content/cassandra/p and hence returns NULL as earlier and still create fails. Because p is the column family (the model which we agreed and implemented). So what is the best approach to overcome this. BTW: Its Ok that there is a newResource.adaptTo(Node.class) as the result is checked for Null a moment later. You do not need to support adaptTo(Node.class), which is a special case for Jcr. Best Regards Ian On 9 September 2013 06:05, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, I debug the servlet from line to line and locate the NPE that causes this -- Thanks /Dishara -- Thanks /Dishara
Re: [Cassandra Resource] Create Update Sling Resource
Hi Ian, Sorry the delay, I found my self some battery problems with my laptop. I believe this is what you asked for. Here I added new 100 collections i.e 1a,3a,5a etc in each old collections and did CUD. Please advice what I should do next. CREATE [RESULT] Average Latency Under Node A(1K) = 11 (ms) [RESULT] Average Latency Under Node B(10K) = 9 (ms) [RESULT] Average Latency Under Node C(100K) = 13 (ms) [RESULT] Average Latency Under Node D(1M) = 23 (ms) [RESULT] Average Latency Under Node E(10M) = 110 (ms) [RESULT] Average Latency Under Node F(100M) = 306 (ms) [FIRST RUN] #TOTAL CALLS = 600 Total Average Latency = 79 (ms) UPDATE [RESULT] Average Latency Under Node A(1K) = 9 (ms) [RESULT] Average Latency Under Node B(10K) = 8 (ms) [RESULT] Average Latency Under Node C(100K) = 9 (ms) [RESULT] Average Latency Under Node D(1M) = 17 (ms) [RESULT] Average Latency Under Node E(10M) = 20 (ms) [RESULT] Average Latency Under Node F(100M) = 26 (ms) [FIRST RUN] #TOTAL CALLS = 600 Total Average Latency = 15 (ms) DELETE [RESULT] Average Latency Under Node A(1K) = 12 (ms) [RESULT] Average Latency Under Node B(10K) = 12 (ms) [RESULT] Average Latency Under Node C(100K) = 11 (ms) [RESULT] Average Latency Under Node C(100K) = 14 (ms) [RESULT] Average Latency Under Node C(100K) = 19 (ms) [RESULT] Average Latency Under Node C(100K) = 16 (ms) [FIRST RUN] #TOTAL CALLS = 600 Total Average Latency = 14 (ms) On Tue, Sep 10, 2013 at 5:25 PM, Ian Boston i...@tfd.co.uk wrote: Are they pre-populated with different numbers of items, or are they empty when the test starts ? If they are empty and created by the test, can you run the test on the collections used in the read tests so we get an idea how long it takes to add 100 items to each of those collections. Thanks Ian On 10 September 2013 12:25, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, Those are newly added collections. On Tue, Sep 10, 2013 at 12:00 PM, Ian Boston i...@tfd.co.uk wrote: Hi Dishara, Great, thanks. What do the LA, MA, and SA stand for ? Best regards Ian On Tuesday, September 10, 2013, Dishara Wijewardana wrote: Hi Ian Also commited the 3 new test classes for CUD to google code repo. On Tue, Sep 10, 2013 at 10:30 AM, Dishara Wijewardana ddwijeward...@gmail.com javascript:; wrote: Hi Ian, Finally was able to fix ;-). Had to debug along with the path and fix some other issues also in Cassandra Provider impl. I have updated the JIRA with the new reports of CUD. (I ran them one after the other respectively) In brief as follows. CREATE Average Latency Under Node LA = 165 (ms) Average Latency Under Node MA = 203 (ms) Average Latency Under Node SA = 256 (ms) #TOTAL CALLS = 300 Total Average Latency = 208 (ms) UPDATE Average Latency Under Node LA = 36 (ms) Average Latency Under Node MA = 29 (ms) Average Latency Under Node SA = 25 (ms) #TOTAL CALLS = 300 Total Average Latency = 30 (ms) DELETE Average Latency Under Node LA = 20 (ms) Average Latency Under Node MA = 19 (ms) Average Latency Under Node SA = 19 (ms) #TOTAL CALLS = 300 Total Average Latency = 19 (ms) On Mon, Sep 9, 2013 at 5:47 PM, Ian Boston i...@tfd.co.uk wrote: Hi The CassandraImpl needs to return something suitable to represent /content/cassandra/p For the moment, if the column family p does exist, return a new type of read only resource, eg CassandraColumnFamilyResource. Ian On 9 September 2013 13:02, Dishara Wijewardana ddwijeward...@gmail.com wrote: On Mon, Sep 9, 2013 at 2:09 PM, Ian Boston i...@tfd.co.uk wrote: Hi, The call to processCreate a few lines earlier should have created the resource so that the subsequent call to getResource returned the new resource into newResource. If you look through the calls the create operation is called in org.apache.sling.servlets.post.impl.operations.AbstractCreateOperation.deepGetOrCreateNode(ResourceResolver, String, MapString, RequestProperty, ListModification, VersioningConfiguration) Line 533 resource = resolver.create(resource, name, props); Stick a breakpoint at that line and see, if its called, and if the resource resolver calls your code. Hi Ian, Yes it calls the create method. As I see the issue is the commit not getting called and hence resolver cannot get the created resource. So I thought of commit on the fly @create method to verify that. But we have a problem here. When I try to create /content/cassandra/p/c node, as you exactly mentioned before, it tries to create /content/cassandra/p node. In Cassandra Impl, there cannot be a node
Re: [Cassandra Resource] Create Update Sling Resource
Also updated the JIRA with complete reports. Please find CUD_Latency_Report-11-09-13.zip attached in jira On Wed, Sep 11, 2013 at 8:07 AM, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, Sorry the delay, I found my self some battery problems with my laptop. I believe this is what you asked for. Here I added new 100 collections i.e 1a,3a,5a etc in each old collections and did CUD. Please advice what I should do next. CREATE [RESULT] Average Latency Under Node A(1K) = 11 (ms) [RESULT] Average Latency Under Node B(10K) = 9 (ms) [RESULT] Average Latency Under Node C(100K) = 13 (ms) [RESULT] Average Latency Under Node D(1M) = 23 (ms) [RESULT] Average Latency Under Node E(10M) = 110 (ms) [RESULT] Average Latency Under Node F(100M) = 306 (ms) [FIRST RUN] #TOTAL CALLS = 600 Total Average Latency = 79 (ms) UPDATE [RESULT] Average Latency Under Node A(1K) = 9 (ms) [RESULT] Average Latency Under Node B(10K) = 8 (ms) [RESULT] Average Latency Under Node C(100K) = 9 (ms) [RESULT] Average Latency Under Node D(1M) = 17 (ms) [RESULT] Average Latency Under Node E(10M) = 20 (ms) [RESULT] Average Latency Under Node F(100M) = 26 (ms) [FIRST RUN] #TOTAL CALLS = 600 Total Average Latency = 15 (ms) DELETE [RESULT] Average Latency Under Node A(1K) = 12 (ms) [RESULT] Average Latency Under Node B(10K) = 12 (ms) [RESULT] Average Latency Under Node C(100K) = 11 (ms) [RESULT] Average Latency Under Node C(100K) = 14 (ms) [RESULT] Average Latency Under Node C(100K) = 19 (ms) [RESULT] Average Latency Under Node C(100K) = 16 (ms) [FIRST RUN] #TOTAL CALLS = 600 Total Average Latency = 14 (ms) On Tue, Sep 10, 2013 at 5:25 PM, Ian Boston i...@tfd.co.uk wrote: Are they pre-populated with different numbers of items, or are they empty when the test starts ? If they are empty and created by the test, can you run the test on the collections used in the read tests so we get an idea how long it takes to add 100 items to each of those collections. Thanks Ian On 10 September 2013 12:25, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, Those are newly added collections. On Tue, Sep 10, 2013 at 12:00 PM, Ian Boston i...@tfd.co.uk wrote: Hi Dishara, Great, thanks. What do the LA, MA, and SA stand for ? Best regards Ian On Tuesday, September 10, 2013, Dishara Wijewardana wrote: Hi Ian Also commited the 3 new test classes for CUD to google code repo. On Tue, Sep 10, 2013 at 10:30 AM, Dishara Wijewardana ddwijeward...@gmail.com javascript:; wrote: Hi Ian, Finally was able to fix ;-). Had to debug along with the path and fix some other issues also in Cassandra Provider impl. I have updated the JIRA with the new reports of CUD. (I ran them one after the other respectively) In brief as follows. CREATE Average Latency Under Node LA = 165 (ms) Average Latency Under Node MA = 203 (ms) Average Latency Under Node SA = 256 (ms) #TOTAL CALLS = 300 Total Average Latency = 208 (ms) UPDATE Average Latency Under Node LA = 36 (ms) Average Latency Under Node MA = 29 (ms) Average Latency Under Node SA = 25 (ms) #TOTAL CALLS = 300 Total Average Latency = 30 (ms) DELETE Average Latency Under Node LA = 20 (ms) Average Latency Under Node MA = 19 (ms) Average Latency Under Node SA = 19 (ms) #TOTAL CALLS = 300 Total Average Latency = 19 (ms) On Mon, Sep 9, 2013 at 5:47 PM, Ian Boston i...@tfd.co.uk wrote: Hi The CassandraImpl needs to return something suitable to represent /content/cassandra/p For the moment, if the column family p does exist, return a new type of read only resource, eg CassandraColumnFamilyResource. Ian On 9 September 2013 13:02, Dishara Wijewardana ddwijeward...@gmail.com wrote: On Mon, Sep 9, 2013 at 2:09 PM, Ian Boston i...@tfd.co.uk wrote: Hi, The call to processCreate a few lines earlier should have created the resource so that the subsequent call to getResource returned the new resource into newResource. If you look through the calls the create operation is called in org.apache.sling.servlets.post.impl.operations.AbstractCreateOperation.deepGetOrCreateNode(ResourceResolver, String, MapString, RequestProperty, ListModification, VersioningConfiguration) Line 533 resource = resolver.create(resource, name, props); Stick a breakpoint at that line and see, if its called, and if the resource resolver calls your code. Hi Ian, Yes it calls the create method. As I see the issue is the commit not getting called and hence resolver cannot get the created resource. So I thought of commit on the fly @create method to verify that. But we
Re: [Cassandra Resource] Create Update Sling Resource
Hi, The call to processCreate a few lines earlier should have created the resource so that the subsequent call to getResource returned the new resource into newResource. If you look through the calls the create operation is called in org.apache.sling.servlets.post.impl.operations.AbstractCreateOperation.deepGetOrCreateNode(ResourceResolver, String, MapString, RequestProperty, ListModification, VersioningConfiguration) Line 533 resource = resolver.create(resource, name, props); Stick a breakpoint at that line and see, if its called, and if the resource resolver calls your code. BTW: Its Ok that there is a newResource.adaptTo(Node.class) as the result is checked for Null a moment later. You do not need to support adaptTo(Node.class), which is a special case for Jcr. Best Regards Ian On 9 September 2013 06:05, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, I debug the servlet from line to line and locate the NPE that causes this failure. The request path SlingPostServlet AbstractCreateOperation ModifyOperation@line 105 where newResource = null. The resource resolver at this point is org.apache.sling.resourceresolver.impl.ResourceResolverImpl. 104 final Resource newResource = request.getResourceResolver().getResource(response.getPath()); 105 final Node newNode = *newResource*.adaptTo(Node.class); The resolver get a resource if the resource is already existing one(obviously). So either this should be a bug or my request goes through the wrong path. Please advice. On Mon, Sep 9, 2013 at 8:45 AM, Dishara Wijewardana ddwijeward...@gmail.com wrote: I also checked in Cassandra Provider impl and with system logs and verified the Error not comes due to exception throws from the Provider implementation itself. So probably it will be a missing a property. I still could not figure out which. If I can find which servlet get called I can debug and see(already post a mail to dev list). On Sun, Sep 8, 2013 at 5:10 AM, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, I found it difficult to use createNode method to work. It returns 200 response. I was trying to get this working but could not find a way. Probably I might be missing some properties. What I set was only content type to be json. What are the appropriate properties that you mentioned. How can someone get to know what are the properties required minimum to create a node. I debug and verified my create method gets hit in provider side. *P.S If I give a already existing path it works and gives 302 response. * i.e /content/cassandra/p1/c1 this works since it is already there. But /content/cassandra/pp/cc fails. I also tried adding /content/cassandra/pp first and then /content/cassandra/pp/cc. It fails at /content/cassandra/pp. Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 36.21 sec FAILURE! testResourceCreate(org.apache.sling.launchpad.webapp.integrationtest.resourceprovider.CassandraResourceCUDTest) Time elapsed: 36.187 sec ERROR! org.apache.sling.commons.testing.integration.HttpStatusCodeException: Expected status code 302 for POST, got 200, URL= http://localhost:8080/content/cassandra/pp/cc, Content=[html head titleError while processing /content/cassandra/pp/cc/title /head body h1Error while processing /content/cassandra/pp/cc/h1 table tbody tr tdStatus/td tddiv id=Status500/div/td /tr tr tdMessage/td tddiv id=Messagejava.lang.NullPointerException/div/td /tr tr tdLocation/td tda href=/cassandra/pp/cc id=Location/cassandra/pp/cc/a/td /tr tr tdParent Location/td tda href=/cassandra/pp id=ParentLocation/cassandra/pp/a/td /tr tr tdPath/td tddiv id=Path/content/cassandra/pp/cc/div/td /tr tr tdReferer/td tda href= id=Referer/a/td /tr tr tdChangeLog/td tddiv id=ChangeLoglt;pregt;lt;/pregt;/div/td /tr /tbody /table pa href=Go Back/a/p pa href=/cassandra/pp/ccModified Resource/a/p pa href=/cassandra/ppParent of Modified Resource/a/p /body /html] at org.apache.sling.commons.testing.integration.SlingIntegrationTestClient.createNode(SlingIntegrationTestClient.java:188) at org.apache.sling.commons.testing.integration.SlingIntegrationTestClient.createNode(SlingIntegrationTestClient.java:119) at org.apache.sling.commons.testing.integration.SlingIntegrationTestClient.createNode(SlingIntegrationTestClient.java:109) at
Re: [Cassandra Resource] Create Update Sling Resource
On Mon, Sep 9, 2013 at 2:09 PM, Ian Boston i...@tfd.co.uk wrote: Hi, The call to processCreate a few lines earlier should have created the resource so that the subsequent call to getResource returned the new resource into newResource. If you look through the calls the create operation is called in org.apache.sling.servlets.post.impl.operations.AbstractCreateOperation.deepGetOrCreateNode(ResourceResolver, String, MapString, RequestProperty, ListModification, VersioningConfiguration) Line 533 resource = resolver.create(resource, name, props); Stick a breakpoint at that line and see, if its called, and if the resource resolver calls your code. Hi Ian, Yes it calls the create method. As I see the issue is the commit not getting called and hence resolver cannot get the created resource. So I thought of commit on the fly @create method to verify that. But we have a problem here. When I try to create /content/cassandra/p/c node, as you exactly mentioned before, it tries to create /content/cassandra/p node. In Cassandra Impl, there cannot be a node like /content/cassandra/p and hence returns NULL as earlier and still create fails. Because p is the column family (the model which we agreed and implemented). So what is the best approach to overcome this. BTW: Its Ok that there is a newResource.adaptTo(Node.class) as the result is checked for Null a moment later. You do not need to support adaptTo(Node.class), which is a special case for Jcr. Best Regards Ian On 9 September 2013 06:05, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, I debug the servlet from line to line and locate the NPE that causes this failure. The request path SlingPostServlet AbstractCreateOperation ModifyOperation@line 105 where newResource = null. The resource resolver at this point is org.apache.sling.resourceresolver.impl.ResourceResolverImpl. 104 final Resource newResource = request.getResourceResolver().getResource(response.getPath()); 105 final Node newNode = *newResource*.adaptTo(Node.class); The resolver get a resource if the resource is already existing one(obviously). So either this should be a bug or my request goes through the wrong path. Please advice. On Mon, Sep 9, 2013 at 8:45 AM, Dishara Wijewardana ddwijeward...@gmail.com wrote: I also checked in Cassandra Provider impl and with system logs and verified the Error not comes due to exception throws from the Provider implementation itself. So probably it will be a missing a property. I still could not figure out which. If I can find which servlet get called I can debug and see(already post a mail to dev list). On Sun, Sep 8, 2013 at 5:10 AM, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, I found it difficult to use createNode method to work. It returns 200 response. I was trying to get this working but could not find a way. Probably I might be missing some properties. What I set was only content type to be json. What are the appropriate properties that you mentioned. How can someone get to know what are the properties required minimum to create a node. I debug and verified my create method gets hit in provider side. *P.S If I give a already existing path it works and gives 302 response. * i.e /content/cassandra/p1/c1 this works since it is already there. But /content/cassandra/pp/cc fails. I also tried adding /content/cassandra/pp first and then /content/cassandra/pp/cc. It fails at /content/cassandra/pp. Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 36.21 sec FAILURE! testResourceCreate(org.apache.sling.launchpad.webapp.integrationtest.resourceprovider.CassandraResourceCUDTest) Time elapsed: 36.187 sec ERROR! org.apache.sling.commons.testing.integration.HttpStatusCodeException: Expected status code 302 for POST, got 200, URL= http://localhost:8080/content/cassandra/pp/cc, Content=[html head titleError while processing /content/cassandra/pp/cc/title /head body h1Error while processing /content/cassandra/pp/cc/h1 table tbody tr tdStatus/td tddiv id=Status500/div/td /tr tr tdMessage/td tddiv id=Messagejava.lang.NullPointerException/div/td /tr tr tdLocation/td tda href=/cassandra/pp/cc id=Location/cassandra/pp/cc/a/td /tr tr tdParent Location/td tda href=/cassandra/pp id=ParentLocation/cassandra/pp/a/td /tr tr tdPath/td tddiv id=Path/content/cassandra/pp/cc/div/td /tr tr tdReferer/td tda href= id=Referer/a/td /tr tr
Re: [Cassandra Resource] Create Update Sling Resource
Hi Ian, Finally was able to fix ;-). Had to debug along with the path and fix some other issues also in Cassandra Provider impl. I have updated the JIRA with the new reports of CUD. (I ran them one after the other respectively) In brief as follows. CREATE Average Latency Under Node LA = 165 (ms) Average Latency Under Node MA = 203 (ms) Average Latency Under Node SA = 256 (ms) #TOTAL CALLS = 300 Total Average Latency = 208 (ms) UPDATE Average Latency Under Node LA = 36 (ms) Average Latency Under Node MA = 29 (ms) Average Latency Under Node SA = 25 (ms) #TOTAL CALLS = 300 Total Average Latency = 30 (ms) DELETE Average Latency Under Node LA = 20 (ms) Average Latency Under Node MA = 19 (ms) Average Latency Under Node SA = 19 (ms) #TOTAL CALLS = 300 Total Average Latency = 19 (ms) On Mon, Sep 9, 2013 at 5:47 PM, Ian Boston i...@tfd.co.uk wrote: Hi The CassandraImpl needs to return something suitable to represent /content/cassandra/p For the moment, if the column family p does exist, return a new type of read only resource, eg CassandraColumnFamilyResource. Ian On 9 September 2013 13:02, Dishara Wijewardana ddwijeward...@gmail.com wrote: On Mon, Sep 9, 2013 at 2:09 PM, Ian Boston i...@tfd.co.uk wrote: Hi, The call to processCreate a few lines earlier should have created the resource so that the subsequent call to getResource returned the new resource into newResource. If you look through the calls the create operation is called in org.apache.sling.servlets.post.impl.operations.AbstractCreateOperation.deepGetOrCreateNode(ResourceResolver, String, MapString, RequestProperty, ListModification, VersioningConfiguration) Line 533 resource = resolver.create(resource, name, props); Stick a breakpoint at that line and see, if its called, and if the resource resolver calls your code. Hi Ian, Yes it calls the create method. As I see the issue is the commit not getting called and hence resolver cannot get the created resource. So I thought of commit on the fly @create method to verify that. But we have a problem here. When I try to create /content/cassandra/p/c node, as you exactly mentioned before, it tries to create /content/cassandra/p node. In Cassandra Impl, there cannot be a node like /content/cassandra/p and hence returns NULL as earlier and still create fails. Because p is the column family (the model which we agreed and implemented). So what is the best approach to overcome this. BTW: Its Ok that there is a newResource.adaptTo(Node.class) as the result is checked for Null a moment later. You do not need to support adaptTo(Node.class), which is a special case for Jcr. Best Regards Ian On 9 September 2013 06:05, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, I debug the servlet from line to line and locate the NPE that causes this failure. The request path SlingPostServlet AbstractCreateOperation ModifyOperation@line 105 where newResource = null. The resource resolver at this point is org.apache.sling.resourceresolver.impl.ResourceResolverImpl. 104 final Resource newResource = request.getResourceResolver().getResource(response.getPath()); 105 final Node newNode = *newResource*.adaptTo(Node.class); The resolver get a resource if the resource is already existing one(obviously). So either this should be a bug or my request goes through the wrong path. Please advice. On Mon, Sep 9, 2013 at 8:45 AM, Dishara Wijewardana ddwijeward...@gmail.com wrote: I also checked in Cassandra Provider impl and with system logs and verified the Error not comes due to exception throws from the Provider implementation itself. So probably it will be a missing a property. I still could not figure out which. If I can find which servlet get called I can debug and see(already post a mail to dev list). On Sun, Sep 8, 2013 at 5:10 AM, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, I found it difficult to use createNode method to work. It returns 200 response. I was trying to get this working but could not find a way. Probably I might be missing some properties. What I set was only content type to be json. What are the appropriate properties that you mentioned. How can someone get to know what are the properties required minimum to create a node. I debug and verified my create method gets hit in provider side. *P.S If I give a already existing path it works and gives 302 response. * i.e /content/cassandra/p1/c1 this works since it is already there. But /content/cassandra/pp/cc fails. I also tried adding /content/cassandra/pp first and then /content/cassandra/pp/cc. It fails at /content/cassandra/pp. Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 36.21 sec
Re: [Cassandra Resource] Create Update Sling Resource
Hi Ian Also commited the 3 new test classes for CUD to google code repo. On Tue, Sep 10, 2013 at 10:30 AM, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, Finally was able to fix ;-). Had to debug along with the path and fix some other issues also in Cassandra Provider impl. I have updated the JIRA with the new reports of CUD. (I ran them one after the other respectively) In brief as follows. CREATE Average Latency Under Node LA = 165 (ms) Average Latency Under Node MA = 203 (ms) Average Latency Under Node SA = 256 (ms) #TOTAL CALLS = 300 Total Average Latency = 208 (ms) UPDATE Average Latency Under Node LA = 36 (ms) Average Latency Under Node MA = 29 (ms) Average Latency Under Node SA = 25 (ms) #TOTAL CALLS = 300 Total Average Latency = 30 (ms) DELETE Average Latency Under Node LA = 20 (ms) Average Latency Under Node MA = 19 (ms) Average Latency Under Node SA = 19 (ms) #TOTAL CALLS = 300 Total Average Latency = 19 (ms) On Mon, Sep 9, 2013 at 5:47 PM, Ian Boston i...@tfd.co.uk wrote: Hi The CassandraImpl needs to return something suitable to represent /content/cassandra/p For the moment, if the column family p does exist, return a new type of read only resource, eg CassandraColumnFamilyResource. Ian On 9 September 2013 13:02, Dishara Wijewardana ddwijeward...@gmail.com wrote: On Mon, Sep 9, 2013 at 2:09 PM, Ian Boston i...@tfd.co.uk wrote: Hi, The call to processCreate a few lines earlier should have created the resource so that the subsequent call to getResource returned the new resource into newResource. If you look through the calls the create operation is called in org.apache.sling.servlets.post.impl.operations.AbstractCreateOperation.deepGetOrCreateNode(ResourceResolver, String, MapString, RequestProperty, ListModification, VersioningConfiguration) Line 533 resource = resolver.create(resource, name, props); Stick a breakpoint at that line and see, if its called, and if the resource resolver calls your code. Hi Ian, Yes it calls the create method. As I see the issue is the commit not getting called and hence resolver cannot get the created resource. So I thought of commit on the fly @create method to verify that. But we have a problem here. When I try to create /content/cassandra/p/c node, as you exactly mentioned before, it tries to create /content/cassandra/p node. In Cassandra Impl, there cannot be a node like /content/cassandra/p and hence returns NULL as earlier and still create fails. Because p is the column family (the model which we agreed and implemented). So what is the best approach to overcome this. BTW: Its Ok that there is a newResource.adaptTo(Node.class) as the result is checked for Null a moment later. You do not need to support adaptTo(Node.class), which is a special case for Jcr. Best Regards Ian On 9 September 2013 06:05, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, I debug the servlet from line to line and locate the NPE that causes this failure. The request path SlingPostServlet AbstractCreateOperation ModifyOperation@line105 where newResource = null. The resource resolver at this point is org.apache.sling.resourceresolver.impl.ResourceResolverImpl. 104 final Resource newResource = request.getResourceResolver().getResource(response.getPath()); 105 final Node newNode = *newResource*.adaptTo(Node.class); The resolver get a resource if the resource is already existing one(obviously). So either this should be a bug or my request goes through the wrong path. Please advice. On Mon, Sep 9, 2013 at 8:45 AM, Dishara Wijewardana ddwijeward...@gmail.com wrote: I also checked in Cassandra Provider impl and with system logs and verified the Error not comes due to exception throws from the Provider implementation itself. So probably it will be a missing a property. I still could not figure out which. If I can find which servlet get called I can debug and see(already post a mail to dev list). On Sun, Sep 8, 2013 at 5:10 AM, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, I found it difficult to use createNode method to work. It returns 200 response. I was trying to get this working but could not find a way. Probably I might be missing some properties. What I set was only content type to be json. What are the appropriate properties that you mentioned. How can someone get to know what are the properties required minimum to create a node. I debug and verified my create method gets hit in provider side. *P.S If I give a already existing path it works and gives 302 response. * i.e /content/cassandra/p1/c1 this works since it is already there. But /content/cassandra/pp/cc fails. I also tried adding
Re: [Cassandra Resource] Create Update Sling Resource
I also checked in Cassandra Provider impl and with system logs and verified the Error not comes due to exception throws from the Provider implementation itself. So probably it will be a missing a property. I still could not figure out which. If I can find which servlet get called I can debug and see(already post a mail to dev list). On Sun, Sep 8, 2013 at 5:10 AM, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, I found it difficult to use createNode method to work. It returns 200 response. I was trying to get this working but could not find a way. Probably I might be missing some properties. What I set was only content type to be json. What are the appropriate properties that you mentioned. How can someone get to know what are the properties required minimum to create a node. I debug and verified my create method gets hit in provider side. *P.S If I give a already existing path it works and gives 302 response. * i.e /content/cassandra/p1/c1 this works since it is already there. But /content/cassandra/pp/cc fails. I also tried adding /content/cassandra/pp first and then /content/cassandra/pp/cc. It fails at /content/cassandra/pp. Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 36.21 sec FAILURE! testResourceCreate(org.apache.sling.launchpad.webapp.integrationtest.resourceprovider.CassandraResourceCUDTest) Time elapsed: 36.187 sec ERROR! org.apache.sling.commons.testing.integration.HttpStatusCodeException: Expected status code 302 for POST, got 200, URL= http://localhost:8080/content/cassandra/pp/cc, Content=[html head titleError while processing /content/cassandra/pp/cc/title /head body h1Error while processing /content/cassandra/pp/cc/h1 table tbody tr tdStatus/td tddiv id=Status500/div/td /tr tr tdMessage/td tddiv id=Messagejava.lang.NullPointerException/div/td /tr tr tdLocation/td tda href=/cassandra/pp/cc id=Location/cassandra/pp/cc/a/td /tr tr tdParent Location/td tda href=/cassandra/pp id=ParentLocation/cassandra/pp/a/td /tr tr tdPath/td tddiv id=Path/content/cassandra/pp/cc/div/td /tr tr tdReferer/td tda href= id=Referer/a/td /tr tr tdChangeLog/td tddiv id=ChangeLoglt;pregt;lt;/pregt;/div/td /tr /tbody /table pa href=Go Back/a/p pa href=/cassandra/pp/ccModified Resource/a/p pa href=/cassandra/ppParent of Modified Resource/a/p /body /html] at org.apache.sling.commons.testing.integration.SlingIntegrationTestClient.createNode(SlingIntegrationTestClient.java:188) at org.apache.sling.commons.testing.integration.SlingIntegrationTestClient.createNode(SlingIntegrationTestClient.java:119) at org.apache.sling.commons.testing.integration.SlingIntegrationTestClient.createNode(SlingIntegrationTestClient.java:109) at org.apache.sling.launchpad.webapp.integrationtest.resourceprovider.CassandraResourceCUDTest.testResourceCreate(CassandraResourceCUDTest.java:29) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) at
Re: [Cassandra Resource] Create Update Sling Resource
Hi Ian, I debug the servlet from line to line and locate the NPE that causes this failure. The request path SlingPostServlet AbstractCreateOperation ModifyOperation@line 105 where newResource = null. The resource resolver at this point is org.apache.sling.resourceresolver.impl.ResourceResolverImpl. 104 final Resource newResource = request.getResourceResolver().getResource(response.getPath()); 105 final Node newNode = *newResource*.adaptTo(Node.class); The resolver get a resource if the resource is already existing one(obviously). So either this should be a bug or my request goes through the wrong path. Please advice. On Mon, Sep 9, 2013 at 8:45 AM, Dishara Wijewardana ddwijeward...@gmail.com wrote: I also checked in Cassandra Provider impl and with system logs and verified the Error not comes due to exception throws from the Provider implementation itself. So probably it will be a missing a property. I still could not figure out which. If I can find which servlet get called I can debug and see(already post a mail to dev list). On Sun, Sep 8, 2013 at 5:10 AM, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, I found it difficult to use createNode method to work. It returns 200 response. I was trying to get this working but could not find a way. Probably I might be missing some properties. What I set was only content type to be json. What are the appropriate properties that you mentioned. How can someone get to know what are the properties required minimum to create a node. I debug and verified my create method gets hit in provider side. *P.S If I give a already existing path it works and gives 302 response. * i.e /content/cassandra/p1/c1 this works since it is already there. But /content/cassandra/pp/cc fails. I also tried adding /content/cassandra/pp first and then /content/cassandra/pp/cc. It fails at /content/cassandra/pp. Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 36.21 sec FAILURE! testResourceCreate(org.apache.sling.launchpad.webapp.integrationtest.resourceprovider.CassandraResourceCUDTest) Time elapsed: 36.187 sec ERROR! org.apache.sling.commons.testing.integration.HttpStatusCodeException: Expected status code 302 for POST, got 200, URL= http://localhost:8080/content/cassandra/pp/cc, Content=[html head titleError while processing /content/cassandra/pp/cc/title /head body h1Error while processing /content/cassandra/pp/cc/h1 table tbody tr tdStatus/td tddiv id=Status500/div/td /tr tr tdMessage/td tddiv id=Messagejava.lang.NullPointerException/div/td /tr tr tdLocation/td tda href=/cassandra/pp/cc id=Location/cassandra/pp/cc/a/td /tr tr tdParent Location/td tda href=/cassandra/pp id=ParentLocation/cassandra/pp/a/td /tr tr tdPath/td tddiv id=Path/content/cassandra/pp/cc/div/td /tr tr tdReferer/td tda href= id=Referer/a/td /tr tr tdChangeLog/td tddiv id=ChangeLoglt;pregt;lt;/pregt;/div/td /tr /tbody /table pa href=Go Back/a/p pa href=/cassandra/pp/ccModified Resource/a/p pa href=/cassandra/ppParent of Modified Resource/a/p /body /html] at org.apache.sling.commons.testing.integration.SlingIntegrationTestClient.createNode(SlingIntegrationTestClient.java:188) at org.apache.sling.commons.testing.integration.SlingIntegrationTestClient.createNode(SlingIntegrationTestClient.java:119) at org.apache.sling.commons.testing.integration.SlingIntegrationTestClient.createNode(SlingIntegrationTestClient.java:109) at org.apache.sling.launchpad.webapp.integrationtest.resourceprovider.CassandraResourceCUDTest.testResourceCreate(CassandraResourceCUDTest.java:29) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81) at
Re: [Cassandra Resource] Create Update Sling Resource
Hi Ian, I found it difficult to use createNode method to work. It returns 200 response. I was trying to get this working but could not find a way. Probably I might be missing some properties. What I set was only content type to be json. What are the appropriate properties that you mentioned. How can someone get to know what are the properties required minimum to create a node. I debug and verified my create method gets hit in provider side. *P.S If I give a already existing path it works and gives 302 response. * i.e /content/cassandra/p1/c1 this works since it is already there. But /content/cassandra/pp/cc fails. I also tried adding /content/cassandra/pp first and then /content/cassandra/pp/cc. It fails at /content/cassandra/pp. Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 36.21 sec FAILURE! testResourceCreate(org.apache.sling.launchpad.webapp.integrationtest.resourceprovider.CassandraResourceCUDTest) Time elapsed: 36.187 sec ERROR! org.apache.sling.commons.testing.integration.HttpStatusCodeException: Expected status code 302 for POST, got 200, URL= http://localhost:8080/content/cassandra/pp/cc, Content=[html head titleError while processing /content/cassandra/pp/cc/title /head body h1Error while processing /content/cassandra/pp/cc/h1 table tbody tr tdStatus/td tddiv id=Status500/div/td /tr tr tdMessage/td tddiv id=Messagejava.lang.NullPointerException/div/td /tr tr tdLocation/td tda href=/cassandra/pp/cc id=Location/cassandra/pp/cc/a/td /tr tr tdParent Location/td tda href=/cassandra/pp id=ParentLocation/cassandra/pp/a/td /tr tr tdPath/td tddiv id=Path/content/cassandra/pp/cc/div/td /tr tr tdReferer/td tda href= id=Referer/a/td /tr tr tdChangeLog/td tddiv id=ChangeLoglt;pregt;lt;/pregt;/div/td /tr /tbody /table pa href=Go Back/a/p pa href=/cassandra/pp/ccModified Resource/a/p pa href=/cassandra/ppParent of Modified Resource/a/p /body /html] at org.apache.sling.commons.testing.integration.SlingIntegrationTestClient.createNode(SlingIntegrationTestClient.java:188) at org.apache.sling.commons.testing.integration.SlingIntegrationTestClient.createNode(SlingIntegrationTestClient.java:119) at org.apache.sling.commons.testing.integration.SlingIntegrationTestClient.createNode(SlingIntegrationTestClient.java:109) at org.apache.sling.launchpad.webapp.integrationtest.resourceprovider.CassandraResourceCUDTest.testResourceCreate(CassandraResourceCUDTest.java:29) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75) Results : Tests in error: testResourceCreate(org.apache.sling.launchpad.webapp.integrationtest.resourceprovider.CassandraResourceCUDTest): Expected status code 302 for POST, got 200, URL= http://localhost:8080/content/cassandra/pp/cc, Content=[html(..) Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [INFO]
Re: [Cassandra Resource] Create Update Sling Resource
Hi, Thanks, now I see how you're doing it. Its good. So to do a Write (CUD[1]) test, create another class that extends HttpBaseTest and write a test method that invokes testClient.createNode(...) with an appropriate set of properties and a collection managed by the CassandraProvider. You will probably need to create that collection first, and its parent, or better still, reuse the existing pre-populated collections since we are looking for the scalability of CUD relative to collection size. I think if you use createNode on an existing node it will update it, and there is a delete method as well. testClient is a org.apache.sling.commons.testing.integration.SlingIntegrationTestClient and is protected in HttpBaseTest so you should have access. As I said, perform CUD on 100 new nodes in each collection and print the results out. Obviously add all new code to you repository so its all in one place. Best Regards Ian 1 Create Update Delete (you've done read, we need stats for each of these operations) On 6 September 2013 04:31, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, Done. On Thu, Sep 5, 2013 at 10:53 AM, Ian Boston i...@tfd.co.uk wrote: Hi Dishara, On Thursday, September 5, 2013, Dishara Wijewardana wrote: Hi Ian, Did you mean the sling integration test (which runs the performance tests and provides reports) to move inside google code repo ? Yes please. Thanks Best regards Ian On Wed, Sep 4, 2013 at 5:41 PM, Ian Boston i...@tfd.co.uk wrote: On 4 September 2013 13:42, Dishara Wijewardana ddwijeward...@gmail.com wrote: HI Ian, On Wed, Sep 4, 2013 at 4:00 PM, Ian Boston i...@tfd.co.uk wrote: On 4 September 2013 12:20, Dishara Wijewardana ddwijeward...@gmail.com wrote: snip How long does it take to add, update and delete, 100 new items to the existing collections that you used for the read tests. If its quick, you may need to make that 1000 new items. Hi Ian, In the modify provider interface there is no update method. Am I missing something? You need to support adapTo(ModifyableValueMap.class) IIRC. I saw the interface ModifyableValueMap, but could not find a clear example usage of it as in PlanetResource case. But will see further. IIRC the MongoDB ResourceProvider allows modification. grep the Sling source code for it. Can you please elaborate more on exact scope and goals on what is expected from the new performance test class?Is it to capture the add/delete latency on nodes added in each collection. yes. If so, is it possible to test add/delete extending HTTPBase test as done for reading ? Or any other class that provides abstract test class/ APIs to add/delete ? Where are the classes that you used to perform the read tests, I cant see them in the repo ? The class that I used was org.apache.sling.commons.testing.integration.HttpTestBase . I have attached the patch of my class which extends this class. There I am usinf getContent() method of the base class to do HTTP get content operations. Could we get your test classes to run the load test into your repository please, even if its something that has to be run manually. Thanks Best Regards Ian Ian Best regards Ian Best Regards Ian On 3 September 2013 01:23, Dishara Wijewardana ddwijeward...@gmail.comjavascript:; wrote: Hi Ian, Thank you for the references. I just commited the changes. There I have completed the whole implementation of ModifyingResourceProvider interface for Cassandra Resource Provider (create, delete, commit , rollback etc) and wrote 3 test classes ( CassandraModifyResourceProvide**rAddTest, Cassan draModif-- Thanks /Dishara -- Thanks /Dishara
Re: [Cassandra Resource] Create Update Sling Resource
Hi Ian, Done. On Thu, Sep 5, 2013 at 10:53 AM, Ian Boston i...@tfd.co.uk wrote: Hi Dishara, On Thursday, September 5, 2013, Dishara Wijewardana wrote: Hi Ian, Did you mean the sling integration test (which runs the performance tests and provides reports) to move inside google code repo ? Yes please. Thanks Best regards Ian On Wed, Sep 4, 2013 at 5:41 PM, Ian Boston i...@tfd.co.uk wrote: On 4 September 2013 13:42, Dishara Wijewardana ddwijeward...@gmail.com wrote: HI Ian, On Wed, Sep 4, 2013 at 4:00 PM, Ian Boston i...@tfd.co.uk wrote: On 4 September 2013 12:20, Dishara Wijewardana ddwijeward...@gmail.com wrote: snip How long does it take to add, update and delete, 100 new items to the existing collections that you used for the read tests. If its quick, you may need to make that 1000 new items. Hi Ian, In the modify provider interface there is no update method. Am I missing something? You need to support adapTo(ModifyableValueMap.class) IIRC. I saw the interface ModifyableValueMap, but could not find a clear example usage of it as in PlanetResource case. But will see further. IIRC the MongoDB ResourceProvider allows modification. grep the Sling source code for it. Can you please elaborate more on exact scope and goals on what is expected from the new performance test class?Is it to capture the add/delete latency on nodes added in each collection. yes. If so, is it possible to test add/delete extending HTTPBase test as done for reading ? Or any other class that provides abstract test class/ APIs to add/delete ? Where are the classes that you used to perform the read tests, I cant see them in the repo ? The class that I used was org.apache.sling.commons.testing.integration.HttpTestBase . I have attached the patch of my class which extends this class. There I am usinf getContent() method of the base class to do HTTP get content operations. Could we get your test classes to run the load test into your repository please, even if its something that has to be run manually. Thanks Best Regards Ian Ian Best regards Ian Best Regards Ian On 3 September 2013 01:23, Dishara Wijewardana ddwijeward...@gmail.comjavascript:; wrote: Hi Ian, Thank you for the references. I just commited the changes. There I have completed the whole implementation of ModifyingResourceProvider interface for Cassandra Resource Provider (create, delete, commit , rollback etc) and wrote 3 test classes ( CassandraModifyResourceProvide**rAddTest, Cassan draModif-- Thanks /Dishara -- Thanks /Dishara
Re: [Cassandra Resource] Create Update Sling Resource
On Wednesday, September 4, 2013, Dishara Wijewardana wrote: On Tue, Sep 3, 2013 at 12:23 PM, Ian Boston i...@tfd.co.uk javascript:; wrote: Hi, That sounds excellent, well done. Next steps, test it with curl eg: curl -Ftestproperty=testvalue http://admin:admin@localhost:8080/cassandra/F/23423424 and then check that the value was persisted with curl http://admin:admin@localhost:8080/cassandra/F/23423424.json Then check update is good with curl -Ftestproperty=updatedvalue http://admin:admin@localhost:8080/cassandra/F/23423424 And if that checks out ok, Hi Ian Yes it worked as expected :-). Lucky I didn't went in to any trouble this time. It just worked. Great, good work. then adapt your load test to first create 10,100,1000,1, etc child resources in new sub folders, and run the tests to get some statistics. Done. Commited the changes. Now it load collections through CassandraResourceProvider API. No more manually column family creations and etc prior to add data. Ran the integration test again and it has not much difference than earlier and hence I did not post the results. It makes sense, because I did nothing related to improve the READ behavior. Great. Can you add a performance test here as well. How long does it take to add, update and delete, 100 new items to the existing collections that you used for the read tests. If its quick, you may need to make that 1000 new items. Best regards Ian Best Regards Ian On 3 September 2013 01:23, Dishara Wijewardana ddwijeward...@gmail.comjavascript:; wrote: Hi Ian, Thank you for the references. I just commited the changes. There I have completed the whole implementation of ModifyingResourceProvider interface for Cassandra Resource Provider (create, delete, commit , rollback etc) and wrote 3 test classes ( CassandraModifyResourceProvide**rAddTest, Cassan draModifyResourceProvide**rDeleteTest ,CassandraModifyResourceProvide** rRevertTest) which covers all. With my local cql command prompt, I manually verified that commit and revert properly works. Thanks On Fri, Aug 30, 2013 at 12:57 PM, Ian Boston i...@tfd.co.ukjavascript:; wrote: Hi, Have a look at org.apache.sling.api.resource.ModifyingResourceProvider The CassandraResourceProvider now needs to implement ModifyingResourceProvider which extends ResourceProvider adding create update and delete methods. Don't assume assume that the resource you are given in these methods is a CassandraResource, it could be the parent of the Cassandra resource tree. If you need an example to follow, have a look at [1]. Best Regards Ian 1 contrib/extensions/mongodb/src/main/java/org/apache/sling/mongodb/impl/MongoDBResourceProvider.java On 30 August 2013 00:22, Dishara Wijewardana ddwijeward...@gmail.comjavascript:; wrote: Hi, This is to track down $subject. Can you provide some guidance on how to do this. ResourceProvider is only for providing. Who is responsible for create and update resources ? Any reference to follow ? -- Thanks /Dishara -- Thanks /Dishara -- Thanks /Dishara
Re: [Cassandra Resource] Create Update Sling Resource
On Wed, Sep 4, 2013 at 12:00 PM, Ian Boston i...@tfd.co.uk wrote: On Wednesday, September 4, 2013, Dishara Wijewardana wrote: On Tue, Sep 3, 2013 at 12:23 PM, Ian Boston i...@tfd.co.ukjavascript:; wrote: Hi, That sounds excellent, well done. Next steps, test it with curl eg: curl -Ftestproperty=testvalue http://admin:admin@localhost:8080/cassandra/F/23423424 and then check that the value was persisted with curl http://admin:admin@localhost:8080/cassandra/F/23423424.json Then check update is good with curl -Ftestproperty=updatedvalue http://admin:admin@localhost:8080/cassandra/F/23423424 And if that checks out ok, Hi Ian Yes it worked as expected :-). Lucky I didn't went in to any trouble this time. It just worked. Great, good work. then adapt your load test to first create 10,100,1000,1, etc child resources in new sub folders, and run the tests to get some statistics. Done. Commited the changes. Now it load collections through CassandraResourceProvider API. No more manually column family creations and etc prior to add data. Ran the integration test again and it has not much difference than earlier and hence I did not post the results. It makes sense, because I did nothing related to improve the READ behavior. Great. Can you add a performance test here as well. How long does it take to add, update and delete, 100 new items to the existing collections that you used for the read tests. If its quick, you may need to make that 1000 new items. Hi Ian, In the modify provider interface there is no update method. Am I missing something? Can you please elaborate more on exact scope and goals on what is expected from the new performance test class?Is it to capture the add/delete latency on nodes added in each collection. If so, is it possible to test add/delete extending HTTPBase test as done for reading ? Or any other class that provides abstract test class/ APIs to add/delete ? Best regards Ian Best Regards Ian On 3 September 2013 01:23, Dishara Wijewardana ddwijeward...@gmail.comjavascript:; wrote: Hi Ian, Thank you for the references. I just commited the changes. There I have completed the whole implementation of ModifyingResourceProvider interface for Cassandra Resource Provider (create, delete, commit , rollback etc) and wrote 3 test classes ( CassandraModifyResourceProvide**rAddTest, Cassan draModifyResourceProvide**rDeleteTest ,CassandraModifyResourceProvide** rRevertTest) which covers all. With my local cql command prompt, I manually verified that commit and revert properly works. Thanks On Fri, Aug 30, 2013 at 12:57 PM, Ian Boston i...@tfd.co.uk javascript:; wrote: Hi, Have a look at org.apache.sling.api.resource.ModifyingResourceProvider The CassandraResourceProvider now needs to implement ModifyingResourceProvider which extends ResourceProvider adding create update and delete methods. Don't assume assume that the resource you are given in these methods is a CassandraResource, it could be the parent of the Cassandra resource tree. If you need an example to follow, have a look at [1]. Best Regards Ian 1 contrib/extensions/mongodb/src/main/java/org/apache/sling/mongodb/impl/MongoDBResourceProvider.java On 30 August 2013 00:22, Dishara Wijewardana ddwijeward...@gmail.comjavascript:; wrote: Hi, This is to track down $subject. Can you provide some guidance on how to do this. ResourceProvider is only for providing. Who is responsible for create and update resources ? Any reference to follow ? -- Thanks /Dishara -- Thanks /Dishara -- Thanks /Dishara -- Thanks /Dishara
Re: [Cassandra Resource] Create Update Sling Resource
On 4 September 2013 12:20, Dishara Wijewardana ddwijeward...@gmail.com wrote: snip How long does it take to add, update and delete, 100 new items to the existing collections that you used for the read tests. If its quick, you may need to make that 1000 new items. Hi Ian, In the modify provider interface there is no update method. Am I missing something? You need to support adapTo(ModifyableValueMap.class) IIRC. Can you please elaborate more on exact scope and goals on what is expected from the new performance test class?Is it to capture the add/delete latency on nodes added in each collection. yes. If so, is it possible to test add/delete extending HTTPBase test as done for reading ? Or any other class that provides abstract test class/ APIs to add/delete ? Where are the classes that you used to perform the read tests, I cant see them in the repo ? Ian Best regards Ian Best Regards Ian On 3 September 2013 01:23, Dishara Wijewardana ddwijeward...@gmail.comjavascript:; wrote: Hi Ian, Thank you for the references. I just commited the changes. There I have completed the whole implementation of ModifyingResourceProvider interface for Cassandra Resource Provider (create, delete, commit , rollback etc) and wrote 3 test classes ( CassandraModifyResourceProvide**rAddTest, Cassan draModifyResourceProvide**rDeleteTest ,CassandraModifyResourceProvide** rRevertTest) which covers all. With my local cql command prompt, I manually verified that commit and revert properly works. Thanks On Fri, Aug 30, 2013 at 12:57 PM, Ian Boston i...@tfd.co.uk javascript:; wrote: Hi, Have a look at org.apache.sling.api.resource.ModifyingResourceProvider The CassandraResourceProvider now needs to implement ModifyingResourceProvider which extends ResourceProvider adding create update and delete methods. Don't assume assume that the resource you are given in these methods is a CassandraResource, it could be the parent of the Cassandra resource tree. If you need an example to follow, have a look at [1]. Best Regards Ian 1 contrib/extensions/mongodb/src/main/java/org/apache/sling/mongodb/impl/MongoDBResourceProvider.java On 30 August 2013 00:22, Dishara Wijewardana ddwijeward...@gmail.comjavascript:; wrote: Hi, This is to track down $subject. Can you provide some guidance on how to do this. ResourceProvider is only for providing. Who is responsible for create and update resources ? Any reference to follow ? -- Thanks /Dishara -- Thanks /Dishara -- Thanks /Dishara -- Thanks /Dishara
Re: [Cassandra Resource] Create Update Sling Resource
HI Ian, On Wed, Sep 4, 2013 at 4:00 PM, Ian Boston i...@tfd.co.uk wrote: On 4 September 2013 12:20, Dishara Wijewardana ddwijeward...@gmail.com wrote: snip How long does it take to add, update and delete, 100 new items to the existing collections that you used for the read tests. If its quick, you may need to make that 1000 new items. Hi Ian, In the modify provider interface there is no update method. Am I missing something? You need to support adapTo(ModifyableValueMap.class) IIRC. I saw the interface ModifyableValueMap, but could not find a clear example usage of it as in PlanetResource case. But will see further. Can you please elaborate more on exact scope and goals on what is expected from the new performance test class?Is it to capture the add/delete latency on nodes added in each collection. yes. If so, is it possible to test add/delete extending HTTPBase test as done for reading ? Or any other class that provides abstract test class/ APIs to add/delete ? Where are the classes that you used to perform the read tests, I cant see them in the repo ? The class that I used was org.apache.sling.commons.testing.integration.HttpTestBase . I have attached the patch of my class which extends this class. There I am usinf getContent() method of the base class to do HTTP get content operations. Ian Best regards Ian Best Regards Ian On 3 September 2013 01:23, Dishara Wijewardana ddwijeward...@gmail.comjavascript:; wrote: Hi Ian, Thank you for the references. I just commited the changes. There I have completed the whole implementation of ModifyingResourceProvider interface for Cassandra Resource Provider (create, delete, commit , rollback etc) and wrote 3 test classes ( CassandraModifyResourceProvide**rAddTest, Cassan draModifyResourceProvide**rDeleteTest ,CassandraModifyResourceProvide** rRevertTest) which covers all. With my local cql command prompt, I manually verified that commit and revert properly works. Thanks On Fri, Aug 30, 2013 at 12:57 PM, Ian Boston i...@tfd.co.uk javascript:; wrote: Hi, Have a look at org.apache.sling.api.resource.ModifyingResourceProvider The CassandraResourceProvider now needs to implement ModifyingResourceProvider which extends ResourceProvider adding create update and delete methods. Don't assume assume that the resource you are given in these methods is a CassandraResource, it could be the parent of the Cassandra resource tree. If you need an example to follow, have a look at [1]. Best Regards Ian 1 contrib/extensions/mongodb/src/main/java/org/apache/sling/mongodb/impl/MongoDBResourceProvider.java On 30 August 2013 00:22, Dishara Wijewardana ddwijeward...@gmail.comjavascript:; wrote: Hi, This is to track down $subject. Can you provide some guidance on how to do this. ResourceProvider is only for providing. Who is responsible for create and update resources ? Any reference to follow ? -- Thanks /Dishara -- Thanks /Dishara -- Thanks /Dishara -- Thanks /Dishara -- Thanks /Dishara
Re: [Cassandra Resource] Create Update Sling Resource
On 4 September 2013 13:42, Dishara Wijewardana ddwijeward...@gmail.com wrote: HI Ian, On Wed, Sep 4, 2013 at 4:00 PM, Ian Boston i...@tfd.co.uk wrote: On 4 September 2013 12:20, Dishara Wijewardana ddwijeward...@gmail.com wrote: snip How long does it take to add, update and delete, 100 new items to the existing collections that you used for the read tests. If its quick, you may need to make that 1000 new items. Hi Ian, In the modify provider interface there is no update method. Am I missing something? You need to support adapTo(ModifyableValueMap.class) IIRC. I saw the interface ModifyableValueMap, but could not find a clear example usage of it as in PlanetResource case. But will see further. IIRC the MongoDB ResourceProvider allows modification. grep the Sling source code for it. Can you please elaborate more on exact scope and goals on what is expected from the new performance test class?Is it to capture the add/delete latency on nodes added in each collection. yes. If so, is it possible to test add/delete extending HTTPBase test as done for reading ? Or any other class that provides abstract test class/ APIs to add/delete ? Where are the classes that you used to perform the read tests, I cant see them in the repo ? The class that I used was org.apache.sling.commons.testing.integration.HttpTestBase . I have attached the patch of my class which extends this class. There I am usinf getContent() method of the base class to do HTTP get content operations. Could we get your test classes to run the load test into your repository please, even if its something that has to be run manually. Thanks Best Regards Ian Ian Best regards Ian Best Regards Ian On 3 September 2013 01:23, Dishara Wijewardana ddwijeward...@gmail.comjavascript:; wrote: Hi Ian, Thank you for the references. I just commited the changes. There I have completed the whole implementation of ModifyingResourceProvider interface for Cassandra Resource Provider (create, delete, commit , rollback etc) and wrote 3 test classes ( CassandraModifyResourceProvide**rAddTest, Cassan draModifyResourceProvide**rDeleteTest ,CassandraModifyResourceProvide** rRevertTest) which covers all. With my local cql command prompt, I manually verified that commit and revert properly works. Thanks On Fri, Aug 30, 2013 at 12:57 PM, Ian Boston i...@tfd.co.uk javascript:; wrote: Hi, Have a look at org.apache.sling.api.resource.ModifyingResourceProvider The CassandraResourceProvider now needs to implement ModifyingResourceProvider which extends ResourceProvider adding create update and delete methods. Don't assume assume that the resource you are given in these methods is a CassandraResource, it could be the parent of the Cassandra resource tree. If you need an example to follow, have a look at [1]. Best Regards Ian 1 contrib/extensions/mongodb/src/main/java/org/apache/sling/mongodb/impl/MongoDBResourceProvider.java On 30 August 2013 00:22, Dishara Wijewardana ddwijeward...@gmail.comjavascript:; wrote: Hi, This is to track down $subject. Can you provide some guidance on how to do this. ResourceProvider is only for providing. Who is responsible for create and update resources ? Any reference to follow ? -- Thanks /Dishara -- Thanks /Dishara -- Thanks /Dishara -- Thanks /Dishara -- Thanks /Dishara
Re: [Cassandra Resource] Create Update Sling Resource
Hi Ian, Did you mean the sling integration test (which runs the performance tests and provides reports) to move inside google code repo ? On Wed, Sep 4, 2013 at 5:41 PM, Ian Boston i...@tfd.co.uk wrote: On 4 September 2013 13:42, Dishara Wijewardana ddwijeward...@gmail.com wrote: HI Ian, On Wed, Sep 4, 2013 at 4:00 PM, Ian Boston i...@tfd.co.uk wrote: On 4 September 2013 12:20, Dishara Wijewardana ddwijeward...@gmail.com wrote: snip How long does it take to add, update and delete, 100 new items to the existing collections that you used for the read tests. If its quick, you may need to make that 1000 new items. Hi Ian, In the modify provider interface there is no update method. Am I missing something? You need to support adapTo(ModifyableValueMap.class) IIRC. I saw the interface ModifyableValueMap, but could not find a clear example usage of it as in PlanetResource case. But will see further. IIRC the MongoDB ResourceProvider allows modification. grep the Sling source code for it. Can you please elaborate more on exact scope and goals on what is expected from the new performance test class?Is it to capture the add/delete latency on nodes added in each collection. yes. If so, is it possible to test add/delete extending HTTPBase test as done for reading ? Or any other class that provides abstract test class/ APIs to add/delete ? Where are the classes that you used to perform the read tests, I cant see them in the repo ? The class that I used was org.apache.sling.commons.testing.integration.HttpTestBase . I have attached the patch of my class which extends this class. There I am usinf getContent() method of the base class to do HTTP get content operations. Could we get your test classes to run the load test into your repository please, even if its something that has to be run manually. Thanks Best Regards Ian Ian Best regards Ian Best Regards Ian On 3 September 2013 01:23, Dishara Wijewardana ddwijeward...@gmail.comjavascript:; wrote: Hi Ian, Thank you for the references. I just commited the changes. There I have completed the whole implementation of ModifyingResourceProvider interface for Cassandra Resource Provider (create, delete, commit , rollback etc) and wrote 3 test classes ( CassandraModifyResourceProvide**rAddTest, Cassan draModifyResourceProvide**rDeleteTest ,CassandraModifyResourceProvide** rRevertTest) which covers all. With my local cql command prompt, I manually verified that commit and revert properly works. Thanks On Fri, Aug 30, 2013 at 12:57 PM, Ian Boston i...@tfd.co.uk javascript:; wrote: Hi, Have a look at org.apache.sling.api.resource.ModifyingResourceProvider The CassandraResourceProvider now needs to implement ModifyingResourceProvider which extends ResourceProvider adding create update and delete methods. Don't assume assume that the resource you are given in these methods is a CassandraResource, it could be the parent of the Cassandra resource tree. If you need an example to follow, have a look at [1]. Best Regards Ian 1 contrib/extensions/mongodb/src/main/java/org/apache/sling/mongodb/impl/MongoDBResourceProvider.java On 30 August 2013 00:22, Dishara Wijewardana ddwijeward...@gmail.comjavascript:; wrote: Hi, This is to track down $subject. Can you provide some guidance on how to do this. ResourceProvider is only for providing. Who is responsible for create and update resources ? Any reference to follow ? -- Thanks /Dishara -- Thanks /Dishara -- Thanks /Dishara -- Thanks /Dishara -- Thanks /Dishara -- Thanks /Dishara
Re: [Cassandra Resource] Create Update Sling Resource
Hi Dishara, On Thursday, September 5, 2013, Dishara Wijewardana wrote: Hi Ian, Did you mean the sling integration test (which runs the performance tests and provides reports) to move inside google code repo ? Yes please. Thanks Best regards Ian On Wed, Sep 4, 2013 at 5:41 PM, Ian Boston i...@tfd.co.uk wrote: On 4 September 2013 13:42, Dishara Wijewardana ddwijeward...@gmail.com wrote: HI Ian, On Wed, Sep 4, 2013 at 4:00 PM, Ian Boston i...@tfd.co.uk wrote: On 4 September 2013 12:20, Dishara Wijewardana ddwijeward...@gmail.com wrote: snip How long does it take to add, update and delete, 100 new items to the existing collections that you used for the read tests. If its quick, you may need to make that 1000 new items. Hi Ian, In the modify provider interface there is no update method. Am I missing something? You need to support adapTo(ModifyableValueMap.class) IIRC. I saw the interface ModifyableValueMap, but could not find a clear example usage of it as in PlanetResource case. But will see further. IIRC the MongoDB ResourceProvider allows modification. grep the Sling source code for it. Can you please elaborate more on exact scope and goals on what is expected from the new performance test class?Is it to capture the add/delete latency on nodes added in each collection. yes. If so, is it possible to test add/delete extending HTTPBase test as done for reading ? Or any other class that provides abstract test class/ APIs to add/delete ? Where are the classes that you used to perform the read tests, I cant see them in the repo ? The class that I used was org.apache.sling.commons.testing.integration.HttpTestBase . I have attached the patch of my class which extends this class. There I am usinf getContent() method of the base class to do HTTP get content operations. Could we get your test classes to run the load test into your repository please, even if its something that has to be run manually. Thanks Best Regards Ian Ian Best regards Ian Best Regards Ian On 3 September 2013 01:23, Dishara Wijewardana ddwijeward...@gmail.comjavascript:; wrote: Hi Ian, Thank you for the references. I just commited the changes. There I have completed the whole implementation of ModifyingResourceProvider interface for Cassandra Resource Provider (create, delete, commit , rollback etc) and wrote 3 test classes ( CassandraModifyResourceProvide**rAddTest, Cassan draModif-- Thanks /Dishara
Re: [Cassandra Resource] Create Update Sling Resource
Hi, That sounds excellent, well done. Next steps, test it with curl eg: curl -Ftestproperty=testvalue http://admin:admin@localhost:8080/cassandra/F/23423424 and then check that the value was persisted with curl http://admin:admin@localhost:8080/cassandra/F/23423424.json Then check update is good with curl -Ftestproperty=updatedvalue http://admin:admin@localhost:8080/cassandra/F/23423424 And if that checks out ok, then adapt your load test to first create 10,100,1000,1, etc child resources in new sub folders, and run the tests to get some statistics. Best Regards Ian On 3 September 2013 01:23, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, Thank you for the references. I just commited the changes. There I have completed the whole implementation of ModifyingResourceProvider interface for Cassandra Resource Provider (create, delete, commit , rollback etc) and wrote 3 test classes ( CassandraModifyResourceProvide**rAddTest, Cassan draModifyResourceProvide**rDeleteTest ,CassandraModifyResourceProvide** rRevertTest) which covers all. With my local cql command prompt, I manually verified that commit and revert properly works. Thanks On Fri, Aug 30, 2013 at 12:57 PM, Ian Boston i...@tfd.co.uk wrote: Hi, Have a look at org.apache.sling.api.resource.ModifyingResourceProvider The CassandraResourceProvider now needs to implement ModifyingResourceProvider which extends ResourceProvider adding create update and delete methods. Don't assume assume that the resource you are given in these methods is a CassandraResource, it could be the parent of the Cassandra resource tree. If you need an example to follow, have a look at [1]. Best Regards Ian 1 contrib/extensions/mongodb/src/main/java/org/apache/sling/mongodb/impl/MongoDBResourceProvider.java On 30 August 2013 00:22, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi, This is to track down $subject. Can you provide some guidance on how to do this. ResourceProvider is only for providing. Who is responsible for create and update resources ? Any reference to follow ? -- Thanks /Dishara -- Thanks /Dishara
Re: [Cassandra Resource] Create Update Sling Resource
On Tue, Sep 3, 2013 at 12:23 PM, Ian Boston i...@tfd.co.uk wrote: Hi, That sounds excellent, well done. Next steps, test it with curl eg: curl -Ftestproperty=testvalue http://admin:admin@localhost:8080/cassandra/F/23423424 and then check that the value was persisted with curl http://admin:admin@localhost:8080/cassandra/F/23423424.json Then check update is good with curl -Ftestproperty=updatedvalue http://admin:admin@localhost:8080/cassandra/F/23423424 And if that checks out ok, Hi Ian Yes it worked as expected :-). Lucky I didn't went in to any trouble this time. It just worked. then adapt your load test to first create 10,100,1000,1, etc child resources in new sub folders, and run the tests to get some statistics. Done. Commited the changes. Now it load collections through CassandraResourceProvider API. No more manually column family creations and etc prior to add data. Ran the integration test again and it has not much difference than earlier and hence I did not post the results. It makes sense, because I did nothing related to improve the READ behavior. Best Regards Ian On 3 September 2013 01:23, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi Ian, Thank you for the references. I just commited the changes. There I have completed the whole implementation of ModifyingResourceProvider interface for Cassandra Resource Provider (create, delete, commit , rollback etc) and wrote 3 test classes ( CassandraModifyResourceProvide**rAddTest, Cassan draModifyResourceProvide**rDeleteTest ,CassandraModifyResourceProvide** rRevertTest) which covers all. With my local cql command prompt, I manually verified that commit and revert properly works. Thanks On Fri, Aug 30, 2013 at 12:57 PM, Ian Boston i...@tfd.co.uk wrote: Hi, Have a look at org.apache.sling.api.resource.ModifyingResourceProvider The CassandraResourceProvider now needs to implement ModifyingResourceProvider which extends ResourceProvider adding create update and delete methods. Don't assume assume that the resource you are given in these methods is a CassandraResource, it could be the parent of the Cassandra resource tree. If you need an example to follow, have a look at [1]. Best Regards Ian 1 contrib/extensions/mongodb/src/main/java/org/apache/sling/mongodb/impl/MongoDBResourceProvider.java On 30 August 2013 00:22, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi, This is to track down $subject. Can you provide some guidance on how to do this. ResourceProvider is only for providing. Who is responsible for create and update resources ? Any reference to follow ? -- Thanks /Dishara -- Thanks /Dishara -- Thanks /Dishara
Re: [Cassandra Resource] Create Update Sling Resource
Hi Ian, Thank you for the references. I just commited the changes. There I have completed the whole implementation of ModifyingResourceProvider interface for Cassandra Resource Provider (create, delete, commit , rollback etc) and wrote 3 test classes ( CassandraModifyResourceProvide**rAddTest, Cassan draModifyResourceProvide**rDeleteTest ,CassandraModifyResourceProvide** rRevertTest) which covers all. With my local cql command prompt, I manually verified that commit and revert properly works. Thanks On Fri, Aug 30, 2013 at 12:57 PM, Ian Boston i...@tfd.co.uk wrote: Hi, Have a look at org.apache.sling.api.resource.ModifyingResourceProvider The CassandraResourceProvider now needs to implement ModifyingResourceProvider which extends ResourceProvider adding create update and delete methods. Don't assume assume that the resource you are given in these methods is a CassandraResource, it could be the parent of the Cassandra resource tree. If you need an example to follow, have a look at [1]. Best Regards Ian 1 contrib/extensions/mongodb/src/main/java/org/apache/sling/mongodb/impl/MongoDBResourceProvider.java On 30 August 2013 00:22, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi, This is to track down $subject. Can you provide some guidance on how to do this. ResourceProvider is only for providing. Who is responsible for create and update resources ? Any reference to follow ? -- Thanks /Dishara -- Thanks /Dishara
Re: [Cassandra Resource] Create Update Sling Resource
Hi, Have a look at org.apache.sling.api.resource.ModifyingResourceProvider The CassandraResourceProvider now needs to implement ModifyingResourceProvider which extends ResourceProvider adding create update and delete methods. Don't assume assume that the resource you are given in these methods is a CassandraResource, it could be the parent of the Cassandra resource tree. If you need an example to follow, have a look at [1]. Best Regards Ian 1 contrib/extensions/mongodb/src/main/java/org/apache/sling/mongodb/impl/MongoDBResourceProvider.java On 30 August 2013 00:22, Dishara Wijewardana ddwijeward...@gmail.com wrote: Hi, This is to track down $subject. Can you provide some guidance on how to do this. ResourceProvider is only for providing. Who is responsible for create and update resources ? Any reference to follow ? -- Thanks /Dishara
[Cassandra Resource] Create Update Sling Resource
Hi, This is to track down $subject. Can you provide some guidance on how to do this. ResourceProvider is only for providing. Who is responsible for create and update resources ? Any reference to follow ? -- Thanks /Dishara