当前位置: 首页>>代码示例>>Java>>正文


Java LockFactory类代码示例

本文整理汇总了Java中org.apache.lucene.store.LockFactory的典型用法代码示例。如果您正苦于以下问题:Java LockFactory类的具体用法?Java LockFactory怎么用?Java LockFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


LockFactory类属于org.apache.lucene.store包,在下文中一共展示了LockFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createFSDirectory

import org.apache.lucene.store.LockFactory; //导入依赖的package包/类
private static FSDirectory createFSDirectory (
        final File indexFolder,
        final LockFactory lockFactory) throws IOException {
    assert indexFolder != null;
    assert lockFactory != null;
    final FSDirectory directory;
    final String dirType = System.getProperty(PROP_DIR_TYPE);
    if(DIR_TYPE_MMAP.equals(dirType)) {
        directory = new MMapDirectory(indexFolder, lockFactory);
    } else if (DIR_TYPE_NIO.equals(dirType)) {
        directory = new NIOFSDirectory(indexFolder, lockFactory);
    } else if (DIR_TYPE_IO.equals(dirType)) {
        directory = new SimpleFSDirectory(indexFolder, lockFactory);
    } else {
        directory = FSDirectory.open(indexFolder, lockFactory);
    }
    return directory;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:LuceneIndex.java

示例2: setPreload

import org.apache.lucene.store.LockFactory; //导入依赖的package包/类
private static Directory setPreload(Directory directory, Path location, LockFactory lockFactory,
        Set<String> preLoadExtensions) throws IOException {
    if (preLoadExtensions.isEmpty() == false
            && directory instanceof MMapDirectory
            && ((MMapDirectory) directory).getPreload() == false) {
        if (preLoadExtensions.contains("*")) {
            ((MMapDirectory) directory).setPreload(true);
            return directory;
        }
        MMapDirectory primary = new MMapDirectory(location, lockFactory);
        primary.setPreload(true);
        return new FileSwitchDirectory(preLoadExtensions, primary, directory, true) {
            @Override
            public String[] listAll() throws IOException {
                // avoid listing twice
                return primary.listAll();
            }
        };
    }
    return directory;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:22,代码来源:FsDirectoryService.java

示例3: annotateException

import org.apache.lucene.store.LockFactory; //导入依赖的package包/类
private static <T extends Exception> T annotateException(
    @NonNull final T e,
    @NullAllowed File indexDir,
    @NullAllowed Map<Thread,StackTraceElement[]> threads,
    @NullAllowed LockFactory lockFactory) {
    final StringBuilder message = new StringBuilder();
    if (indexDir != null) {
        final File[] children = indexDir.listFiles();
        if (children == null) {
            message.append("Non existing index folder");    //NOI18N
        } else {
            for (File c : children) {
                message.append(c.getName()).append(" f: ").append(c.isFile()).
                append(" r: ").append(c.canRead()).
                append(" w: ").append(c.canWrite()).append("\n");  //NOI18N
            }
        }
    }
    if (threads != null) {
        final Thread ct = Thread.currentThread();
        message.append("current thread: ").append(ct).append('(').append(ct.getId()).append(')');    //NOI18N
        message.append("threads: \n");     //NOI18N   //NOI18N
        stackTraces(threads, message);
    }
    if (lockFactory != null) {
        message.append("lockFactory: ").append(lockFactory);    //NOI18N
    }
    return Exceptions.attachMessage(e, message.toString());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:30,代码来源:RecordOwnerLockFactory.java

示例4: newDirectory

import org.apache.lucene.store.LockFactory; //导入依赖的package包/类
@Override
public Directory newDirectory() throws IOException {
    final Path location = path.resolveIndex();
    final LockFactory lockFactory = indexSettings.getValue(INDEX_LOCK_FACTOR_SETTING);
    Files.createDirectories(location);
    Directory wrapped = newFSDirectory(location, lockFactory);
    Set<String> preLoadExtensions = new HashSet<>(
            indexSettings.getValue(IndexModule.INDEX_STORE_PRE_LOAD_SETTING));
    wrapped = setPreload(wrapped, location, lockFactory, preLoadExtensions);
    if (indexSettings.isOnSharedFilesystem()) {
        wrapped = new SleepingLockWrapper(wrapped, 5000);
    }
    return wrapped;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:15,代码来源:FsDirectoryService.java

示例5: newFSDirectory

import org.apache.lucene.store.LockFactory; //导入依赖的package包/类
protected Directory newFSDirectory(Path location, LockFactory lockFactory) throws IOException {
    final String storeType = indexSettings.getSettings().get(IndexModule.INDEX_STORE_TYPE_SETTING.getKey(),
        IndexModule.Type.FS.getSettingsKey());
    if (IndexModule.Type.FS.match(storeType)) {
        return FSDirectory.open(location, lockFactory); // use lucene defaults
    } else if (IndexModule.Type.SIMPLEFS.match(storeType)) {
        return new SimpleFSDirectory(location, lockFactory);
    } else if (IndexModule.Type.NIOFS.match(storeType)) {
        return new NIOFSDirectory(location, lockFactory);
    } else if (IndexModule.Type.MMAPFS.match(storeType)) {
        return new MMapDirectory(location, lockFactory);
    }
    throw new IllegalArgumentException("No directory found for type [" + storeType + "]");
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:15,代码来源:FsDirectoryService.java

示例6: newFSDirectory

import org.apache.lucene.store.LockFactory; //导入依赖的package包/类
@Override
protected synchronized Directory newFSDirectory(Path location, LockFactory lockFactory) throws IOException {
    throw new UnsupportedOperationException();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:MockFSDirectoryService.java

示例7: newFSDirectory

import org.apache.lucene.store.LockFactory; //导入依赖的package包/类
@Override
protected Directory newFSDirectory(Path location, LockFactory lockFactory) throws IOException {
    logger.debug("wrapping SimpleFSDirectory for SMB");
    return new SmbDirectoryWrapper(new SimpleFSDirectory(location, lockFactory));
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:6,代码来源:SmbSimpleFsDirectoryService.java

示例8: newFSDirectory

import org.apache.lucene.store.LockFactory; //导入依赖的package包/类
@Override
protected Directory newFSDirectory(Path location, LockFactory lockFactory) throws IOException {
    logger.debug("wrapping MMapDirectory for SMB");
    return new SmbDirectoryWrapper(new MMapDirectory(location, indexSettings.getValue(INDEX_LOCK_FACTOR_SETTING)));
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:6,代码来源:SmbMmapFsDirectoryService.java

示例9: getLockFactory

import org.apache.lucene.store.LockFactory; //导入依赖的package包/类
@Override public LockFactory getLockFactory() {
  return null;
}
 
开发者ID:XiaoMi,项目名称:linden,代码行数:4,代码来源:FileSystemDirectory.java

示例10: newFSDirectory

import org.apache.lucene.store.LockFactory; //导入依赖的package包/类
/** Returns a new FSDirectory instance over the given file, which must be a folder. */
public static BaseDirectoryWrapper newFSDirectory(File f, LockFactory lf) {
  return newFSDirectory(f, lf, rarely());
}
 
开发者ID:europeana,项目名称:search,代码行数:5,代码来源:LuceneTestCase.java

示例11: getLockFactory

import org.apache.lucene.store.LockFactory; //导入依赖的package包/类
public LockFactory getLockFactory() {
  return directory.getLockFactory();
}
 
开发者ID:europeana,项目名称:search,代码行数:4,代码来源:BlockDirectory.java

示例12: setLockFactory

import org.apache.lucene.store.LockFactory; //导入依赖的package包/类
public void setLockFactory(LockFactory lockFactory) throws IOException {
  directory.setLockFactory(lockFactory);
}
 
开发者ID:europeana,项目名称:search,代码行数:4,代码来源:BlockDirectory.java

示例13: getLockFactory

import org.apache.lucene.store.LockFactory; //导入依赖的package包/类
@Override
public LockFactory getLockFactory() {
  return wrapped.getLockFactory();
}
 
开发者ID:CDLUC3,项目名称:dash-xtf,代码行数:5,代码来源:FlippingDirectory.java

示例14: setLockFactory

import org.apache.lucene.store.LockFactory; //导入依赖的package包/类
@Override
public void setLockFactory(LockFactory lockFactory) {
  wrapped.setLockFactory(lockFactory);
}
 
开发者ID:CDLUC3,项目名称:dash-xtf,代码行数:5,代码来源:FlippingDirectory.java

示例15: DistributedDirectory

import org.apache.lucene.store.LockFactory; //导入依赖的package包/类
public DistributedDirectory(NosqlDirectory nosqlDirectory, LockFactory lockFactory) throws IOException {
	super(lockFactory);
	this.nosqlDirectory = nosqlDirectory;
}
 
开发者ID:lumongo,项目名称:lumongo,代码行数:5,代码来源:DistributedDirectory.java


注:本文中的org.apache.lucene.store.LockFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。