Package org.apache.lucene.index

Examples of org.apache.lucene.index.AtomicReader


    };
    String shard = "shard";
    TableDescriptor table = new TableDescriptor();
    table.setName("test");

    AtomicReader reader = indexReader.leaves().iterator().next().reader();

    long t1 = System.nanoTime();
    indexWarmup.warmBlurIndex(table, shard, reader, isClosed, releaseReader, pauseWarmup);
    long t2 = System.nanoTime();
    System.out.println((t2 - t1) / 1000000.0);
View Full Code Here


    Info info = _infoMap.get(key);
    if (info == null) {
      info = new Info(context, scorers, _locks);
      _infoMap.put(key, info);
    } else {
      AtomicReader reader = context.reader();
      LOG.warn("Info about reader context [{0}] already created, existing Info [{1}] current reader [{2}].", context,
          info, reader);
    }
  }
View Full Code Here

    public String toString() {
      return "Info scorers length [" + _scorers.length + "] reader [" + _reader + "]";
    }

    Info(AtomicReaderContext context, Scorer[] scorers, Lock[] locks) {
      AtomicReader reader = context.reader();
      _bitSet = new OpenBitSet(reader.maxDoc());
      _scorers = scorers;
      _reader = reader;
      _readerStr = _reader.toString();
      _maxDoc = _reader.maxDoc();
      _locks = locks;
View Full Code Here

  private Iterable<String> getFields(IndexReader reader) throws IOException {
    Set<String> fields = new TreeSet<String>();
    for (IndexReaderContext ctext : reader.getContext().leaves()) {
      AtomicReaderContext atomicReaderContext = (AtomicReaderContext) ctext;
      AtomicReader atomicReader = atomicReaderContext.reader();
      if (atomicReader instanceof SegmentReader) {
        for (String f : atomicReader.fields()) {
          fields.add(f);
        }
      }
    }
    return fields;
View Full Code Here

    _filter = filter;
  }

  @Override
  public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException {
    AtomicReader reader = context.reader();
    Object key = reader.getCoreCacheKey();
    DocIdSet docIdSet = _cache.get(key);
    if (docIdSet != null) {
      _hits.incrementAndGet();
      return BitsFilteredDocIdSet.wrap(docIdSet, acceptDocs);
    }
View Full Code Here

      BlurPartitioner blurPartitioner = new BlurPartitioner();
      Text key = new Text();
      int numberOfShards = _shardContext.getTableContext().getDescriptor().getShardCount();
      int shardId = BlurUtil.getShardIndex(shard);
      for (AtomicReaderContext context : leaves) {
        AtomicReader atomicReader = context.reader();
        Fields fields = atomicReader.fields();
        Terms terms = fields.terms(BlurConstants.ROW_ID);
        if (terms != null) {
          TermsEnum termsEnum = terms.iterator(null);
          BytesRef ref = null;
          while ((ref = termsEnum.next()) != null) {
View Full Code Here

    if (startWith == null) {
      startWith = "";
    }
    Term term = getTerm(columnFamily, columnName, startWith);
    List<String> terms = new ArrayList<String>(size);
    AtomicReader areader = BlurUtil.getAtomicReader(reader);
    Terms termsAll = areader.terms(term.field());

    if (termsAll == null) {
      return terms;
    }
View Full Code Here

    if (indexReader instanceof SegmentReader) {
      return (SegmentReader) indexReader;
    }
    if (indexReader instanceof ExitableFilterAtomicReader) {
      ExitableFilterAtomicReader exitableFilterAtomicReader = (ExitableFilterAtomicReader) indexReader;
      AtomicReader originalReader = exitableFilterAtomicReader.getOriginalReader();
      return getSegmentReader(originalReader);
    }
    return null;
  }
View Full Code Here

      if (_isClosed.get() || _stop.get()) {
        LOG.info("Context [{0}] index closed", context);
        return null;
      }
      AtomicReaderContext atomicReaderContext = (AtomicReaderContext) ctext;
      AtomicReader atomicReader = atomicReaderContext.reader();
      if (atomicReader instanceof SegmentReader) {
        SegmentReader segmentReader = (SegmentReader) atomicReader;
        if (segmentReader.getSegmentName().equals(segmentName)) {
          return segmentReader.directory();
        }
View Full Code Here

      if (_isClosed.get() || _stop.get()) {
        LOG.info("Context [{0}] index closed", context);
        return null;
      }
      AtomicReaderContext atomicReaderContext = (AtomicReaderContext) ctext;
      AtomicReader atomicReader = atomicReaderContext.reader();
      if (atomicReader instanceof SegmentReader) {
        SegmentReader segmentReader = (SegmentReader) atomicReader;
        return segmentReader.directory();
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.lucene.index.AtomicReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.