Package org.apache.lucene.store

Examples of org.apache.lucene.store.NativeFSLockFactory


   */
  public synchronized void startup() throws PersistenceException {
    try {
      if (fDirectory == null) {
        String path = Activator.getDefault().getStateLocation().toOSString();
        LockFactory lockFactory = new NativeFSLockFactory(path);
        fDirectory = FSDirectory.getDirectory(path, lockFactory);
      }

      if (fIndexer == null)
        fIndexer = new Indexer(this, fDirectory);
View Full Code Here


   */
  public void startup() throws PersistenceException {
    try {
      if (fDirectory == null) {
        String path = Activator.getDefault().getStateLocation().toOSString();
        LockFactory lockFactory = new NativeFSLockFactory(path);
        fDirectory = FSDirectory.getDirectory(path, lockFactory);
      }

      if (fIndexer == null)
        fIndexer = new Indexer(this, fDirectory);
View Full Code Here

      new Function() {
        public void run() throws Exception {
          String LOCK_FILE = "write.lock";
          String dicHome = p
              .getProperty("paoding.dic.home.absolute.path");
          FSLockFactory FileLockFactory = new NativeFSLockFactory(
              dicHome);
          Lock lock = FileLockFactory.makeLock(LOCK_FILE);

          boolean obtained = false;
          try {
            obtained = lock.obtain(90000);
            if (obtained) {
View Full Code Here

               }
            }
            // if both not defined, using FSDirectory.open
            if (FS_DIRECTORY_CLASS == null && LOCK_FACTORY_CLASS == null)
            {
               return FSDirectory.open(dir, new NativeFSLockFactory(dir));
            }
            // LOCK FACTORY only defined, using deprecated getDirectory method
            else
            {
               return FSDirectory.getDirectory(dir, LOCK_FACTORY_CLASS != null ? null : new NativeFSLockFactory(dir));
            }
         }
      });
   }
View Full Code Here

    else if ( "native".equals( lockFactoryName ) ) {
      if ( indexDir==null ) {
        throw new SearchException( "To use \"native\" as a LockFactory strategy an indexBase path must be set");
      }
      try {
        return new NativeFSLockFactory( indexDir );
      } catch (IOException e) {
        throw new SearchException( "Could not initialize NativeFSLockFactory", e);
      }
    }
    else if ( "single".equals( lockFactoryName ) ) {
View Full Code Here

        if (name.equals(".")) {
            dir = baseDir;
        } else {
            dir = new File(baseDir, name);
        }
        return FSDirectory.getDirectory(dir, new NativeFSLockFactory(dir));
    }
View Full Code Here

    else if ( "native".equals( lockFactoryName ) ) {
      if ( indexDir == null ) {
        throw new SearchException( "To use \"native\" as a LockFactory strategy an indexBase path must be set" );
      }
      try {
        return new NativeFSLockFactory( indexDir );
      }
      catch (IOException e) {
        throw new SearchException( "Could not initialize NativeFSLockFactory", e );
      }
    }
View Full Code Here

    else if ( "native".equals( lockFactoryName ) ) {
      if ( indexDir == null ) {
        throw new SearchException( "To use \"native\" as a LockFactory strategy an indexBase path must be set" );
      }
      try {
        return new NativeFSLockFactory( indexDir );
      }
      catch ( IOException e ) {
        throw new SearchException( "Could not initialize NativeFSLockFactory", e );
      }
    }
View Full Code Here

    else if ( "native".equals( lockFactoryName ) ) {
      if ( indexDir == null ) {
        throw new SearchException( "To use \"native\" as a LockFactory strategy an indexBase path must be set" );
      }
      try {
        return new NativeFSLockFactory( indexDir );
      }
      catch ( IOException e ) {
        throw new SearchException( "Could not initialize NativeFSLockFactory", e );
      }
    }
View Full Code Here

       */
      InternalSpellChecker(SearchIndex handler, float minDistance, boolean morePopular) throws IOException
      {
         this.handler = handler;
         String path = handler.getContext().getIndexDirectory() + File.separatorChar + "spellchecker";
         this.spellIndexDirectory = FSDirectory.getDirectory(path, new NativeFSLockFactory(path));
         if (IndexReader.indexExists(spellIndexDirectory))
         {
            this.lastRefresh = System.currentTimeMillis();
         }
         this.spellChecker = new SpellChecker(spellIndexDirectory);
View Full Code Here

TOP

Related Classes of org.apache.lucene.store.NativeFSLockFactory

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.