Package org.apache.lucene.index.IndexReader

Examples of org.apache.lucene.index.IndexReader.ReaderClosedListener


      }
      if (ex != null) {
       if (VERBOSE) {
        System.out.println("NOTE: newSearcher using ExecutorService with " + threads + " threads");
       }
       r.addReaderClosedListener(new ReaderClosedListener() {
         @Override
         public void onClose(final IndexReader reader) {
           _TestUtil.shutdownExecutorService(ex);
         }
       });
View Full Code Here


  public static OpenBitSet getPrimeDocBitSet(Term primeDocTerm, IndexReader reader) throws IOException {
    Object key = reader.getCoreCacheKey();
    final Map<Object, OpenBitSet> primeDocMap = getPrimeDocMap(primeDocTerm);
    OpenBitSet bitSet = primeDocMap.get(key);
    if (bitSet == null) {
      reader.addReaderClosedListener(new ReaderClosedListener() {
        @Override
        public void onClose(IndexReader reader) {
          Object key = reader.getCoreCacheKey();
          LOG.debug("Current size [" + primeDocMap.size() + "] Prime Doc BitSet removing for segment [" + reader + "]");
          primeDocMap.remove(key);
View Full Code Here

      }
      if (ex != null) {
       if (VERBOSE) {
        System.out.println("NOTE: newSearcher using ExecutorService with " + threads + " threads");
       }
       r.addReaderClosedListener(new ReaderClosedListener() {
         @Override
         public void onClose(IndexReader reader) {
           _TestUtil.shutdownExecutorService(ex);
         }
       });
View Full Code Here

      }
      if (ex != null) {
       if (VERBOSE) {
        System.out.println("NOTE: newSearcher using ExecutorService with " + threads + " threads");
       }
       r.addReaderClosedListener(new ReaderClosedListener() {
         @Override
         public void onClose(IndexReader reader) {
           _TestUtil.shutdownExecutorService(ex);
         }
       });
View Full Code Here

    Object key = reader.getCoreCacheKey();
    final Map<Object, OpenBitSet> primeDocMap = getPrimeDocMap(primeDocTerm);
    OpenBitSet bitSet = primeDocMap.get(key);
    if (bitSet == null) {
      synchronized (reader) {
        reader.addReaderClosedListener(new ReaderClosedListener() {
          @Override
          public void onClose(IndexReader reader) {
            Object key = reader.getCoreCacheKey();
            LOG.debug("Current size [" + primeDocMap.size() + "] Prime Doc BitSet removing for segment [" + reader
                + "]");
View Full Code Here

  }

  public DirectoryReader register(DirectoryReader reader) throws IOException {
    final long generation = reader.getIndexCommit().getGeneration();
    register(generation);
    reader.addReaderClosedListener(new ReaderClosedListener() {
      @Override
      public void onClose(IndexReader reader) {
        unregister(generation);
      }
    });
View Full Code Here

      }
      if (ex != null) {
       if (VERBOSE) {
        System.out.println("NOTE: newSearcher using ExecutorService with " + threads + " threads");
       }
       r.addReaderClosedListener(new ReaderClosedListener() {
         @Override
         public void onClose(IndexReader reader) {
           _TestUtil.shutdownExecutorService(ex);
         }
       });
View Full Code Here

    final int[] listenerClosedCount = new int[1];

    assertEquals(3, pr.leaves().size());

    for(AtomicReaderContext cxt : pr.leaves()) {
      cxt.reader().addReaderClosedListener(new ReaderClosedListener() {
          @Override
          public void onClose(IndexReader reader) {
            listenerClosedCount[0]++;
          }
        });
View Full Code Here

    final int[] listenerClosedCount = new int[1];

    assertEquals(3, pr.leaves().size());

    for(AtomicReaderContext cxt : pr.leaves()) {
      cxt.reader().addReaderClosedListener(new ReaderClosedListener() {
          @Override
          public void onClose(IndexReader reader) {
            listenerClosedCount[0]++;
          }
        });
View Full Code Here

      }
      if (ex != null) {
       if (VERBOSE) {
         System.out.println("NOTE: newSearcher using ExecutorService with " + threads + " threads");
       }
       r.addReaderClosedListener(new ReaderClosedListener() {
         @Override
         public void onClose(IndexReader reader) {
           TestUtil.shutdownExecutorService(ex);
         }
       });
View Full Code Here

TOP

Related Classes of org.apache.lucene.index.IndexReader.ReaderClosedListener

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.