@Override public synchronized boolean isLocked() throws IOException { return lock.isLocked(); }
public boolean isLocked() { return lock.isLocked(); } }
public synchronized boolean isLocked() { return lock.isLocked(); }
public synchronized boolean isLocked() { return lock.isLocked(); }
/** * Returns <code>true</code> 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 Please use {@link IndexWriter#isLocked(Directory)} instead */ public static boolean isLocked(Directory directory) throws IOException { return directory.makeLock(IndexWriter.WRITE_LOCK_NAME).isLocked(); }
/** * Returns <code>true</code> 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 */ public static boolean isLocked(Directory directory) throws IOException { return directory.makeLock(WRITE_LOCK_NAME).isLocked(); }
/** * Returns <code>true</code> 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 Please use {@link IndexWriter#isLocked(Directory)} instead */ public static boolean isLocked(Directory directory) throws IOException { return directory.makeLock(IndexWriter.WRITE_LOCK_NAME).isLocked(); }
@Override protected void doAfterFlush() throws IOException { super.doAfterFlush(); if (!internalLock.isLocked()) { throw new IOException("Lock [" + internalLock +"] no longer has write lock."); } }
@Override protected void doBeforeFlush() throws IOException { super.doBeforeFlush(); if (!internalLock.isLocked()) { throw new IOException("Lock [" + internalLock +"] no longer has write lock."); } }
/** * Returns <code>true</code> 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 */ public static boolean isLocked(Directory directory) throws IOException { return directory.makeLock(WRITE_LOCK_NAME).isLocked(); }
/** * Returns <code>true</code> 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 problem with accessing the index */ public static boolean isLocked(Directory directory) throws IOException { return directory.makeLock(IndexWriter.WRITE_LOCK_NAME).isLocked() || directory.makeLock(IndexWriter.COMMIT_LOCK_NAME).isLocked(); }
public Collection<String> getLocks(final String path) throws IOException { final Collection<String> locks = Lists.newArrayList(); Directory dir = null; try { dir = getDirectory(new File(path)); // Check write lock final org.apache.lucene.store.Lock lock = dir.makeLock(IndexWriter.WRITE_LOCK_NAME); if (lock.isLocked()) { locks.add(getLockFilepath(lock)); } } finally { if (dir != null) { dir.close(); } } return locks; }
directoryName = "snapshot." + fmt.format(new Date()); lock = lockFactory.makeLock(directoryName + ".lock"); if (lock.isLocked()) return; snapShotDir = new File(snapDir, directoryName); if (!snapShotDir.mkdir()) {