Initial design / flow for REST handler. #146

Merged
merged 32 commits into from Mar 6, 2013

Conversation

Projects
None yet
4 participants
Collaborator

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
aefbe40
@jsanda jsanda if column name/value is a byte buffer convert to byte array before st…
…oring in json
f10970a
@edwardcapriolo edwardcapriolo Merge pull request #138 from jsanda/fix-compositeTest
fix IntraServiceITest.compositeTest
06ca864
@jsanda jsanda fixing CQL tests in IntraServiceITest
Also adding back logic in CqlQueryHandler for not transposing query results.
bf5ddbe
@edwardcapriolo edwardcapriolo Merge pull request #139 from jsanda/fix-cql-tests
fixing CQL tests in IntraServiceITest
8f54f1e
@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
Assumefix
711f8e3
@edwardcapriolo edwardcapriolo FIxed batch set a9b19b7
@edwardcapriolo edwardcapriolo Merge pull request #141 from zznate/fixbatch
FIxed batch set
eef2462
@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…
…essage.
e2d8c07
@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
f7d4f78
@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…
…erations.
9a5733a
@boneill42 boneill42 Fixed error handling for existing keyspace.
(To reproduce, run examples/create_keyspace.sh twice)

The exceptionId was an integer, but we were expecting a String.
76cc5bb
@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.
d12f7ec
@edwardcapriolo edwardcapriolo Merge pull request #143 from boneill42/virgil-rest-handler
Example shell scripts (curl's) and a couple other cleanups.
0e937a9
jsanda Merge pull request #145 from zznate/processorfix
Processorfix
553fe35
@edwardcapriolo edwardcapriolo Process fix 09dbfb9
@boneill42 boneill42 Implementing Set operaiton for REST handler. 30886c6
@boneill42 boneill42 Merge branch 'master' of github.com:zznate/intravert-ug into virgil-r…
…est-handler
7e54330
@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
Collaborator

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

Owner

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?

Collaborator

boneill42 commented Mar 6, 2013

RE: Patch
That was a suggestion from David Strauss (over at Pantheon).
See the original issue he submitted:
http://code.google.com/a/apache-extras.org/p/virgil/issues/detail?id=3&can=1

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)

Owner

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