[Xapian-tickets] [Xapian] #266: Rename flush() to commit, add a pure minimise_memory() method.
Xapian
nobody at xapian.org
Thu May 8 18:28:34 BST 2008
#266: Rename flush() to commit, add a pure minimise_memory() method.
-------------------------+--------------------------------------------------
Reporter: richard | Owner: olly
Type: enhancement | Status: new
Priority: normal | Milestone: 1.1.0
Component: Library API | Version: SVN HEAD
Severity: normal | Keywords:
Blockedby: | Platform: All
Blocking: |
-------------------------+--------------------------------------------------
Currently, WritableDatabase::flush(), (which can only be called outside an
explicit transaction), writes all the buffered changes to disk, and then
performs a commit of the implicit transaction, making the changes visible
to newly opened Database objects. This isn't really implied by the
"flush" name - it would be more accurate to call the method "commit()", or
similar. I suggest renaming flush to commit (but keeping flush() as an
alias for backwards compatibility, for now).
Also, it would be helpful to be able to force the buffered changes to be
written to disk, to reduce memory usage, but not to cause a commit().
This kind of flush would be useful when performing a large bulk change
which the user wants to appear atomic. We can't call this method
"flush()" because this would be a confusing change of behaviour. Olly
suggests calling the method "minimise_memory", which seems fine to me, and
describes the intention of the method, rather than its effects. This
method would work the same whether called inside or outside an explicit
transaction - it would write as many of the buffered changes as possible
to disk, but not perform a commit.
Let's think about this for 1.1.0, though I'm not going to complain if this
is bumped to later.
--
Ticket URL: <http://trac.xapian.org/ticket/266>
Xapian <http://trac.xapian.org>
Xapian
More information about the Xapian-tickets
mailing list