// A utility to translate triples into bson typedef struct { Code stmt; int rowid; int * buffer; int * start; Triple *t; int word_count; } CallBoxBson; int add_triple_descent(CallBoxBson * parent) { CallBoxBson child; int *bson_count_ptr; // Save a pointer to the parent byte count location // Convert and fill n the element type right away // and the parent key is valid. bson_count_ptr = parent->start; parent->start++; parent->start[0] = convert(parent->t->link); parent->start++; memcpy(parent->start, parent->t->key,MachineColLength(parent->stmt,1)); 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; parent->word_count += child.word_count; } *bson_count_ptr = parent->word_count; return 0; }
A sql son row needs to be converted. Right away we know the bson type, and the bson key itself, so place those. Save a pointer to where the total word count goes but if this bson elements bounds an enclosed object, the enclosed ojects are recursively expanded, and when done, return the proper word cont to the parent to be placed. This is about 1/2 way debugged, I call that progress at this point.
In reverse I am trying to construct row counters from incoming bson word counts. A similar problem, and the same similar snippet of code.
What would be the native format for Sqlson?
|link,pointer,keylen,keytext| Send a triple by triple array. I will probably do that, create the send sqlson table routine, make it available via an operator in link. Sockets is very good with high speed io, so the idea of many machines nearby, each managing arrays of disks might want a more direct flush, have the underlying machine read the table as fast as it can, straight into a send buffer.
No comments:
Post a Comment