Examples of obtain()


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

      if (stale)
        throw new StaleReaderException("IndexReader out of date and no longer valid for delete, undelete, or setNorm operations");
 
      if (writeLock == null) {
        Lock writeLock = directory.makeLock(IndexWriter.WRITE_LOCK_NAME);
        if (!writeLock.obtain(IndexWriter.WRITE_LOCK_TIMEOUT)) // obtain write lock
          throw new LockObtainFailedException("Index locked for write: " + writeLock);
        this.writeLock = writeLock;
 
        // we have to check whether index has changed since this reader was opened.
        // if so, this reader is no longer valid for deletion
View Full Code Here

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

      // Clear the write lock in case it's leftover:
      directory.clearLock(WRITE_LOCK_NAME);
    }

    Lock writeLock = directory.makeLock(WRITE_LOCK_NAME);
    if (!writeLock.obtain(writeLockTimeout)) // obtain write lock
      throw new LockObtainFailedException("Index locked for write: " + writeLock);
    this.writeLock = writeLock;                   // save it

    try {
      if (create) {
View Full Code Here

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

      if (stale)
        throw new StaleReaderException("IndexReader out of date and no longer valid for delete, undelete, or setNorm operations");
 
      if (writeLock == null) {
        Lock writeLock = directory.makeLock(IndexWriter.WRITE_LOCK_NAME);
        if (!writeLock.obtain(IndexWriter.WRITE_LOCK_TIMEOUT)) // obtain write lock
          throw new LockObtainFailedException("Index locked for write: " + writeLock);
        this.writeLock = writeLock;
 
        // we have to check whether index has changed since this reader was opened.
        // if so, this reader is no longer valid for deletion
View Full Code Here

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

      if (stale)
        throw new StaleReaderException("IndexReader out of date and no longer valid for delete, undelete, or setNorm operations");

      if (writeLock == null) {
        Lock writeLock = directory.makeLock(IndexWriter.WRITE_LOCK_NAME);
        if (!writeLock.obtain(IndexWriterConfig.WRITE_LOCK_TIMEOUT)) // obtain write lock
          throw new LockObtainFailedException("Index locked for write: " + writeLock);
        this.writeLock = writeLock;

        // we have to check whether index has changed since this reader was opened.
        // if so, this reader is no longer valid for
View Full Code Here

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

              dicHome);
          Lock lock = FileLockFactory.makeLock(LOCK_FILE);

          boolean obtained = false;
          try {
            obtained = lock.obtain(90000);
            if (obtained) {
              // 编译词典-对词典进行可能的处理,以符合分词器的要求
              if (compiler.shouldCompile(p)) {
                Dictionaries dictionaries = readUnCompiledDictionaries(p);
                Paoding tempPaoding = createPaodingWithKnives(p);
View Full Code Here

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

      Lock commitLock=directory.makeLock(IndexWriter.COMMIT_LOCK_NAME);
     
      boolean locked=false;
     
      try {
         locked=commitLock.obtain(IndexWriter.COMMIT_LOCK_TIMEOUT);
        
         return SegmentInfos.readCurrentVersion(directory);
      } finally {
        if (locked) {
          commitLock.release();
View Full Code Here

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

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

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

    if (stale)
      throw new IOException("IndexReader out of date and no longer valid for delete, undelete, or setNorm operations");

    if (writeLock == null) {
      Lock writeLock = directory.makeLock(IndexWriter.WRITE_LOCK_NAME);
      if (!writeLock.obtain(IndexWriter.WRITE_LOCK_TIMEOUT)) // obtain write lock
        throw new IOException("Index locked for write: " + writeLock);
      this.writeLock = writeLock;

      // we have to check whether index has changed since this reader was opened.
      // if so, this reader is no longer valid for deletion
View Full Code Here

Examples of quickdb.binding.model.BindingObject.obtain()

    }

    public void testObtain(){
        BindingObject bind = new BindingObject();

        bind.obtain().If("name").equal("quickdb").find();
        System.out.println("quickdb".equalsIgnoreCase(bind.getName()));
        System.out.println(3000.50 == bind.getSalary());
    }

    public void testObtainWhere(){
View Full Code Here

Examples of quickdb.binding.model.BindingObject.obtain()

    }

    public void testObtainString(){
        BindingObject bind = new BindingObject();

        bind.obtain("name = 'quickdb'");
        System.out.println("quickdb".equalsIgnoreCase(bind.getName()));
        System.out.println(3000.50 == bind.getSalary());
    }

    public void testObtainSelect(){
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.