本文整理了Java中org.apache.lucene.store.Lock.isLocked()
方法的一些代码示例,展示了Lock.isLocked()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Lock.isLocked()
方法的具体详情如下:
包路径:org.apache.lucene.store.Lock
类名称: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()) {
内容来源于网络,如有侵权,请联系作者删除!