public Lock makeLock(String name) { return dir.makeLock(name); }
public Lock makeLock(String name) { return _directory.makeLock(name); }
@Override public Lock makeLock(String name) { return dir.makeLock(name); }
@Override public Lock makeLock(String name) { return dir.makeLock(name); }
@Override public Lock makeLock(String name) { return other.makeLock(name); }
public Lock makeLock(String name) { return _directory.makeLock(name); }
/** * Forcibly unlocks the index in the named directory. * <P> * Caution: this should only be used by failure recovery code, * when it is known that no other process nor thread is in fact * currently accessing this index. */ public static void unlock(Directory directory) throws IOException { directory.makeLock(IndexWriter.WRITE_LOCK_NAME).release(); directory.makeLock(IndexWriter.COMMIT_LOCK_NAME).release(); } }
/** * 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(); }
/** * 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 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(); }
/** * Forcibly unlocks the index in the named directory. * <P> * Caution: this should only be used by failure recovery code, * when it is known that no other process nor thread is in fact * currently accessing this index. * @deprecated Please use {@link IndexWriter#unlock(Directory)} instead */ public static void unlock(Directory directory) throws IOException { directory.makeLock(IndexWriter.WRITE_LOCK_NAME).release(); }
/** * Forcibly unlocks the index in the named directory. * <P> * Caution: this should only be used by failure recovery code, * when it is known that no other process nor thread is in fact * currently accessing this index. */ public static void unlock(Directory directory) throws IOException { directory.makeLock(IndexWriter.WRITE_LOCK_NAME).release(); }
/** * Forcibly unlocks the index in the named directory. * <P> * Caution: this should only be used by failure recovery code, * when it is known that no other process nor thread is in fact * currently accessing this index. */ public static void unlock(Directory directory) throws IOException { directory.makeLock(IndexWriter.WRITE_LOCK_NAME).release(); }
/** * Forcibly unlocks the index in the named directory. * <P> * Caution: this should only be used by failure recovery code, * when it is known that no other process nor thread is in fact * currently accessing this index. * @deprecated Please use {@link IndexWriter#unlock(Directory)} instead */ public static void unlock(Directory directory) throws IOException { directory.makeLock(IndexWriter.WRITE_LOCK_NAME).release(); }
/** * 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(); }
@Override public Lock makeLock(String name) { ensureOpen(); return delegate.makeLock(name); }
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; }
public Object doInTransaction() throws CompassException { for (int i = 0; i < finalSubIndexes.length; i++) { Directory dir = getDirectory(finalSubIndexes[i]); writerLocks[i] = dir.makeLock(IndexWriter.WRITE_LOCK_NAME); try { writerLocks[i].obtain(luceneSettings.getTransactionLockTimout()); } catch (IOException e) { throw new SearchEngineException("Failed to retrieve transaction locks", e); } } return null; } });
private void obtainOrderLockIfNeeded(String subIndex) throws SearchEngineException { if (!maintainOrder) { return; } Lock lock = orderLocks.get(subIndex); if (lock == null) { lock = searchEngine.getSearchEngineFactory().getLuceneIndexManager().getStore().openDirectory(subIndex).makeLock("order.lock"); try { lock.obtain(searchEngine.getSearchEngineFactory().getLuceneSettings().getTransactionLockTimout()); } catch (IOException e) { clearLocksIfNeeded(); throw new SearchEngineException("Failed to obtain order lock on sub index [" + subIndex + "]", e); } orderLocks.put(subIndex, lock); } }