/** Returns the time the named file was last modified. */ public long fileModified(String name) throws IOException { return directory.fileModified(fileName); }
@SuppressWarnings("deprecation") public long fileModified(String name) throws IOException { return _directory.fileModified(name); }
/** Returns the time the compound file was last modified. */ public long fileModified(String name) throws IOException { return directory.fileModified(fileName); }
@Override public long fileModified(String name) throws IOException { return dir.fileModified(name); }
@Override public long fileModified(String name) throws IOException { return dir.fileModified(name); }
/** Returns the time the compound file was last modified. */ public long fileModified(String name) throws IOException { return directory.fileModified(fileName); }
@Override public long fileModified(final String fileName) throws IOException { return directory.fileModified(fileName); }
/** * Returns the time the index in the named directory was last modified. * * <p>Synchronization of IndexReader and IndexWriter instances is * no longer done via time stamps of the segments file since the time resolution * depends on the hardware platform. Instead, a version number is maintained * within the segments file, which is incremented everytime when the index is * changed.</p> * * @deprecated Replaced by {@link #getCurrentVersion(Directory)} * */ public static long lastModified(Directory directory) throws IOException { return directory.fileModified("segments"); }
public long fileModified(String name) throws IOException { return dir.fileModified(name); }
public Object doBody(String segmentFileName) throws IOException { return new Long(directory2.fileModified(segmentFileName)); } }.run()).longValue();
public Object doBody(String segmentFileName) throws IOException { return new Long(directory2.fileModified(segmentFileName)); } }.run()).longValue();
@SuppressWarnings("deprecation") public long fileModified(String name) throws IOException { if (compressedFileExists(name)) { return _directory.fileModified(getCompressedName(name)); } return _directory.fileModified(name); }
public void onCommit(List commits) throws IOException { IndexCommitPoint lastCommit = (IndexCommitPoint) commits.get(commits.size() - 1); // Any commit older than expireTime should be deleted: double expireTime = dir.fileModified(lastCommit.getSegmentsFileName()) / 1000.0 - expirationTimeSeconds; Iterator it = commits.iterator(); while (it.hasNext()) { IndexCommitPoint commit = (IndexCommitPoint) it.next(); double modTime = dir.fileModified(commit.getSegmentsFileName()) / 1000.0; if (commit != lastCommit && modTime < expireTime) { commit.delete(); } } }
private void checkCommits(List<? extends IndexCommit> commits) throws IOException { long currentTime = System.currentTimeMillis(); for (int i = 0; i < commits.size() - 1; i++) { IndexCommit ic = commits.get(i); long lastModified = index.getDirectory().fileModified(ic.getSegmentsFileName()); if (currentTime - lastModified > maxAge) { ic.delete(); } else { // following commits are younger, no need to check break; } } }
/** Convenience method that returns the last modified time * of the segments_N file corresponding to this index * commit, equivalent to * getDirectory().fileModified(getSegmentsFileName()). */ public long getTimestamp() throws IOException { return getDirectory().fileModified(getSegmentsFileName()); } }
private void checkCommits(List<? extends IndexCommit> commits) throws IOException { long currentTime = System.currentTimeMillis(); for (int i = 0; i < commits.size() - 1; i++) { IndexCommit ic = commits.get(i); long lastModified = index.getDirectory().fileModified(ic.getSegmentsFileName()); if (currentTime - lastModified > maxAge) { ic.delete(); } else { // following commits are younger, no need to check break; } } }
/** Convenience method that returns the last modified time * of the segments_N file corresponding to this index * commit, equivalent to * getDirectory().fileModified(getSegmentsFileName()). */ public long getTimestamp() throws IOException { return getDirectory().fileModified(getSegmentsFileName()); } }
this.lastModified = directory.fileModified(fileName); this.indexes = indexes; this.counter = counter;
this.lastModified = directory.fileModified(fileName); this.indexes = indexes; this.counter = counter;
@Override public long fileModified(String name) throws IOException { editingContext().lock(); try { return _wrapped.fileModified(name); } finally { editingContext().unlock(); } }