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


Java DocValuesProducer类代码示例

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


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

示例1: newDocValuesProducer

import org.apache.lucene.codecs.DocValuesProducer; //导入依赖的package包/类
private RefCount<DocValuesProducer> newDocValuesProducer(SegmentCommitInfo si, IOContext context, Directory dir,
    DocValuesFormat dvFormat, final Long gen, FieldInfos infos, int termsIndexDivisor) throws IOException {
  Directory dvDir = dir;
  String segmentSuffix = "";
  if (gen.longValue() != -1) {
    dvDir = si.info.dir; // gen'd files are written outside CFS, so use SegInfo directory
    segmentSuffix = Long.toString(gen.longValue(), Character.MAX_RADIX);
  }

  // set SegmentReadState to list only the fields that are relevant to that gen
  SegmentReadState srs = new SegmentReadState(dvDir, si.info, infos, context, termsIndexDivisor, segmentSuffix);
  return new RefCount<DocValuesProducer>(dvFormat.fieldsProducer(srs)) {
    @SuppressWarnings("synthetic-access")
    @Override
    protected void release() throws IOException {
      object.close();
      synchronized (SegmentDocValues.this) {
        genDVProducers.remove(gen);
      }
    }
  };
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:23,代码来源:SegmentDocValues.java

示例2: newDocValuesProducer

import org.apache.lucene.codecs.DocValuesProducer; //导入依赖的package包/类
private RefCount<DocValuesProducer> newDocValuesProducer(SegmentCommitInfo si, IOContext context, Directory dir,
    DocValuesFormat dvFormat, final Long gen, List<FieldInfo> infos, int termsIndexDivisor) throws IOException {
  Directory dvDir = dir;
  String segmentSuffix = "";
  if (gen.longValue() != -1) {
    dvDir = si.info.dir; // gen'd files are written outside CFS, so use SegInfo directory
    segmentSuffix = Long.toString(gen.longValue(), Character.MAX_RADIX);
  }

  // set SegmentReadState to list only the fields that are relevant to that gen
  SegmentReadState srs = new SegmentReadState(dvDir, si.info, new FieldInfos(infos.toArray(new FieldInfo[infos.size()])), context, termsIndexDivisor, segmentSuffix);
  return new RefCount<DocValuesProducer>(dvFormat.fieldsProducer(srs)) {
    @SuppressWarnings("synthetic-access")
    @Override
    protected void release() throws IOException {
      object.close();
      synchronized (SegmentDocValues.this) {
        genDVProducers.remove(gen);
      }
    }
  };
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:23,代码来源:SegmentDocValues.java

示例3: initDocValuesProducers

import org.apache.lucene.codecs.DocValuesProducer; //导入依赖的package包/类
private void initDocValuesProducers(Codec codec) throws IOException {
    final Directory dir = core.cfsReader != null ? core.cfsReader : si.info.dir;
    final DocValuesFormat dvFormat = codec.docValuesFormat();
    final Map<Long,List<FieldInfo>> genInfos = getGenInfos();
    
//      System.out.println("[" + Thread.currentThread().getName() + "] SR.initDocValuesProducers: segInfo=" + si + "; gens=" + genInfos.keySet());
    
    for (Entry<Long,List<FieldInfo>> e : genInfos.entrySet()) {
      Long gen = e.getKey();
      List<FieldInfo> infos = e.getValue();
      DocValuesProducer dvp = segDocValues.getDocValuesProducer(gen, si, IOContext.READ, dir, dvFormat, infos, getTermInfosIndexDivisor());
      for (FieldInfo fi : infos) {
        dvProducers.put(fi.name, dvp);
      }
    }
    
    dvGens.addAll(genInfos.keySet());
  }
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:19,代码来源:SegmentReader.java

示例4: normsProducer

import org.apache.lucene.codecs.DocValuesProducer; //导入依赖的package包/类
@Override
public DocValuesProducer normsProducer(SegmentReadState state) throws IOException {
  String filename = IndexFileNames.segmentFileName(state.segmentInfo.name, 
                                                   "nrm", 
                                                   IndexFileNames.COMPOUND_FILE_EXTENSION);
  return new Lucene40DocValuesReader(state, filename, Lucene40FieldInfosReader.LEGACY_NORM_TYPE_KEY);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:Lucene40NormsFormat.java

示例5: fieldsProducer

import org.apache.lucene.codecs.DocValuesProducer; //导入依赖的package包/类
@Override
public DocValuesProducer fieldsProducer(SegmentReadState state) throws IOException {
  String filename = IndexFileNames.segmentFileName(state.segmentInfo.name, 
                                                   "dv", 
                                                   IndexFileNames.COMPOUND_FILE_EXTENSION);
  return new Lucene40DocValuesReader(state, filename, Lucene40FieldInfosReader.LEGACY_DV_TYPE_KEY);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:Lucene40DocValuesFormat.java

示例6: ramBytesUsed

import org.apache.lucene.codecs.DocValuesProducer; //导入依赖的package包/类
@Override
public long ramBytesUsed() {
  long size = 0;
  for (Map.Entry<String,DocValuesProducer> entry : formats.entrySet()) {
    size += (entry.getKey().length() * RamUsageEstimator.NUM_BYTES_CHAR) + 
        entry.getValue().ramBytesUsed();
  }
  return size;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:PerFieldDocValuesFormat.java

示例7: getDocValuesProducer

import org.apache.lucene.codecs.DocValuesProducer; //导入依赖的package包/类
/** Returns the {@link DocValuesProducer} for the given generation. */
synchronized DocValuesProducer getDocValuesProducer(long gen, SegmentCommitInfo si, IOContext context, Directory dir, 
    DocValuesFormat dvFormat, FieldInfos infos, int termsIndexDivisor) throws IOException {
  RefCount<DocValuesProducer> dvp = genDVProducers.get(gen);
  if (dvp == null) {
    dvp = newDocValuesProducer(si, context, dir, dvFormat, gen, infos, termsIndexDivisor);
    assert dvp != null;
    genDVProducers.put(gen, dvp);
  } else {
    dvp.incRef();
  }
  return dvp.get();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:SegmentDocValues.java

示例8: checkIntegrity

import org.apache.lucene.codecs.DocValuesProducer; //导入依赖的package包/类
@Override
public void checkIntegrity() throws IOException {
  ensureOpen();
  
  // stored fields
  getFieldsReader().checkIntegrity();
  
  // term vectors
  TermVectorsReader termVectorsReader = getTermVectorsReader();
  if (termVectorsReader != null) {
    termVectorsReader.checkIntegrity();
  }
  
  // terms/postings
  if (core.fields != null) {
    core.fields.checkIntegrity();
  }
  
  // norms
  if (core.normsProducer != null) {
    core.normsProducer.checkIntegrity();
  }
  
  // docvalues
  if (dvProducers != null) {
    for (DocValuesProducer producer : dvProducers) {
      producer.checkIntegrity();
    }
  }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:31,代码来源:SegmentReader.java

示例9: getDocValuesReader

import org.apache.lucene.codecs.DocValuesProducer; //导入依赖的package包/类
@Override
public DocValuesProducer getDocValuesReader() {
    DocValuesProducer producer = in.getDocValuesReader();
    // TODO: move this nullness stuff out
    if (producer == null) {
        producer = FilterDocValuesProducer.EMPTY;
    }
    return new UninvertedVersions(producer, this);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:10,代码来源:VersionFieldUpgrader.java

示例10: normsProducer

import org.apache.lucene.codecs.DocValuesProducer; //导入依赖的package包/类
@Override
public DocValuesProducer normsProducer(SegmentReadState state) throws IOException {
  assert state.fieldInfos.hasNorms();
  DocValuesProducer producer = in.normsProducer(state);
  assert producer != null;
  return new AssertingDocValuesProducer(producer, state.segmentInfo.getDocCount());
}
 
开发者ID:europeana,项目名称:search,代码行数:8,代码来源:AssertingNormsFormat.java

示例11: fieldsProducer

import org.apache.lucene.codecs.DocValuesProducer; //导入依赖的package包/类
@Override
public DocValuesProducer fieldsProducer(SegmentReadState state) throws IOException {
  assert state.fieldInfos.hasDocValues();
  DocValuesProducer producer = in.fieldsProducer(state);
  assert producer != null;
  return new AssertingDocValuesProducer(producer, state.segmentInfo.getDocCount());
}
 
开发者ID:europeana,项目名称:search,代码行数:8,代码来源:AssertingDocValuesFormat.java

示例12: fieldsProducer

import org.apache.lucene.codecs.DocValuesProducer; //导入依赖的package包/类
@Override
public DocValuesProducer fieldsProducer(SegmentReadState state) throws IOException {
  return new CheapBastardDocValuesProducer(state, DiskDocValuesFormat.DATA_CODEC, 
                                                  DiskDocValuesFormat.DATA_EXTENSION, 
                                                  DiskDocValuesFormat.META_CODEC, 
                                                  DiskDocValuesFormat.META_EXTENSION);
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:8,代码来源:CheapBastardDocValuesFormat.java

示例13: getDocValuesProducer

import org.apache.lucene.codecs.DocValuesProducer; //导入依赖的package包/类
/** Returns the {@link DocValuesProducer} for the given generation. */
synchronized DocValuesProducer getDocValuesProducer(long gen, SegmentCommitInfo si, IOContext context, Directory dir, 
    DocValuesFormat dvFormat, List<FieldInfo> infos, int termsIndexDivisor) throws IOException {
  RefCount<DocValuesProducer> dvp = genDVProducers.get(gen);
  if (dvp == null) {
    dvp = newDocValuesProducer(si, context, dir, dvFormat, gen, infos, termsIndexDivisor);
    assert dvp != null;
    genDVProducers.put(gen, dvp);
  } else {
    dvp.incRef();
  }
  return dvp.get();
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:14,代码来源:SegmentDocValues.java


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