[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: Storing graph data structure with MDB_FIXEDMAP
- To: Howard Chu <hyc@symas.com>
- Subject: Re: Storing graph data structure with MDB_FIXEDMAP
- From: Aris Setyawan <aris.sety@gmail.com>
- Date: Fri, 13 Dec 2013 04:03:20 +0700
- Cc: openldap-technical@openldap.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=7RN/viHldcdxzNht/+Wc2KxKUGpwvtiyGckXntP+/ww=; b=O/OCbmgllqAviHGV5Adts0S9N52cnPi7TrhDvJOOzvlbxFL2UhUX+WSGa/d1yT3AIC 44BXGoLpqoP3204VGoYE1aAuW9Jfnl5JTtSdiAtn2iX0DUi9E7WbulYVJfzGo9T7Kczb Ct2JUlbPAzvsfA6ytX0Aj3g6CquFoX9lk4at1jt66nXqSjE0S7JuMOLARstFVw8HE/o9 GmAS6zZ3oPgJufaLQSUznm8fBgglD+GtA8Gjguk02A8MGe9Eq8AIU0IHyHTEfxYX/cFW EMLsbaD2n9gABqeW7tGVVAuDlmiPoSKWolUEiRd88hAzq5nDdod/jZ2OqwQlY4PstTG8 diUg==
- In-reply-to: <5298DE97.5020105@symas.com>
- References: <CA+d_paMAEN5WyjaAiDH=qGZzG=dvoBfD2EPXLhugmgExqaDQoA@mail.gmail.com> <5298DE97.5020105@symas.com>
> If you want to create a record which has fields referencing the addresses of other fields within the same record, that is the goal for FIXEDMAP but this feature requires the relocation functions, which currently are not implemented.
Is in the future, this feature will be removed?
Do you have a plan about it?
On 11/30/13, Howard Chu <hyc@symas.com> wrote:
> Aris Setyawan wrote:
>> Hi,
>>
>> I'm new in this list.
>>
>> I plan to store graph data structure (vertex and edge) in LMDB. The
>> "edge" data value of a record will contain a pointer which is pointing
>> to the address of "vertex" data value. So, I must make it sure that
>> data value address is not changing during operation. According to the
>> doc, I can use MDB_FIXEDMAP.
>>
>> And from the doc:
>>
>> "... the memory map will always reside at the same virtual address and
>> pointers used to reference data items in the database will be constant
>> across multiple invocations. ..."
>>
>> Spesifically: "... pointers used to reference data items in the
>> database will be constant ..."
>>
>> Is this mean that I must allocate memory to write data using mdb_put
>> with MDB_RESERVE flag?
>
> Yes, but from what you've described, this will not do what you want. The
> address of a record is not guaranteed to remain constant, so you cannot
> safely
> reference the address of one record from another record. The only safe way
> to
> reference one record from another is using its key.
>
> If you want to create a record which has fields referencing the addresses of
>
> other fields within the same record, that is the goal for FIXEDMAP but this
>
> feature requires the relocation functions, which currently are not
> implemented.
>
> --
> -- Howard Chu
> CTO, Symas Corp. http://www.symas.com
> Director, Highland Sun http://highlandsun.com/hyc/
> Chief Architect, OpenLDAP http://www.openldap.org/project/
>