90
• Lines 42-48: We use the same data structure declared in pwriter.c. In
practice, this should be declared in a header file for consistency.
• Line 58: Open the pool and return a pop pointer to it
• Line 66: Upon success, pmemobj_root() returns a handle to the root
object associated with the persistent memory pool pop.
• Line 68: pmemobj_direct() returns a pointer to the root object.
• Lines 70-71: Determine the length of the buffer pointed to by
rootp->buf. If it matches the length of the buffer we wrote, the
contents of the buffer is printed to STDOUT.
Memory Poolsets
The capacity of multiple pools can be combined into a poolset. Besides providing a
way to increase the available space, a poolset can be used to span multiple persistent
memory devices and provide both local and remote replication.
You open a poolset the same way as a single pool using pmemobj_open(). (At the
time of publication, pmemobj_create() and the pmempool utility cannot create poolsets.
Enhancement requests exist for these features.) Although creating poolsets requires
manual administration, poolset management can be automated via libpmempool or the
pmempool utility; full details appear in the poolset(5) man page.
Concatenated Poolsets
Individual pools can be concatenated using pools on a single or multiple file systems.
Concatenation only works with the same pool type: block, object, or log pools. Listing 7- 3
shows an example “myconcatpool.set” poolset file that concatenates three smaller pools
into a larger pool. For illustrative purposes, each pool is a different size and located on
different file systems. An application using this poolset would see a single 700GiB memory
pool.
Chapter 7 libpmemobj: a Native traNsaCtioNal objeCt store
• Lines 42-48: We use the same data structure declared in pwriter.c. In
practice, this should be declared in a header file for consistency.
• Line 58: Open the pool and return a pop pointer to it
• Line 66: Upon success, pmemobj_root() returns a handle to the root
object associated with the persistent memory pool pop.
• Line 68: pmemobj_direct() returns a pointer to the root object.
• Lines 70-71: Determine the length of the buffer pointed to by
rootp->buf. If it matches the length of the buffer we wrote, the
contents of the buffer is printed to STDOUT.
Memory Poolsets
The capacity of multiple pools can be combined into a poolset. Besides providing a
way to increase the available space, a poolset can be used to span multiple persistent
memory devices and provide both local and remote replication.
You open a poolset the same way as a single pool using pmemobj_open(). (At the
time of publication, pmemobj_create() and the pmempool utility cannot create poolsets.
Enhancement requests exist for these features.) Although creating poolsets requires
manual administration, poolset management can be automated via libpmempool or the
pmempool utility; full details appear in the poolset(5) man page.
Concatenated Poolsets
Individual pools can be concatenated using pools on a single or multiple file systems.
Concatenation only works with the same pool type: block, object, or log pools. Listing 7- 3
shows an example “myconcatpool.set” poolset file that concatenates three smaller pools
into a larger pool. For illustrative purposes, each pool is a different size and located on
different file systems. An application using this poolset would see a single 700GiB memory
pool.
Chapter 7 libpmemobj: a Native traNsaCtioNal objeCt store
