lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Koji Sekiguchi" <koji.sekigu...@m4.dion.ne.jp>
Subject delete unnecessary files after optimize()
Date Sun, 16 Oct 2005 02:04:33 GMT
Hello,

My Tomcat application has several threads. These threads
share a single instance of IndexSearcher to seach contents.

At some point in time, I have the following index directory:

-rwx------+ 1 admin admin 158622 Oct 16 10:21 _1pp.cfs
-rwx------+ 1 admin admin 158622 Oct 16 10:21 _2kk.cfs
-rwx------+ 1 admin admin 158622 Oct 16 10:21 _3ff.cfs
-rwx------+ 1 admin admin 158622 Oct 16 10:21 _4aa.cfs
-rwx------+ 1 admin admin 158614 Oct 16 10:20 _uu.cfs
-rwx------+ 1 admin admin       4 Oct 16 10:21 deletable
-rwx------+ 1 admin admin     64 Oct 16 10:21 segments

In this moment, I want to optimize() the index. I can do it safely
without interrupting Tomcat process.
After optimizing the index, I get a new compounf file _4ab.cfs:

-rwx------+ 1 admin admin 158622 Oct 16 10:21 _1pp.cfs
-rwx------+ 1 admin admin 158622 Oct 16 10:21 _2kk.cfs
-rwx------+ 1 admin admin 158622 Oct 16 10:21 _3ff.cfs
-rwx------+ 1 admin admin 158622 Oct 16 10:21 _4aa.cfs
-rwx------+ 1 admin admin 791622 Oct 16 10:21 _4ab.cfs
-rwx------+ 1 admin admin 158614 Oct 16 10:20 _uu.cfs
-rwx------+ 1 admin admin     48 Oct 16 10:21 deletable
-rwx------+ 1 admin admin     29 Oct 16 10:21 segments

Now I can let threads of Tomcat know that we have a new compound
file so that servlet can reopen IndexSearcher to use new segments.
But I want to delete old and unnecessary files (_1pp, _2kk,
_3ff, _4aa and _uu .cfs files) after reopening IndexSearcher
to save disk space.

How can I get a list of unnecessary files to delete them?

regards,

Koji




---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message