--
Regards,
Hiram
Blog: http://hiramchirino.com
Open Source SOA
http://fusesource.com/
perfect.
> Q: How can I distinguish index pages created by the IndexFactory<Long,
> Integer> from the data pages, which I allocate?
> I want to do this simply by looking at one page from C++ (e.g. not
> having to scan the index from the root to exclude its pages).
>
> From what I can tell:
> HashIndex pages use the magic: { 'h', 'a', 's', 'h' }
> BTreeIndex pages use the magic: { 'x' }
>
Actually, the x means it's part of an eXtent which can span multiple
contiguous pages. BTree pages add additional magic after the extent
header.
> I suppose I can just use a magic { 'c' } for custom and all will be
> well.
> Q: It is not yet clear to me what the simplest way to ensure my custom
> magic gets stuck into my custom pages, any suggestions?
>
> btw, It seems much has changed from kahadb:
> - this API looks a bit more sophisticated, though it comes with some
> complexity, the NIO support seems really nice
yep. The paging layer is what changed drastically.
> - the checksum on each page is gone -- which seems to be necessary
> since you now support slices.
I was hoping to just track the checksums in the metadata associated
with the redo records.
> - there is no Page class, (it gets replaced by Extent).
That's one way to look at it.
So I'm specifically talking about using checksums in the transaction
page file case. In that case the disk layout looks more like:
[[tx-file-header][page-index][page-data-1][page-data-2][page-data-3][page-index
shadow][page-data-2 shadow][shadow-updates-list]]
the big difference /w the transactional page file is that we never
directly update existing pages since the updates can be rolled back
and there might be threads still doing read operations against the
original pages.
So the page updates are stored at new 'shadow' page locations. We
track all the committed updates and their associated shadow page
locations in an update list. That list basically tracks the shadow
page location and the original page location it's updating. When I
was talking about tracking checksums, I meant that that checksum of
the shadow page should get added as part of that info. that way
during recovery we can validate that all shadow updates are intact.