/* Next to develop are two inverse functions one from local bson to triple store and the other to go back */ int get_next_triple(Triple * t) { int status; status = machine_step(ready.stmt); if(status != EV_Error) status = machine_triple(ready.stmt,t); return status; } // Bson <-> Triples enum {BsonString,BsonInt}; // A utility to translate triples into bson typedef struct { Pointer stmt; int rowid; int * buffer; int * start; Triple *t; int byte_count; } CallBoxBson; int add_triple_descent(CallBoxBson * parent) { int bson_len; CallBoxBson child; char * bson_key = parent->t->key; int bson_type = parent->t->link >> 8; if(bson_type == BsonString) bson_len = G_strlen(bson_key); else if( bson_type == BsonInt) bson_len=sizeof(int); parent->start[0] =bson_len; parent->start[1]=bson_type; G_strncpy((char *) &parent->start[2],bson_key,bson_len); while(parent->rowid < parent->t->pointer) { child = *parent; child.start = parent->buffer; get_next_triple(child.t); add_triple_descent(&child); parent->rowid = child.rowid; } G_strncpy((char *) &parent->start[2],bson_key,bson_len); return 0;The Bson is stored in the usual triolet, {|ey,link,pointer) The Bson data in the key, the link holds the Bson type and pointer is the number of SQL rows this Bson set contains if it is not a terminal.
The problem solved is ta SQL keep the data count for the Bson, then uses rowid to count the elements in the document. So I have to recurse through the thing and reconstruct the charactecter count before I can completely assemble the Bson document header.
It is tricky because code is pulling out the sql rows as I complete the task, so the converter has to go back to sql and step the statement.
I have the reverse routing that works similar, construction the number of row in a document before the document header know the row count. These will take a day or two, but this code is getting ready for lab testing soon.
I which and hope that Bson elements are word alligned, though it is not a real problem.
3 comments:
I am also writing to make you understand of the useful experience our princess went through viewing your site. She even learned some details, not to mention how it is like to possess a wonderful coaching nature to let the rest without difficulty have an understanding of a variety of extremely tough topics. You really did more than readers' desires. Thank you for coming up with the helpful, trustworthy, edifying and fun thoughts on the topic to Lizeth.
Corning 96-Well Half Area Clear Flat Bottom Polystyrene Microplate With Lid, TC-Treated, 0.16sq cm Cell Growth Area, 190µL Well Volume, Sterile, Individually Wrapped (Case of 50)
You could definitely see your enthusiasm within the work you write. The sector hopes for even more passionate writers like you who aren't afraid to say how they believe. Always go after your heart.
Keen Women's Snowmass High Waterproof Winter Boot
Wow, comments! You both made my day!
Post a Comment