/Roman
--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protobuf+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
message Record {
optional int id = 1;
// fields only you know about.
}
message RecordBlock {
repeated Record record = 1; // You could declare these as 'bytes' type
// instead of 'Record'
type. This avoids parsing
// each Record if you're
not going to use it.
optional int max_id = 2;
optional int min_id = 3;
}
message RecordsFile {
repeated RecordBlock raw_blocks = 1; // Readly available RecordBlock.
repeated bytes gziped_blocks = 2; // Gzip encoded RecordBlock.
repeated bytes other_encoding_blocks = 3; // Other encoded RecordBlock.
}
You may use RecordsFile to append records to your file. For parsing,
you can use CodedInputStream.
--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
Is a separate index file an option? You could build main file and this index file. If one file only is desirable, you can prepend or append index later.
On Thu, May 17, 2012 at 8:22 AM, Roman Vinogradov <...> wrote:
Thank you all.
I think TFile is very similar to what I am trying to do.
One issue of TFile is that it stores all meta and indices in its tail
which in turn means that if the writing process suddenly crashes for
some reason (e.g. hardware issue or something not related to our
process) then file will be of incomplete format and it won't be
possible to read it or even recover it.
/Roman
On 17 май, 10:28, Eyal Farago <...> wrote:
> you can use an approach like HADDOP's TFilehttps://issues.apache.org/jira/secure/attachment/12396286/TFile%20Spe...
>> - Скрыть цитируемый текст -
> basically they store compressed chunks in a file, and at the end of the
> file (hence T(ail)File) they store come kind of a sparse index to
> the chunks.
>
> Eyal.
>
>
>
>
> - Показать цитируемый текст -
--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protobuf+unsubscribe@googlegroups.com.