-
Notifications
You must be signed in to change notification settings - Fork 14
Home
See the README for a detailed introduction, for information on individual features see the Detailed Documentation.
Please note: We have not had an official 1.0 release. This documentation currently serves as a starting point for developers and users interested in the project. However because we have not had an official release and are actively hacking on the project some of this information might be incorrect.
- IntraReq: A request object which consists of multiple IntraOp(s)
- IntraOp: An operation like a set, or a slice each has an id
- IntraRes: A response object which consists of multiple OpRes(s)
- OpRes: The result of an IntraOp
User constructs an IntraReq with one or more IntraOp. User sends IntraReq to server. Server processes the request. If executing an IntraOp causes an error the processing of the entire request is stopped. Otherwise the result of each operation is added to the Response. When all steps are complete the response is returned to the user.
IntraVert is not tightly coupled with a wire-format. The IntraRequest can be serialized in either XML or JSON and sent to a specific end point. The compressed Smile Protocol for JSON is also supported.
Intravert's payload was designed to be simple. This makes it easy for programs and even users at a keyboard to interact with the server.
Using the JSON wire format we see how easy it is to create keyspaces and column families.
{"e":[
{"type":"CREATEKEYSPACE","op":{"name":"myks","replication":1}},
{"type":"CREATECOLUMNFAMILY","op":{"name":"mycf"}}
]}
The first client is the java client.
IntraClient i = new IntraClient();
i.payload="json";
IntraReq req = new IntraReq();
req.add( Operations.createKsOp("myks", 1));
req.add( Operations.createCfOp("mycf"));
i.sendBlocking(req) ;
IntraOp
has several static methods which help you build operations quickly.
IntraVert objects should be "easy" to represent in JSON notation. As a result the client code uses many generic objects like List(s) and Map(s) whenever possible.
For example the slice operation in java:
`req.add( Operations.sliceOp("5", "1", "9", 4));`
Looks something like this in JSON:
`{"type":"SLICE","op":{"end":"9","rowkey":"5","size":4,"start":"1"}}`