Package org.apache.lucene.store

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


                + " failed:" + ex.getMessage());
            throw ex;
          } finally {
            if (obtained) {
              try {
                lock.release();
              } catch (Exception ex) {

              }
            }
          }
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

      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

    } finally {
        replicationHandler.core.getDeletionPolicy().releaseCommitPoint(indexCommit.getVersion());  
        replicationHandler.snapShootDetails = details;
      if (lock != null) {
        try {
          lock.release();
        } catch (IOException e) {
          LOG.error("Unable to release snapshoot lock: " + directoryName + ".lock");
        }
      }
    }
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

            assertThat(lock.obtain(200), equalTo(false));
            assertThat("lock should be thrown", false, equalTo(true));
        } catch (LockObtainFailedException e) {
            // all is well
        }
        lock.release();
        assertThat(lock.isLocked(), equalTo(false));
        dir.close();
        cache.close();
    }
View Full Code Here

    } finally {
        replicationHandler.core.getDeletionPolicy().releaseCommitPoint(indexCommit.getVersion());  
        replicationHandler.snapShootDetails = details;
      if (lock != null) {
        try {
          lock.release();
        } catch (IOException e) {
          LOG.error("Unable to release snapshoot lock: " + directoryName + ".lock");
        }
      }
    }
View Full Code Here

         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

                + " failed:" + ex.getMessage());
            throw ex;
          } finally {
            if (obtained) {
              try {
                lock.release();
              } catch (Exception ex) {

              }
            }
          }
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.