org.apache.lucene.store.Lock.isLocked()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(345)

本文整理了Java中org.apache.lucene.store.Lock.isLocked()方法的一些代码示例,展示了Lock.isLocked()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Lock.isLocked()方法的具体详情如下:
包路径:org.apache.lucene.store.Lock
类名称:Lock
方法名:isLocked

Lock.isLocked介绍

[英]Returns true if the resource is currently locked. Note that one must still call #obtain() before using the resource.
[中]如果资源当前已锁定,则返回true。请注意,在使用资源之前,仍然必须调用#get()。

代码示例

代码示例来源:origin: gncloud/fastcatsearch

@Override
public synchronized boolean isLocked() throws IOException {
 return lock.isLocked();
}

代码示例来源:origin: org.compass-project/compass

public boolean isLocked() {
    return lock.isLocked();
  }
}

代码示例来源:origin: org.apache.lucene/lucene-core-jfrog

public synchronized boolean isLocked() {
 return lock.isLocked();
}

代码示例来源:origin: org.apache.lucene/com.springsource.org.apache.lucene

public synchronized boolean isLocked() {
 return lock.isLocked();
}

代码示例来源:origin: org.apache.lucene/com.springsource.org.apache.lucene

/**
 * 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();
}

代码示例来源:origin: org.apache.lucene/lucene-core-jfrog

/**
 * 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();
}

代码示例来源:origin: org.apache.lucene/lucene-core-jfrog

/**
 * 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();
}

代码示例来源:origin: altamiracorp/blur

@Override
protected void doAfterFlush() throws IOException {
 super.doAfterFlush();
 if (!internalLock.isLocked()) {
  throw new IOException("Lock [" + internalLock +"] no longer has write lock.");
 }
}

代码示例来源:origin: altamiracorp/blur

@Override
protected void doBeforeFlush() throws IOException {
 super.doBeforeFlush();
 if (!internalLock.isLocked()) {
  throw new IOException("Lock [" + internalLock +"] no longer has write lock.");
 }
}

代码示例来源:origin: org.apache.lucene/com.springsource.org.apache.lucene

/**
 * 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();
}

代码示例来源:origin: lucene/lucene

/**
 * 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();
}

代码示例来源:origin: com.atlassian.jira/jira-core

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;
}

代码示例来源:origin: org.dspace.dependencies.solr/dspace-solr-core

directoryName = "snapshot." + fmt.format(new Date());
lock = lockFactory.makeLock(directoryName + ".lock");
if (lock.isLocked()) return;
snapShotDir = new File(snapDir, directoryName);
if (!snapShotDir.mkdir()) {

相关文章