Package org.apache.lucene.store

Examples of org.apache.lucene.store.Lock.release()


         locked=commitLock.obtain(IndexWriter.COMMIT_LOCK_TIMEOUT);
        
         return SegmentInfos.readCurrentVersion(directory);
      } finally {
        if (locked) {
          commitLock.release();
        }
      }
    }
  }
 
View Full Code Here


         locked=commitLock.obtain(IndexWriter.COMMIT_LOCK_TIMEOUT);
        
         return SegmentInfos.readCurrentVersion(directory) == segmentInfos.getVersion();
      } finally {
        if (locked) {
          commitLock.release();
        }
      }
    }
  }
View Full Code Here

      if (!success) {
        if (infoStream != null) {
          message("init: hit exception on init; releasing write lock");
        }
        try {
          writeLock.release();
        } catch (Throwable t) {
          // don't mask the original exception
        }
        writeLock = null;
      }
View Full Code Here

      LOGGER.log(Level.SEVERE,"Error synchronizing index.",t);
    } finally {
      this.closeAll();
      if (backgroundLock != null) {
        try {
          backgroundLock.release();
        } catch (Throwable t) {
          LOGGER.log(Level.WARNING,"Error releasing lock.",t);
        }
      }
      if (this.wasInterrupted) {
View Full Code Here

          LOGGER.log(Level.SEVERE,"Error closing IndexWriter.",t);
        }
      }
      if (backgroundLock != null) {
        try {
          backgroundLock.release();
        } catch (Throwable t) {
          LOGGER.log(Level.WARNING,"Error releasing lock.",t);
        }
      }
      if (context != null) {
View Full Code Here

            Object wlObj = wlFld.get(writer);
            if ((wlObj != null) && (wlObj instanceof Lock)) {
              Lock wlLock = (Lock)wlObj;
              wasReleased = !wlLock.isLocked();
              if (!wasReleased) {
                wlLock.release();
                wasReleased = !wlLock.isLocked();
              }
            }
          } catch (Throwable t2) {
            getLogger().log(Level.WARNING,"Unable to forcibly release an abandoned write lock.",t2);
View Full Code Here

      LOGGER.log(Level.SEVERE,"Unknown error.",e);
     
    } finally {
      if (backgroundLock != null) {
        try {
          backgroundLock.release();
        } catch (Throwable t) {
          LOGGER.log(Level.WARNING,"Error releasing lock.",t);
        }
      }
      if (rContext != null) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.