gritzko / ron

(dated, see the site) Replicated Object Notation, a distributed live data format, golang/ragel lib
http://replicated.cc
Apache License 2.0
360 stars 7 forks source link

Frame header format #26

Open gritzko opened 6 years ago

gritzko commented 6 years ago

Needs specification, esp event/ref uuids

например, может быть header без содержимого, если, скажем, query просит последние изменения, а их нет, всё так же метаданные - event id и ref id, которые задают интервал event id, входящих во фрейм ref id == 0 значит, что это полное состояние event id = 0 значит, что это пустое состояние

cblp commented 6 years ago

What is a header? Is it mandatory? Must there be exactly 1 header?

gritzko commented 6 years ago

A reducer's output is always a frame that MUST start with a header. A reducer MAY produce several headers thus delimiting chunks of output. A general frame may contain a mix of raw ops and reducer outputs, thus it can contain any number of headers (may have none if empty or all-raw).

cblp commented 6 years ago

Consider frame containing reducer output and then some raw ops. What does it look like in the text format? Are there any means to signal an end of the frame or start another chunk in the text format?

gritzko commented 6 years ago
*lww #obj @time1+origin !
    :one =1 ,
    :two 'два' ,

@time2+origin :three ^3.0 ;

.

(lww reducer output plus one yet-unreduced op)

gritzko commented 6 years ago
cblp commented 6 years ago

I'm sorry, but in example above I don't see how "another chunk starts with another header".

Also comma and semicolon seem not documented. What do they mean?

cblp commented 6 years ago

Also, the document states header is an op, but this header isn't, it has no location.

gritzko commented 6 years ago

Also comma and semicolon seem not documented. What do they mean?

Oops. Comma terminates reduced ops, semicolon terminates raw ops. Comma is optional.

gritzko commented 6 years ago

another chunk starts with another header;

Let's reword this: a chunk consists of a header ! or a query header ? op followed by reduced , ops belonging to the chunk. Raw ops form their own one-op chunk.

gritzko commented 6 years ago

Also, the document states header is an op, but this header isn't, it has no location.

Omitted UUID is set to the default value, which is the same UUID of the previous op. For the first op, the default is 0. e.g. see https://github.com/gritzko/ron-test/blob/master/05-rga.in.ron#L38

gritzko commented 6 years ago

I'll remove that zero default UUID. Indeed, it adds confusion but makes no huge savings. e.g. *lww #object @version ! or *lww #object @version :0 !