Initial design / flow for REST handler. #146

merged 32 commits into from Mar 6, 2013


None yet
4 participants

boneill42 commented Mar 6, 2013

Take a look, let me know what you think. Thus far, I implemented listKeyspaces.
(I started on listColumnFamilies, but noticed that we don't have a handler for that yet.)
(Is someone working on that?)

The design: (picking up where Nate left off)
IntraHandlerRest handles the request. (patterned after IntraHandlerJson)
It delegates to IntraHandlerRestUtils, which translates the HttpRequest into the appropriate IntraReq + IntraOp. It then fires off an event of type "request.json", res-using the rest of the underlying infrastructure.

We may want to translate the response as well, but I haven't gotten that far yet.

I'm definitely open to critique here.

I need to add unit tests. To ensure I got the whole flow correct, I was using the curl shell scripts to test.

edwardcapriolo and others added some commits Mar 2, 2013

@edwardcapriolo edwardcapriolo Merge pull request #137 from zznate/virgil-rest-handler
Virgil rest handler
@jsanda jsanda if column name/value is a byte buffer convert to byte array before st…
…oring in json
@edwardcapriolo edwardcapriolo Merge pull request #138 from jsanda/fix-compositeTest
fix IntraServiceITest.compositeTest
@jsanda jsanda fixing CQL tests in IntraServiceITest
Also adding back logic in CqlQueryHandler for not transposing query results.
@edwardcapriolo edwardcapriolo Merge pull request #139 from jsanda/fix-cql-tests
fixing CQL tests in IntraServiceITest
@edwardcapriolo edwardcapriolo ass ume 8b841d8
@edwardcapriolo edwardcapriolo Fix bugs where assume can not handle assumptions for more then one cf c5fa658
@edwardcapriolo edwardcapriolo Merge pull request #140 from zznate/assumefix
@edwardcapriolo edwardcapriolo FIxed batch set a9b19b7
@edwardcapriolo edwardcapriolo Merge pull request #141 from zznate/fixbatch
FIxed batch set
@edwardcapriolo edwardcapriolo Plumbing 9c83989
@edwardcapriolo edwardcapriolo Processing 43e1e7b
@edwardcapriolo edwardcapriolo f yea processors baby f1ddfda
@edwardcapriolo edwardcapriolo Les printing more processing b5bd18b
@edwardcapriolo edwardcapriolo Fixed this one too 621b69f
@boneill42 boneill42 Moved port number to a static, and added it to the server start log m…
@boneill42 boneill42 Updated yaml to use 1.2's authorizer. 86f6168
@boneill42 boneill42 Issue #61
Here is my best stab at an eclipse style xml.

Java Conventionts + 2 space indent + spaces only + 120 character line width
@boneill42 boneill42 Removing eclipse file. (just saw the one added in src/main/resources) c9e5c70
@boneill42 boneill42 Example shell scripts demonstrating curl commands that perform the op…
@boneill42 boneill42 Fixed error handling for existing keyspace.
(To reproduce, run examples/ twice)

The exceptionId was an integer, but we were expecting a String.
@boneill42 boneill42 Protecting against NPE in the request handler.
Not sure why there is no opResult, but we probably want to avoid hitting an NPE.
@edwardcapriolo edwardcapriolo Merge pull request #143 from boneill42/virgil-rest-handler
Example shell scripts (curl's) and a couple other cleanups.
jsanda Merge pull request #145 from zznate/processorfix
@edwardcapriolo edwardcapriolo Process fix 09dbfb9
@boneill42 boneill42 Implementing Set operaiton for REST handler. 30886c6
@boneill42 boneill42 Merge branch 'master' of into virgil-r…
@boneill42 boneill42 Switched to use IntraReq (vs. JsonObject directly) 6c0f67b
@boneill42 boneill42 Working list keyspaces! 96ab5c5
@boneill42 boneill42 Removed extra imports (beginnings of list CFs) 6dcefae
@boneill42 boneill42 Example curl for list column families. 4399130
@boneill42 boneill42 Added import statement to pull in CreateProcessorHandler. 61f12fb

boneill42 commented Mar 6, 2013

Note -- merging this into the virgil-rest-branch (keeping it out of master until it is of acceptable quality, w/ unit test coverage)

zznate merged commit 04481d2 into zznate:virgil-rest-handler Mar 6, 2013


zznate commented Mar 6, 2013

Thats fine. I only added the keyspaces handler as proof of concept. Ill fill in a few more o the plane tomorrow.
Quick question though @boneill42 why patch on some of the virgil methods as opposed to put/post?


boneill42 commented Mar 6, 2013

RE: Patch
That was a suggestion from David Strauss (over at Pantheon).
See the original issue he submitted:

Strictly interpreting HTTP semantics, PATCH is the right thing to do, but I'm open to sticking with the more traditional methods though. (since some clients don't easily allow for PATCH methods yet)


zznate commented Mar 6, 2013

Was curious. Agree that PATCH is syntactically correct, but pragmatism dictates POST and PUT support as well.

That said, primary goal is to have virgil compatibility, so the other methods are just syntactical suger we can add in later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment