本文整理了Java中proj.zoie.api.ZoieMultiReader.<init>()
方法的一些代码示例,展示了ZoieMultiReader.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoieMultiReader.<init>()
方法的具体详情如下:
包路径:proj.zoie.api.ZoieMultiReader
类名称:ZoieMultiReader
方法名:<init>
暂无
代码示例来源:origin: com.linkedin.zoie/zoie-core
public static <R extends IndexReader> ZoieIndexReader<R> open(IndexReader r,IndexReaderDecorator<R> decorator) throws IOException{
return new ZoieMultiReader<R>(r,decorator);
}
代码示例来源:origin: com.linkedin.zoie/zoie-core
protected ZoieMultiReader<R> newInstance(IndexReader inner,IndexReader[] subReaders) throws IOException{
return new ZoieMultiReader<R>(inner, subReaders ,_decorator);
}
代码示例来源:origin: com.senseidb.zoie/zoie-core
public ZoieMultiReader<R> reopen() throws IOException {
long t0 = System.currentTimeMillis();
DirectoryReader inner = DirectoryReader.openIfChanged(in);
if (inner == null) {
t0 = System.currentTimeMillis() - t0;
if (t0 > 1000) {
log.info("reopen returns in " + t0 + "ms without change");
} else {
if (log.isDebugEnabled()) {
log.debug("reopen returns in " + t0 + "ms without change");
}
}
return this;
}
ZoieMultiReader<R> ret = new ZoieMultiReader<R>(inner, _decorator, new ZoieSubReaderWrapper<R>(
_decorator, _readerMap));
t0 = System.currentTimeMillis() - t0;
if (t0 > 1000) {
log.info("reopen returns in " + t0 + "ms with change");
} else {
if (log.isDebugEnabled()) {
log.debug("reopen returns in " + t0 + "ms with change");
}
}
return ret;
}
代码示例来源:origin: senseidb/zoie
public ZoieMultiReader<R> reopen() throws IOException {
long t0 = System.currentTimeMillis();
DirectoryReader inner = DirectoryReader.openIfChanged(in);
if (inner == null) {
t0 = System.currentTimeMillis() - t0;
if (t0 > 1000) {
log.info("reopen returns in " + t0 + "ms without change");
} else {
if (log.isDebugEnabled()) {
log.debug("reopen returns in " + t0 + "ms without change");
}
}
return this;
}
ZoieMultiReader<R> ret = new ZoieMultiReader<R>(inner, _decorator, new ZoieSubReaderWrapper<R>(
_decorator, _readerMap));
t0 = System.currentTimeMillis() - t0;
if (t0 > 1000) {
log.info("reopen returns in " + t0 + "ms with change");
} else {
if (log.isDebugEnabled()) {
log.debug("reopen returns in " + t0 + "ms with change");
}
}
return ret;
}
代码示例来源: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.senseidb.zoie/zoie-core
/**
* makes exact shallow copy of a given ZoieMultiReader
* @throws IOException
*/
public ZoieMultiReader<R> copy() throws IOException {
// increase DirectoryReader reference counter
this.in.incRef();
ZoieMultiReader<R> ret = new ZoieMultiReader<R>(this.in, this._decorator,
new ZoieSubReaderWrapper<R>(this._decorator, this._readerMap));
ret._docIDMapper = this._docIDMapper;
return ret;
}
代码示例来源:origin: senseidb/zoie
/**
* makes exact shallow copy of a given ZoieMultiReader
* @throws IOException
*/
public ZoieMultiReader<R> copy() throws IOException {
// increase DirectoryReader reference counter
this.in.incRef();
ZoieMultiReader<R> ret = new ZoieMultiReader<R>(this.in, this._decorator,
new ZoieSubReaderWrapper<R>(this._decorator, this._readerMap));
ret._docIDMapper = this._docIDMapper;
return ret;
}
代码示例来源: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: com.senseidb.zoie/zoie-core
reader = new ZoieMultiReader<R>(srcReader, decorator);
_currentSignature = signature;
} catch (IOException ioe) {
代码示例来源:origin: senseidb/zoie
reader = new ZoieMultiReader<R>(srcReader, decorator);
_currentSignature = signature;
} catch (IOException ioe) {
代码示例来源:origin: com.senseidb/sensei-core
new StandardAnalyzer(Version.LUCENE_43)));
addDocuments(directory, writer, documents);
ZoieMultiReader<BoboSegmentReader> zoieMultiReader = new ZoieMultiReader<BoboSegmentReader>(
DirectoryReader.open(directory), new SenseiIndexReaderDecorator(facets, runtimeFacets));
MockIndexReaderFactory mockIndexReaderFactory = new MockIndexReaderFactory(
代码示例来源: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
zoiereader = new ZoieMultiReader<R>(reader, _decorator);
代码示例来源:origin: senseidb/zoie
zoiereader = new ZoieMultiReader<R>(reader, _decorator);
代码示例来源:origin: com.linkedin.zoie/zoie-core
zoiereader = new ZoieMultiReader<R>(reader, _decorator);
内容来源于网络,如有侵权,请联系作者删除!