本文整理了Java中proj.zoie.api.ZoieMultiReader.setDocIDMapper()
方法的一些代码示例,展示了ZoieMultiReader.setDocIDMapper()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoieMultiReader.setDocIDMapper()
方法的具体详情如下:
包路径:proj.zoie.api.ZoieMultiReader
类名称:ZoieMultiReader
方法名:setDocIDMapper
暂无
代码示例来源:origin: senseidb/zoie
protected List<ZoieMultiReader<R>> loadArchives() {
List<ZoieMultiReader<R>> archives = new ArrayList<ZoieMultiReader<R>>();
long t0 = System.currentTimeMillis();
List<Directory> dirs = _dirMgrFactory.getAllArchivedDirectories();
for (Directory dir : dirs) {
DirectoryReader reader;
try {
reader = DirectoryReader.open(dir);
ZoieMultiReader<R> zoiereader = new ZoieMultiReader<R>(reader, _decorator);
// Initialize docIdMapper
DocIDMapper mapper = _zConfig.getDocidMapperFactory().getDocIDMapper(zoiereader);
zoiereader.setDocIDMapper(mapper);
archives.add(zoiereader);
} catch (CorruptIndexException e) {
log.error("corruptedIndex", e);
} catch (IOException e) {
log.error("IOException", e);
}
}
log.info("load " + dirs.size() + " archived indices of " + getSizeBytes() + " bytes in "
+ (System.currentTimeMillis() - t0) + "ms");
return archives;
}
代码示例来源:origin: com.senseidb.zoie/zoie-core
protected List<ZoieMultiReader<R>> loadArchives() {
List<ZoieMultiReader<R>> archives = new ArrayList<ZoieMultiReader<R>>();
long t0 = System.currentTimeMillis();
List<Directory> dirs = _dirMgrFactory.getAllArchivedDirectories();
for (Directory dir : dirs) {
DirectoryReader reader;
try {
reader = DirectoryReader.open(dir);
ZoieMultiReader<R> zoiereader = new ZoieMultiReader<R>(reader, _decorator);
// Initialize docIdMapper
DocIDMapper mapper = _zConfig.getDocidMapperFactory().getDocIDMapper(zoiereader);
zoiereader.setDocIDMapper(mapper);
archives.add(zoiereader);
} catch (CorruptIndexException e) {
log.error("corruptedIndex", e);
} catch (IOException e) {
log.error("IOException", e);
}
}
log.info("load " + dirs.size() + " archived indices of " + getSizeBytes() + " bytes in "
+ (System.currentTimeMillis() - t0) + "ms");
return archives;
}
代码示例来源:origin: com.linkedin.zoie/zoie-core
protected List<ZoieIndexReader<R>> loadArchives()
{
List<ZoieIndexReader<R>> archives = new ArrayList<ZoieIndexReader<R>>();
long t0 = System.currentTimeMillis();
List<Directory> dirs = _dirMgrFactory.getAllArchivedDirectories();
for(Directory dir : dirs)
{
IndexReader reader;
try
{
reader = IndexReader.open(dir,true);
ZoieMultiReader<R> zoiereader = new ZoieMultiReader<R>(reader, _decorator);
// Initialize docIdMapper
DocIDMapper<?> mapper = _zConfig.getDocidMapperFactory().getDocIDMapper(zoiereader);
zoiereader.setDocIDMapper(mapper);
archives.add(zoiereader);
} catch (CorruptIndexException e)
{
log.error("corruptedIndex", e);
} catch (IOException e)
{
log.error("IOException", e);
}
}
log.info("load "+dirs.size()+" archived indices of " + getSizeBytes() +" bytes in " + (System.currentTimeMillis() - t0) + "ms");
return archives;
}
ZoieSystem<R, D> createZoie(DirectoryManager dirmgr)
代码示例来源:origin: senseidb/zoie
private ZoieMultiReader<R> openIndexReaderInternal() throws IOException {
if (DirectoryReader.indexExists(_directory)) {
DirectoryReader srcReader = null;
ZoieMultiReader<R> finalReader = null;
try {
// for RAM indexes, just get a new index reader
srcReader = DirectoryReader.open(_directory);
finalReader = new ZoieMultiReader<R>(srcReader, _decorator);
DocIDMapper mapper = _idxMgr._docIDMapperFactory.getDocIDMapper(finalReader);
finalReader.setDocIDMapper(mapper);
return finalReader;
} catch (IOException ioe) {
// if reader decoration fails, still need to close the source reader
if (srcReader != null) {
srcReader.close();
}
throw ioe;
}
} else {
return null; // null indicates no index exist, following the contract
}
}
代码示例来源:origin: com.senseidb.zoie/zoie-core
private ZoieMultiReader<R> openIndexReaderInternal() throws IOException {
if (DirectoryReader.indexExists(_directory)) {
DirectoryReader srcReader = null;
ZoieMultiReader<R> finalReader = null;
try {
// for RAM indexes, just get a new index reader
srcReader = DirectoryReader.open(_directory);
finalReader = new ZoieMultiReader<R>(srcReader, _decorator);
DocIDMapper mapper = _idxMgr._docIDMapperFactory.getDocIDMapper(finalReader);
finalReader.setDocIDMapper(mapper);
return finalReader;
} catch (IOException ioe) {
// if reader decoration fails, still need to close the source reader
if (srcReader != null) {
srcReader.close();
}
throw ioe;
}
} else {
return null; // null indicates no index exist, following the contract
}
}
代码示例来源:origin: com.senseidb.zoie/zoie-core
if (reader != null) {
DocIDMapper mapper = _idx._idxMgr._docIDMapperFactory.getDocIDMapper(reader);
reader.setDocIDMapper(mapper);
代码示例来源:origin: senseidb/zoie
if (reader != null) {
DocIDMapper mapper = _idx._idxMgr._docIDMapperFactory.getDocIDMapper(reader);
reader.setDocIDMapper(mapper);
代码示例来源:origin: com.senseidb.zoie/zoie-core
zoiereader.setDocIDMapper(mapper);
} catch (IOException e) {
log.error(e);
代码示例来源:origin: senseidb/zoie
zoiereader.setDocIDMapper(mapper);
} catch (IOException e) {
log.error(e);
代码示例来源:origin: com.linkedin.zoie/zoie-core
zoiereader.setDocIDMapper(mapper);
} catch (IOException e)
代码示例来源:origin: senseidb/zoie
@Override
public void refresh() throws IOException {
synchronized (this) {
ZoieMultiReader<R> reader = null;
if (_currentReader == null) {
reader = openIndexReaderInternal();
} else {
reader = _currentReader.reopen();
if (reader != _currentReader) {
DocIDMapper mapper = _idxMgr._docIDMapperFactory.getDocIDMapper(reader);
reader.setDocIDMapper(mapper);
}
}
if (_currentReader != reader) {
ZoieMultiReader<R> oldReader = _currentReader;
_currentReader = reader;
if (oldReader != null) {
oldReader.decZoieRef();
}
}
LongSet delDocs = _delDocs;
clearDeletes();
markDeletes(delDocs); // re-mark deletes
commitDeletes();
}
}
代码示例来源:origin: com.senseidb.zoie/zoie-core
@Override
public void refresh() throws IOException {
synchronized (this) {
ZoieMultiReader<R> reader = null;
if (_currentReader == null) {
reader = openIndexReaderInternal();
} else {
reader = _currentReader.reopen();
if (reader != _currentReader) {
DocIDMapper mapper = _idxMgr._docIDMapperFactory.getDocIDMapper(reader);
reader.setDocIDMapper(mapper);
}
}
if (_currentReader != reader) {
ZoieMultiReader<R> oldReader = _currentReader;
_currentReader = reader;
if (oldReader != null) {
oldReader.decZoieRef();
}
}
LongSet delDocs = _delDocs;
clearDeletes();
markDeletes(delDocs); // re-mark deletes
commitDeletes();
}
}
内容来源于网络,如有侵权,请联系作者删除!