table Event {
time : long;
message : string;
type : byte;
}
table Log {
events : [Event];
}
root_type Log;
--
You received this message because you are subscribed to the Google Groups "FlatBuffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flatbuffers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to flatbuffers...@googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "FlatBuffers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/flatbuffers/UDS973I4jUI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to flatbuffers+unsubscribe@googlegroups.com.
@mikkel, In <typeinfo byte><length><fb event> <typeinfo byte><length><fb event> mode, things are by default storable directly to disk or if one wants to go fancy with them, one can build a vtable on the receiving end.Well, in the scenario I described, you can also just stored the data to disk and read them without the full buffer or even vector. You still need the vtable, but these are available as well.
I didn't mention it but vtables are transmitted to at the back of the emit queue, so if you store those on a separate disk, or send them over the network, they are available immediately. This is actually designed that way for this reason.
A custom format as you propose doesn't really add anything - you just replace the vtable offset with a type field and length field which you don't need.
For completeness of discussion, the emitter works with a virtual address which is a negative offset from end of emit queue, before the vtable starts, and the vtable are positive offsets (+1 to avoid a zero offset which indicates error). These virtual addresses are the ones translated when the vector is completed. But each table emit operation can also be framed as you suggest. then you can rebuild the vector without actually sending the vector. Unless you need realtime read access, it is much simpler to send vectors in batches and possible index these vectors in another vector. Even if the buffer isn't completed, you know only need to track the location of each vector in a receiver index. The vectors will use relative addressing.
I didn't mention it but vtables are transmitted to at the back of the emit queue, so if you store those on a separate disk, or send them over the network, they are available immediately. This is actually designed that way for this reason.
Is this the "meta-vtable" that contains addresses of each individual event throughout history?
A question about internals of fb. When you say vector, is each individual "event" packed back to back? If that is so, then one could update the meta-vtable and drop the interim vtable of each individual "batch" and store the whole batch of events to disk in one go.
Use case: Multiple services logging events with some header/type info which can then be used to aggregate events and build a separate vtable for a vector of chronological events during a request/distributed job. At the same time, building the standard vtable that comes as a default "here's a list of all log events, in order, from Service A"
FB can be used here too, and would be really cool if the statement about packing vectors back to back is true, loses real realtime, but realtime is a relative concept anyway. With an adjustable small enough time window to fill the buffer, it's practically realtime.
But if that statement is not true, then it is practically the same as sending framed messages, with additional indirection and overhead on the sending end :( No one likes paying for logging/tracing stuff in their application code.
When you say, "rebuild the vector", it means you already have it. In that case, ignore everything I said. The kind of use cases I was talking about are more on the lines of "I have individual tables", how do I send them over?
Disclaimer: I am not familiar with C++/internals of fb.
Wherever I write vtable, I actually mean a lookup table/squint-eyes-index. "vtable" in fb might mean something else entirely. If that is so, sorry for the confusion.