[Xapian-tickets] [Xapian] #266: Add a minimise_memory() method.

Xapian nobody at xapian.org
Sat Jun 18 05:49:51 BST 2011


#266: Add a minimise_memory() method.
-------------------------+--------------------------------------------------
 Reporter:  richard      |       Owner:  olly     
     Type:  enhancement  |      Status:  assigned 
 Priority:  normal       |   Milestone:  1.3.0    
Component:  Library API  |     Version:  SVN trunk
 Severity:  normal       |    Keywords:           
Blockedby:               |    Platform:  All      
 Blocking:               |  
-------------------------+--------------------------------------------------
Changes (by olly):

  * priority:  low => normal
  * milestone:  1.2.x => 1.3.0


Comment:

 I think the more important thing to test would be that the flushed()
 changes aren't committed - i.e. if you open the same database as a
 Xapian::Database, the document
 count doesn't increase.  That's an obvious thing which could go wrong.

 As I suggested on IRC, the easiest way to check it's actually doing what
 it should is to look at the size of postlist.DB to check it gets larger
 (at least for a suitably sized amount of data being flushed).  Not
 terribly clean, but I don't think there's a better alternative.

 I'm leaning towards thinking we should just call this method flush() -
 while it's a little confusing that the method name was previous used for a
 slightly different operation, we did add commit() as the preferred alias
 in 1.1.0 which is a whole unstable and stable release series ago, and if
 someone misses an update from flush() to commit(), then they'll still get
 the "write out changes" part, the changes just won't go live.  It's not
 like calling flush() is a dangerous operation to accidentally invoke.

 Otherwise, I'm not sure I like minimise_memory() so much - flush_changes()
 or force_flush() seem better options.  Having flush in the name seems
 good, since the functionality is related to XAPIAN_FLUSH_THRESHOLD (though
 that also commits the changes when called outside a transaction).

 Marking for 1.3.0.

-- 
Ticket URL: <http://trac.xapian.org/ticket/266#comment:9>
Xapian <http://xapian.org/>
Xapian



More information about the Xapian-tickets mailing list