Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: [Search] A list of Lucene index files touched during update
PostPosted: Mon Mar 26, 2012 6:36 pm 
Newbie

Joined: Mon Mar 26, 2012 6:30 pm
Posts: 3
I've been looking at the Lucene backed processor trying to figure out a way to essentially audit which files were modified on the filesystem by the index writer from MDBSearchController so that I can copy the files to another location. I can't seem to find an obvious way to do this. Has anybody tried this and have a solution that I'm missing?

Thanks
Eli


Top
 Profile  
 
 Post subject: Re: [Search] A list of Lucene index files touched during update
PostPosted: Mon Mar 26, 2012 7:12 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2296
Location: Third rock from the Sun
Hi,
the index is organized in segment files, which are all immutable. when changes are made, new smaller segments are created and eventually compacted in larger segments, outdated segments are eventually deleted when no IndexReader instances are referring to them anymore (very short time: time of a single query).

A nice consequence of this is that you need not care for "changed" files, just copy all files you don't have yet in the target location, and remove the ones not existing anymore. This is perfect for rsync, for example.

Finally, we have such copy routines (implementing a simple rsync-like strategy) in the code base, which is what the Master / Slave directories use to make periodic copies.

See org.hibernate.search.util.impl.FileHelper.synchronize(File, File, boolean, long)

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: [Search] A list of Lucene index files touched during update
PostPosted: Mon Mar 26, 2012 7:16 pm 
Newbie

Joined: Mon Mar 26, 2012 6:30 pm
Posts: 3
Ok. I'll take a look. Thanks Sanne


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.