API usage: unslice

1 view
Skip to first unread message

Justin

unread,
Jul 28, 2010, 4:52:31 PM7/28/10
to hawtdb
What is the purpose of Paged.unslice()? there is no javadoc. From the
source code it would appear that it releases region obtained from
slice(), but the contract is entirely unclear -- must I call unslice()
everytime I call slice()?

Justin

unread,
Jul 28, 2010, 5:58:42 PM7/28/10
to hawtdb
From the code in the implementation it seems like unslice() completes/
inverts slice() when used for read:

bb = paged.slice(SliceType.READ);
try {
bb.read();
}
finally {
paged.unslice(bb);
}

Does write() complete / invert slice when used with SliceType.WRITE?

Hiram Chirino

unread,
Jul 28, 2010, 11:06:02 PM7/28/10
to haw...@googlegroups.com

Correct. Just use it every time you slice.

--
Regards,
Hiram

Blog: http://hiramchirino.com

Open Source SOA
http://fusesource.com/

Hiram Chirino

unread,
Jul 28, 2010, 11:08:51 PM7/28/10
to haw...@googlegroups.com
no.. just use unslice every time you slice.

If you slice type is WRITE you can update the byte buffer given. If
your slice type is READ don't update it :)

In some cases (like if your using a transaction page file) the write
is actually done to shadow copy of the original. Once the transaction
completes, the shadow gets copied over the original.

--

Reply all
Reply to author
Forward
0 new messages