Use IndexCommit#getTimestamp added in Lucene 2.4

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@706893 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2008-10-22 08:16:04 +00:00
parent d76776eb1b
commit 0d8d200c20
2 changed files with 5 additions and 2 deletions

View File

@ -133,6 +133,10 @@ public class IndexDeletionPolicyWrapper implements IndexDeletionPolicy {
public boolean isDeleted() { public boolean isDeleted() {
return delegate.isDeleted(); return delegate.isDeleted();
} }
public long getTimestamp() throws IOException {
return delegate.getTimestamp();
}
} }
/** /**

View File

@ -122,9 +122,8 @@ public class SolrDeletionPolicy implements IndexDeletionPolicy, NamedListInitial
} }
try { try {
//TODO: replace LHS of if condition with commit.getTimestamp()
if (maxCommitAge != null) if (maxCommitAge != null)
if (commit.getDirectory().fileModified(commit.getSegmentsFileName()) < dmp.parseMath(maxCommitAge).getTime()) { if (commit.getTimestamp() < dmp.parseMath(maxCommitAge).getTime()) {
commit.delete(); commit.delete();
continue; continue;
} }