Returns true iff the index in the named directory is currently locked. @param directory the directory to check for a lock @throws IOException if there is a low-level IO error @deprecated Use of this method can only lead to race conditions. Try to actually obtain a lock instead.
(Directory directory)
| 859 | |
| 860 | /** |
| 861 | * Returns <code>true</code> iff the index in the named directory is currently locked. |
| 862 | * |
| 863 | * @param directory the directory to check for a lock |
| 864 | * @throws IOException if there is a low-level IO error |
| 865 | * @deprecated Use of this method can only lead to race conditions. Try to actually obtain a lock |
| 866 | * instead. |
| 867 | */ |
| 868 | @Deprecated(since = "7.0") |
| 869 | private static boolean isWriterLocked(Directory directory) throws IOException { |
| 870 | try { |
| 871 | directory.obtainLock(IndexWriter.WRITE_LOCK_NAME).close(); |
| 872 | return false; |